53 void detected(uint32_t p_cycleNumber);
AlarmPriority
Priority levels of an alarm.
Describe an alarm and handle its dynamic state.
bool isTriggered() const
True if the number of detections is equal or above the detection threshold, false otherwise.
bool m_enabled
Whether or not this alarm is enabled.
uint8_t m_detectionThreshold
Alarm detection threshold.
void disable()
Disable this alarm.
AlarmPriority m_priority
Alarm priority.
uint32_t m_cyclesSinceTrigger
Number of cycles since the alarm was triggered.
void detected(uint32_t p_cycleNumber)
If the alarm is detected, it increments the number of detection until the detection threshold.
uint8_t m_detectionNumber
Number of detections.
Alarm(AlarmPriority p_priority, uint8_t p_code, uint8_t p_detectionThreshold)
Parameterized constructor.
void notDetected()
Reset to zero the number of detection.
AlarmPriority getPriority() const
Get the alarm priority.
void enable()
Enable this alarm.
uint8_t getCode() const
Get the alarm code.
uint8_t m_code
Alarm code.
uint32_t getCyclesSinceTrigger() const
Get the number of cycles since the alarm was triggered.
bool isEnabled()
True if this alarm is enabled.
uint32_t m_cycleNumber
Cycle number.