STM32 RTC Scheduler
RTC-based scheduler for ultra-low power applications
|
This file contains the main application implementation, including the RTOS task implementations, RTOS hooks and scheduler callback implementations. More...
#include "main.h"
#include "FreeRTOS.h"
#include "core_stop.h"
#include "error_handler.h"
#include "hardware.h"
#include "rtc.h"
#include "scheduler.h"
#include "task.h"
#include "timers.h"
Go to the source code of this file.
Functions | |
void | TaskLedBlink (void *arg) |
This function implements the blinking LED RTOS task. More... | |
void | TaskLedSteady (void *arg) |
This function implements the steady LED RTOS task. More... | |
void | JobShortPeriodCallback (void) |
The callback function for the short period job. More... | |
void | JobLongPeriodCallback (void) |
The callback function for the long period job. More... | |
TickType_t | GetExpectedIdleTime (void) |
Get the expected idle time from RTOS kernel. More... | |
UBaseType_t | IsDelayedTaskListEmpty (void) |
Check whether the delayed task list of RTOS is empty. More... | |
int | main (void) |
The main function of the application. More... | |
void | vApplicationDaemonTaskStartupHook (void) |
RTOS daemon startup callback. More... | |
void | vApplicationIdleHook (void) |
RTOS idle task hook. More... | |
void | vApplicationStackOverflowHook (TaskHandle_t xTask, char *pcTaskName) |
RTOS task stack overflow hook. More... | |
void | vApplicationMallocFailedHook (void) |
RTOS malloc failed hook. More... | |
Variables | |
TaskHandle_t | taskHandleLedBlink = NULL |
TaskHandle_t | taskHandleLedSteady = NULL |
This file contains the main application implementation, including the RTOS task implementations, RTOS hooks and scheduler callback implementations.
STM32 RTC Scheduler
Definition in file main.c.
TickType_t GetExpectedIdleTime | ( | void | ) |
Get the expected idle time from RTOS kernel.
Definition at line 27 of file freertos_tasks_c_additions.h.
UBaseType_t IsDelayedTaskListEmpty | ( | void | ) |
Check whether the delayed task list of RTOS is empty.
pdTRUE | if the delayed task list is empty. |
pdFALSE | if there is a task waiting in the delayed task list. |
Definition at line 90 of file freertos_tasks_c_additions.h.
void JobLongPeriodCallback | ( | void | ) |
The callback function for the long period job.
This function is called when the job with long period is pending. The function unblocks the steady LED RTOS task.
void JobShortPeriodCallback | ( | void | ) |
The callback function for the short period job.
This function is called when the job with short period is pending. The function unblocks the blinking LED RTOS task.
int main | ( | void | ) |
void TaskLedBlink | ( | void * | arg | ) |
This function implements the blinking LED RTOS task.
This task waits for an RTOS task notification to unblock. The notification is given in the callback function of the short period job. The task blinks the LD3 LED twice, then waits until the task is unblocked again.
arg | The RTOS task argument. |
void TaskLedSteady | ( | void * | arg | ) |
This function implements the steady LED RTOS task.
This task waits for an RTOS task notification to unblock. The notification is given in the callback function of the long period job. The task turns on the LD2 LED, waits 1 second, turns off the LD2 LED, then waits until the task is unblocked again.
arg | The RTOS task argument. |
void vApplicationDaemonTaskStartupHook | ( | void | ) |
void vApplicationIdleHook | ( | void | ) |
RTOS idle task hook.
This function is called once per idle task execution. During each function call, the function asks the RTOS kernel what is the expected idle time and whether the delayed task list is empty. If the expected idle time is greater than a specified duration and the delayed task list is empty, the function enters into STOP2 mode.
void vApplicationMallocFailedHook | ( | void | ) |
void vApplicationStackOverflowHook | ( | TaskHandle_t | xTask, |
char * | pcTaskName | ||
) |
TaskHandle_t taskHandleLedBlink = NULL |