|
Lamp-Da 0.1
A compact lantern project
|
Handle the main alerts behavior. More...
Go to the source code of this file.
Classes | |
| class | lampda::logic::alerts::AlertManager_t |
| Handle the whole alerts logic. Use this to raise and clear alerts, and make decisions based on those alerts. Alerts can be raised and cleared on their own. More... | |
Namespaces | |
| namespace | lampda |
| Program scope. | |
| namespace | lampda::logic |
| Handle the main high level logics. | |
| namespace | lampda::logic::alerts |
| Handle the system alerts, that are displayed on the RGB indicator. | |
Enumerations | |
| enum class | lampda::logic::alerts::Type : uint32_t { MAIN_LOOP_FREEZE = 1 << 0 , BATTERY_READINGS_INCOHERENT = 1 << 1 , BATTERY_CRITICAL = 1 << 2 , BATTERY_LOW = 1 << 3 , LONG_LOOP_UPDATE = 1 << 4 , TEMP_TOO_HIGH = 1 << 5 , TEMP_CRITICAL = 1 << 6 , BLUETOOTH_ADVERT = 1 << 7 , HARDWARE_ALERT = 1 << 8 , FAVORITE_SET = 1 << 9 , OTG_FAILED = 1 << 10 , SYSTEM_OFF_FAILED = 1 << 11 , SYSTEM_IN_ERROR_STATE = 1 << 12 , SYSTEM_IN_LOCKOUT = 1 << 13 , SUNSET_TIMER_ENABLED = 1 << 14 , SYSTEM_SLEEP_SKIPPED = 1 << 15 , USB_PORT_SHORT = 1 << 16 , BATTERY_MISSING = 1 << 17 , CHARGER_ERROR = 1 << 18 , lampda::logic::alerts::OTG_OVER_LIMITS = 1 << 19 } |
| Alert types : 31 errors max. More... | |
Functions | |
| void | lampda::logic::alerts::signal_wake_up_from_charger () |
| Signal slot that the system just powered up from charger. | |
| void | lampda::logic::alerts::signal_usb_port_fault () |
| Signal a fault of the USB port protection. Safe to call from an interrupt: it only sets a flag. The USB_PORT_SHORT alert is raised (or refreshed) by the next process_interrupt_signals() call. | |
| void | lampda::logic::alerts::process_interrupt_signals () |
| Raise the alerts signaled from interrupts since the last call. Called by the alerts loop and the power thread. | |
| void | lampda::logic::alerts::handle_all (const bool shouldIgnoreAlerts) |
| handle the behavior for all alerts. Must be called often | |
| brightness_t | lampda::logic::alerts::get_alerts_max_brightness () |
| Return the max output brightness allowed by the raised alerts (the lowest of their limits) | |
| void | lampda::logic::alerts::show_all () |
| show all the raised alerts in Serial debug | |
| bool | lampda::logic::alerts::is_request_shutdown () |
| Return true if an alert requested an immediate shutdown. Handling this is urgent or dammages can happen. | |
Handle the main alerts behavior.