[hal, wpilib] Expose sticky hardware and firmware faults in PDH and PH (#6900)

This commit is contained in:
Ryan Blue
2024-08-02 22:13:43 -04:00
committed by GitHub
parent 01c47e5bcc
commit 7938d79648
8 changed files with 38 additions and 2 deletions

View File

@@ -624,6 +624,8 @@ void HAL_GetREVPDHStickyFaults(HAL_REVPDHHandle handle,
stickyFaults->brownout = status4.sticky_brownout_fault;
stickyFaults->canWarning = status4.sticky_can_warning_fault;
stickyFaults->canBusOff = status4.sticky_can_bus_off_fault;
stickyFaults->hardwareFault = status4.sticky_hardware_fault;
stickyFaults->firmwareFault = status4.sticky_firmware_fault;
stickyFaults->hasReset = status4.sticky_has_reset_fault;
}

View File

@@ -737,6 +737,8 @@ void HAL_GetREVPHStickyFaults(HAL_REVPHHandle handle,
stickyFaults->brownout = status1.sticky_brownout_fault;
stickyFaults->canWarning = status1.sticky_can_warning_fault;
stickyFaults->canBusOff = status1.sticky_can_bus_off_fault;
stickyFaults->hardwareFault = status1.sticky_hardware_fault;
stickyFaults->firmwareFault = status1.sticky_firmware_fault;
stickyFaults->hasReset = status1.sticky_has_reset_fault;
}

View File

@@ -362,6 +362,10 @@ struct HAL_PowerDistributionStickyFaults {
uint32_t canWarning : 1;
/** The device's CAN controller experienced a "Bus Off" event. */
uint32_t canBusOff : 1;
/** The hardware on the device has malfunctioned. */
uint32_t hardwareFault : 1;
/** The firmware on the device has malfunctioned. */
uint32_t firmwareFault : 1;
/** The device has rebooted. */
uint32_t hasReset : 1;
};

View File

@@ -122,6 +122,10 @@ struct HAL_REVPHStickyFaults {
uint32_t canWarning : 1;
/** The device's CAN controller experienced a "Bus Off" event. */
uint32_t canBusOff : 1;
/** The hardware on the device has malfunctioned. */
uint32_t hardwareFault : 1;
/** The firmware on the device has malfunctioned. */
uint32_t firmwareFault : 1;
/** The device has rebooted. */
uint32_t hasReset : 1;
};