mcFaultToString

This commit is contained in:
rusefi 2024-08-25 16:44:28 -04:00
parent a8e4a9f4fc
commit c732810543
2 changed files with 14 additions and 0 deletions

View File

@ -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

View File

@ -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