Quote:
Originally Posted by Greg Fordyce
Code:
#define THROTTLE_FAULT (1 << 0)
#define VREF_FAULT (1 << 1)
#define PRECHARGE_WAIT (1 << 5)
#define MOTOR_OS_FAULT (1 << 6)
#define HPL_FAULT (1 << 7)
So what is the values for the above faults, and can the controller set multiple faults at the same time?
|
1 << 5 (for example) means 2^5, which is 32. 1 << x means 2^x. So, you can set each of those bits individually. If everything is working,
fault_bits = 00000000 (in binary)
If fault_bits = 11100011, then that's just horrible! haha. That means that there is a high pedal lockout fault set, and a motor overspeed fault, and a precharge wait fault, and the current sensor is out of range, and the throttle is out of range.
fault_bits = 00100000 would mean a precharge wait fault.