software:firmware
MakAir Firmware
|
Controls breathing activation ON/OFF state. More...
#include <activation.h>
Public Member Functions | |
ActivationController () | |
void | refreshState () |
Refresh the current state. More... | |
bool | isRunning () const |
Return if breathing is activated or not. More... | |
void | changeState (uint16_t state) |
Change the current state. More... | |
void | onStartButton () |
Callback to call each time the start button is pushed. More... | |
void | onStopButton () |
Callback to call each time the stop button is pushed. More... | |
Private Types | |
enum | State { STOPPED = 0 , RUNNING , RUNNING_READY_TO_STOP } |
Private Attributes | |
State | m_state |
Activation status. More... | |
uint32_t | m_timeOfLastStopPushed |
Last time stop button was pushed. More... | |
Controls breathing activation ON/OFF state.
Definition at line 18 of file activation.h.
|
private |
Enumerator | |
---|---|
STOPPED | Breathing is OFF. |
RUNNING | Breathing is ON. |
RUNNING_READY_TO_STOP | Breathing is ON, waiting for a second push to stop. |
Definition at line 52 of file activation.h.
ActivationController::ActivationController | ( | ) |
Definition at line 25 of file activation.cpp.
void ActivationController::changeState | ( | uint16_t | state | ) |
|
inline |
Return if breathing is activated or not.
Definition at line 32 of file activation.h.
void ActivationController::onStartButton | ( | ) |
Callback to call each time the start button is pushed.
Definition at line 27 of file activation.cpp.
void ActivationController::onStopButton | ( | ) |
Callback to call each time the stop button is pushed.
Definition at line 37 of file activation.cpp.
void ActivationController::refreshState | ( | ) |
Refresh the current state.
Definition at line 49 of file activation.cpp.
|
private |
Activation status.
Definition at line 64 of file activation.h.
|
private |
Last time stop button was pushed.
Definition at line 67 of file activation.h.