Skip to content

Commit

Permalink
mcFaultToString
Browse files Browse the repository at this point in the history
  • Loading branch information
rusefillc committed Aug 25, 2024
1 parent a8e4a9f commit c732810
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pt2001/include/rusefi/pt2001.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ enum class McFault : uint8_t
UnderVoltage7 = 7,
};

const char * mcFaultToString(McFault fault);

class Pt2001Base {
public:
// Reinitialize the PT2001 chip, returns true if successful
Expand Down
12 changes: 12 additions & 0 deletions pt2001/src/pt2001.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,18 @@ void Pt2001Base::downloadRegister(int r_target) {
// initMc33816IfNeeded();
// }

const char * mcFaultToString(McFault fault) {
switch (fault) {
case McFault::NoComm:
return "NoComm";
case McFault::UnderVoltageAfter:
return "UnderVoltageAfter";
default:
return "TODO";
}
return "TODO";
}

void Pt2001Base::shutdown() {
setDriveEN(false); // ensure HV is off
setResetB(false); // turn off the chip
Expand Down

0 comments on commit c732810

Please sign in to comment.