13 #include "../includes/alarm.h"
14 #include "../includes/cycle.h"
18 #define ALARMS_SIZE 21u
42 #define RCM_SW_23 107u
82 uint32_t p_cycleNumber,
103 uint32_t p_cycle_number);
AlarmPriority
Priority levels of an alarm.
AlarmController alarmController
Instance of the alarm controller.
bool isSnoozed() const
Check if alarms are currently snoozed.
bool m_snoozedAlarms[ALARMS_SIZE]
Collections of snoozed alarms.
void updateCoreData(uint32_t p_tick, uint16_t p_pressure, CyclePhases p_phase, uint32_t p_cycle_number)
Update internal state of alarm controller with data from pressure controller.
AlarmController()
Default constructor.
uint32_t m_cycle_number
Current cycle number.
void detectedAlarm(uint8_t p_alarmCode, uint32_t p_cycleNumber, uint32_t p_expected, uint32_t p_measured)
Mark a specific alarm as detected.
uint32_t m_snoozeTime
Time when snoozed was triggered.
bool m_unsnooze
Is unsnoozed right now.
uint8_t * triggeredAlarms()
Get the alarms triggered during this cycle.
uint16_t m_tick
Current pressure.
void snooze()
Snooze alarm for 2 minutes.
Alarm m_alarms[ALARMS_SIZE]
Collections of available alarms.
CyclePhases m_phase
Current phase.
void updateEnabledAlarms(Alarms enabledAlarms)
Update the list of enabled alarms (alarms not provided here will have no effects)
void unsnooze()
Unsnooze alarms.
uint8_t m_triggeredAlarms[ALARMS_SIZE]
Alarms currently triggered.
void runAlarmEffects(uint32_t p_tick)
Run effects (buzzer, LCD message, LED) according to the currently triggered alarms.
AlarmPriority m_highestPriority
Highest priority of the currently triggered alarms.
void notDetectedAlarm(uint8_t p_alarmCode)
Reset detection of a specific alarm.
uint16_t m_pressure
Current pressure.
Describe an alarm and handle its dynamic state.
CyclePhases
Defines the 2 main phases of the respiratory cycle.
List of alarms (named by their code)
uint8_t alarms[ALARMS_SIZE]