74 uint64_t commonFaults = 0;
75 commonFaults |=
ShortCircuit ? 1 : 0; commonFaults <<= 1;
76 commonFaults |=
ThermalFault ? 1 : 0; commonFaults <<= 1;
77 commonFaults |=
SoftwareFuse ? 1 : 0; commonFaults <<= 1;
78 commonFaults |=
V5TooLow ? 1 : 0; commonFaults <<= 1;
79 commonFaults |=
V5TooHigh ? 1 : 0; commonFaults <<= 1;
80 commonFaults |=
VBatTooLow ? 1 : 0; commonFaults <<= 1;
81 commonFaults |=
VBatTooHigh ? 1 : 0; commonFaults <<= 1;
83 commonFaults |=
APIError ? 1 : 0; commonFaults <<= 1;
91 APIError = (bits & mask) ?
true :
false; mask <<= 1;
93 VBatTooHigh = (bits & mask) ?
true :
false; mask <<= 1;
94 VBatTooLow = (bits & mask) ?
true :
false; mask <<= 1;
95 V5TooHigh = (bits & mask) ?
true :
false; mask <<= 1;
96 V5TooLow = (bits & mask) ?
true :
false; mask <<= 1;
177 uint64_t commonFaults = 0;
178 commonFaults |=
ShortCircuit ? 1 : 0; commonFaults <<= 1;
179 commonFaults |=
ThermalFault ? 1 : 0; commonFaults <<= 1;
180 commonFaults |=
SoftwareFuse ? 1 : 0; commonFaults <<= 1;
181 commonFaults |=
V5TooLow ? 1 : 0; commonFaults <<= 1;
182 commonFaults |=
V5TooHigh ? 1 : 0; commonFaults <<= 1;
183 commonFaults |=
VBatTooLow ? 1 : 0; commonFaults <<= 1;
184 commonFaults |=
VBatTooHigh ? 1 : 0; commonFaults <<= 1;
186 commonFaults |=
APIError ? 1 : 0; commonFaults <<= 1;
194 APIError = (bits & mask) ?
true :
false; mask <<= 1;
196 VBatTooHigh = (bits & mask) ?
true :
false; mask <<= 1;
197 VBatTooLow = (bits & mask) ?
true :
false; mask <<= 1;
198 V5TooHigh = (bits & mask) ?
true :
false; mask <<= 1;
199 V5TooLow = (bits & mask) ?
true :
false; mask <<= 1;
200 SoftwareFuse = (bits & mask) ?
true :
false; mask <<= 1;
201 ThermalFault = (bits & mask) ?
true :
false; mask <<= 1;
202 ShortCircuit = (bits & mask) ?
true :
false; mask <<= 1;
namespace ctre
Definition: paramEnum.h:5
Faults available to CANdle (Currently has none)
Definition: CANdleFaults.h:13
bool VBatTooLow
VBat is under 5V.
Definition: CANdleFaults.h:29
bool V5TooHigh
5V Line is over 6V
Definition: CANdleFaults.h:41
bool V5TooLow
5V Line is under 4 V
Definition: CANdleFaults.h:37
bool VBatTooHigh
VBat is over 30V.
Definition: CANdleFaults.h:33
int ToBitfield() const
Definition: CANdleFaults.h:73
bool BootDuringEnable
Boot while receiving an enable frame.
Definition: CANdleFaults.h:25
bool ThermalFault
Device is over temperature.
Definition: CANdleFaults.h:49
bool ShortCircuit
Output pin is shorted to something.
Definition: CANdleFaults.h:53
bool HasAnyFault() const
Definition: CANdleFaults.h:58
bool HardwareFault
Device detects hardware failure.
Definition: CANdleFaults.h:17
bool SoftwareFuse
Exceeded output current of 6 amps.
Definition: CANdleFaults.h:45
CANdleFaults(int bits)
Updates current fault list with specified bit field of faults.
Definition: CANdleFaults.h:106
CANdleFaults()
Definition: CANdleFaults.h:109
bool APIError
API error detected.
Definition: CANdleFaults.h:21
void Update(uint64_t bits)
Definition: CANdleFaults.h:88
Faults available to CANdle (Currently has none)
Definition: CANdleFaults.h:116
CANdleStickyFaults(int bits)
Updates current fault list with specified bit field of faults.
Definition: CANdleFaults.h:209
bool HasAnyFault() const
Definition: CANdleFaults.h:161
int ToBitfield() const
Definition: CANdleFaults.h:176
bool HardwareFault
Device detects hardware failure.
Definition: CANdleFaults.h:120
bool ThermalFault
Device is over temperature.
Definition: CANdleFaults.h:152
bool ShortCircuit
Output pin is shorted to something.
Definition: CANdleFaults.h:156
CANdleStickyFaults()
Definition: CANdleFaults.h:212
bool VBatTooLow
VBat is under 5V.
Definition: CANdleFaults.h:132
void Update(uint64_t bits)
Definition: CANdleFaults.h:191
bool APIError
API error detected.
Definition: CANdleFaults.h:124
bool SoftwareFuse
Exceeded output current of 6 amps.
Definition: CANdleFaults.h:148
bool BootDuringEnable
Boot while receiving an enable frame.
Definition: CANdleFaults.h:128
bool V5TooLow
5V Line is under 4 V
Definition: CANdleFaults.h:140
bool V5TooHigh
5V Line is over 6V
Definition: CANdleFaults.h:144
bool VBatTooHigh
VBat is over 30V.
Definition: CANdleFaults.h:136