Skip to content

Commit

Permalink
https://github.com/rusefi/rusefi/issues/6781
Browse files Browse the repository at this point in the history
  • Loading branch information
rusefillc committed Aug 24, 2024
1 parent f13ee7d commit 236cde2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions pt2001/include/rusefi/pt2001.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ class Pt2001Base {

// Print out an error message
virtual void onError(const char* why) = 0;
// useful for poorly designed boards or when short of IO
virtual bool errorOnUnexpectedFlag() = 0;

// Sleep for some number of milliseconds
virtual void sleepMs(size_t ms) = 0;
Expand Down
8 changes: 5 additions & 3 deletions pt2001/src/pt2001.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -462,9 +462,11 @@ bool Pt2001Base::restart() {
// current configuration of REG_MAIN would toggle flag0 from LOW to HIGH
flag0after = readFlag0();
if (flag0before || !flag0after) {
onError(McFault::flag0);
shutdown();
return false;
if (errorOnUnexpectedFlag()) {
onError(McFault::flag0);
shutdown();
return false;
}
}

downloadRegister(REG_CH1); // download channel 1 register configurations
Expand Down

0 comments on commit 236cde2

Please sign in to comment.