L14-Click 1.0
STM32WLE5CC LoRaWAN Sensor Platform
Loading...
Searching...
No Matches
sleeper_t Struct Reference

Non-blocking timer utility – similar to HAL_Delay but without CPU blocking. More...

#include <utils.h>

Data Fields

uint32_t SleepMS
uint32_t InicTime
uint8_t Stop

Detailed Description

Non-blocking timer utility – similar to HAL_Delay but without CPU blocking.

The caller polls sleeper_IsElapsed() or sleeper_IsElapsedNext() inside its main loop to detect when the configured time interval has elapsed. The timer can also be stopped; in that case all _IsElapsedXX functions return 0 regardless of elapsed time.

Definition at line 27 of file utils.h.

Field Documentation

◆ InicTime

uint32_t sleeper_t::InicTime

Reference timestamp captured at (re)start, used for comparison

Definition at line 30 of file utils.h.

Referenced by sleeper_Init(), sleeper_IsElapsed(), and sleeper_Next().

◆ SleepMS

uint32_t sleeper_t::SleepMS

Duration (ms) to wait; 0 means no pause

Definition at line 29 of file utils.h.

Referenced by sleeper_Init(), sleeper_IsElapsed(), and sleeper_SetSleepMS().

◆ Stop

uint8_t sleeper_t::Stop

1 – timer is stopped (all IsElapsed checks return 0); 0 – running

Definition at line 31 of file utils.h.

Referenced by sleeper_Init(), sleeper_IsElapsed(), sleeper_Next(), and sleeper_Stop().


The documentation for this struct was generated from the following file: