AP_HAL: add power status bits to logger metadata

This commit is contained in:
Peter Barker 2024-02-02 14:26:43 +11:00 committed by Andrew Tridgell
parent ecae3a462c
commit b1ade6ccf5
1 changed files with 10 additions and 0 deletions

View File

@ -42,6 +42,16 @@ public:
// failures can still be diagnosed // failures can still be diagnosed
virtual uint16_t accumulated_power_status_flags(void) const { return 0; } virtual uint16_t accumulated_power_status_flags(void) const { return 0; }
// this enum class is 1:1 with MAVLink's MAV_POWER_STATUS enumeration!
enum class PowerStatusFlag : uint16_t {
BRICK_VALID = 1, // main brick power supply valid
SERVO_VALID = 2, // main servo power supply valid for FMU
USB_CONNECTED = 4, // USB power is connected
PERIPH_OVERCURRENT = 8, // peripheral supply is in over-current state
PERIPH_HIPOWER_OVERCURRENT = 16, // hi-power peripheral supply is in over-current state
CHANGED = 32, // Power status has changed since boot
};
#if HAL_WITH_MCU_MONITORING #if HAL_WITH_MCU_MONITORING
virtual float mcu_temperature(void) { return 0; } virtual float mcu_temperature(void) { return 0; }
virtual float mcu_voltage(void) { return 0; } virtual float mcu_voltage(void) { return 0; }