STM32 RTC Scheduler
RTC-based scheduler for ultra-low power applications
|
This file contains the RTC-based scheduler function implementations. More...
Go to the source code of this file.
Functions | |
void | Scheduler_ProcessRemainingTime (const uint32_t elapsedTime) |
This function calculates the remaining time for each job. More... | |
void | SchedulerInit (void) |
Initialize the scheduler by setting its structure values to zero. | |
uint8_t | SchedulerAddJob (const uint32_t period, const Callback_t callback) |
Add a new job to the scheduler. More... | |
void | SchedulerProcess (void) |
Process the scheduler. More... | |
void | SchedulerExecutePendingJobs (void) |
Execute the pending jobs. More... | |
void | SchedulerStop (void) |
Stop the scheduler. More... | |
Variables | |
Scheduler_t | scheduler |
This file contains the RTC-based scheduler function implementations.
STM32 RTC Scheduler
Definition in file scheduler.c.
void Scheduler_ProcessRemainingTime | ( | const uint32_t | elapsedTime | ) |
This function calculates the remaining time for each job.
elapsedTime | The elapsed time since the launch of the scheduler. |
Definition at line 220 of file scheduler.c.
uint8_t SchedulerAddJob | ( | const uint32_t | period, |
const Callback_t | callback | ||
) |
Add a new job to the scheduler.
period | The period in [s] which the job needs to be executed. |
callback | The callback function that is called upon job execution. |
Definition at line 43 of file scheduler.c.
void SchedulerExecutePendingJobs | ( | void | ) |
Execute the pending jobs.
This function checks the current state of each job. If a job is pending, its callback is executed.
Definition at line 159 of file scheduler.c.
void SchedulerProcess | ( | void | ) |
Process the scheduler.
This function needs to be called each time upon an RTC alarm interrupt. The function checks all jobs whether they need to be executed and sets the appropriate pending flags.
Definition at line 85 of file scheduler.c.
void SchedulerStop | ( | void | ) |
Stop the scheduler.
This function stops the running scheduler and deactivates the RTC alarm. The function also processes the jobs.
Definition at line 188 of file scheduler.c.
Scheduler_t scheduler |
The scheduler object
Definition at line 20 of file scheduler.c.