6fe513fd66
This reverts commit 237816d8f9.
Reason: IQ.Pilot panda 子系统依赖 cereal::IQCarParams 和 iqState
service,在 openpilot 标准 cereal 中不存在,设备上编译失败。
回退到上一个正常编译版本。panda 固件层(F4/H7)已确认编译通过,
保留固件编译修复的成果。
26 lines
659 B
C
26 lines
659 B
C
#include "board/sys/sys.h"
|
|
|
|
uint8_t fault_status = FAULT_STATUS_NONE;
|
|
uint32_t faults = 0U;
|
|
|
|
void fault_occurred(uint32_t fault) {
|
|
if ((faults & fault) == 0U) {
|
|
if ((PERMANENT_FAULTS & fault) != 0U) {
|
|
print("Permanent fault occurred: 0x"); puth(fault); print("\n");
|
|
fault_status = FAULT_STATUS_PERMANENT;
|
|
} else {
|
|
print("Temporary fault occurred: 0x"); puth(fault); print("\n");
|
|
fault_status = FAULT_STATUS_TEMPORARY;
|
|
}
|
|
}
|
|
faults |= fault;
|
|
}
|
|
|
|
void fault_recovered(uint32_t fault) {
|
|
if ((PERMANENT_FAULTS & fault) == 0U) {
|
|
faults &= ~fault;
|
|
} else {
|
|
print("Cannot recover from a permanent fault!\n");
|
|
}
|
|
}
|