: Header for main.c file. This file contains the common defines of the application.
Non-blocking timer utility – similar to HAL_Delay but without CPU blocking.
Value-stability detector – determines when a periodically updated value has remained unchanged for a ...
uint32_t HAL_GetTick(void)
void valueChanger_Lock(valueChanger_t *v)
Lock the valueChanger_t so that SetValue always returns 0. The lock is cleared automatically the next...
void sleeper_SetSleepMS(sleeper_t *v, uint32_t sleepMS)
Change the sleep duration and restart the timer from now.
int sleeper_IsElapsedNext(sleeper_t *v)
Check whether the time has elapsed and, if so, restart the timer for the next period (InicTime advanc...
void sleeper_Init(sleeper_t *v, uint32_t sleepMS)
Initialise the sleeper and start timing from now.
void clearFlash()
Erase the external flash memory signature so that the next boot forces a full re-initialisation (used...
int sleeper_IsElapsedStop(sleeper_t *v)
Check whether the time has elapsed and, if so, stop the timer.
void sleeper_Stop(sleeper_t *v)
Stop the timer so that all subsequent IsElapsed checks return 0.
void sleeper_Next(sleeper_t *v)
Restart the timer so the next period begins from now. InicTime is updated to the current HAL tick.
void valueChanger_Inic(valueChanger_t *v, TVAL inicValue, uint32_t timeMS)
Initialise a valueChanger_t instance.
TVAL valueChanger_GetValue(const valueChanger_t *v)
Return the most recently stored value.
int valueChanger_SetValue(valueChanger_t *v, TVAL newValue)
Submit a new value sample and check for stability.
int sleeper_IsElapsed(const sleeper_t *v)
Check whether the configured time interval has elapsed.
uint8_t TVAL
Alias for the value type used by valueChanger_t (default: uint8_t).