21 MAIN_LOOP_FREEZE = 1 << 0,
22 BATTERY_READINGS_INCOHERENT = 1 << 1,
24 BATTERY_CRITICAL = 1 << 2,
26 LONG_LOOP_UPDATE = 1 << 4,
28 TEMP_TOO_HIGH = 1 << 5,
29 TEMP_CRITICAL = 1 << 6,
31 BLUETOOTH_ADVERT = 1 << 7,
33 HARDWARE_ALERT = 1 << 8,
35 FAVORITE_SET = 1 << 9,
39 SYSTEM_OFF_FAILED = 1 << 11,
40 SYSTEM_IN_ERROR_STATE = 1 << 12,
42 SYSTEM_IN_LOCKOUT = 1 << 13,
44 SUNSET_TIMER_ENABLED = 1 << 14,
46 SYSTEM_SLEEP_SKIPPED = 1 << 15,
48 USB_PORT_SHORT = 1 << 16,
50 BATTERY_MISSING = 1 << 17,
52 CHARGER_ERROR = 1 << 18,
69 bool is_raised(
const Type type)
const {
return (_current &
static_cast<uint32_t
>(type)) != 0x00; }
72 bool is_clear()
const {
return _current == 0x00; }
Handle the whole alerts logic. Use this to raise and clear alerts, and make decisions based on those ...
Definition: alerts.h:60
uint32_t get_time_since_raised(const Type type) const
the time in milliseconds since this alert was raised, or zero if it's not. This raise time is updated...
Definition: alerts.cpp:890
bool is_clear() const
Return true if no alerts are raised.
Definition: alerts.h:72
bool can_charge_battery() const
Return true if a raised alert prevents battery charging.
Definition: alerts.cpp:921
bool can_use_usb_port() const
Return true if no raised alerts block the use of power through USB port.
Definition: alerts.cpp:936
bool can_use_output_power() const
Return true if a raised alert prevents power set to output.
Definition: alerts.cpp:906
void clear(const Type type)
Clear an alert.
Definition: alerts.cpp:882
void raise(const Type type)
Raise an alert.
Definition: alerts.cpp:858
bool is_raised(const Type type) const
Return true if the target alert is raised.
Definition: alerts.h:69
Type
Alert types : 31 errors max.
Definition: alerts.h:17
void signal_wake_up_from_charger()
Signal slot that the system just powered up from charger.
Definition: alerts.cpp:748
AlertManager_t manager
Instanciation of the AlertManager.
Definition: alerts.cpp:27
bool is_request_shutdown()
Return true if an alert requested an immediate shutdown. Handling this is urgent or dammages can happ...
Definition: alerts.cpp:856
void handle_all(const bool shouldIgnoreAlerts)
handle the behavior for all alerts. Must be called often
Definition: alerts.cpp:750
void show_all()
show all the raised alerts in Serial debug
Definition: alerts.cpp:837
Program scope.
Definition: control_fixed_modes.hpp:12