This is the implementation of LoRaWAN system task manager.
Copyright (c) 2018 Microchip Technology Inc. and its subsidiaries.
Macros | |
#define | SYSTEM_TASK_ID_COUNT 5u |
Functions | |
SYSTEM_TaskStatus_t | APP_TaskHandler (void) |
This function is called to process APP task. SHOULD be defined in APP. More... | |
SYSTEM_TaskStatus_t | LORAWAN_TaskHandler (void) |
This function is called to process LORAWAN task. SHOULD be defined in LORAWAN. More... | |
SYSTEM_TaskStatus_t | PDS_TaskHandler (void) |
This function is called to process pds task. SHOULD be defined in PDS. More... | |
SYSTEM_TaskStatus_t | RADIO_TaskHandler (void) |
This function is called to process RADIO task. SHOULD be defined in RADIO. More... | |
void | SYSTEM_PostTask (SYSTEM_Task_t task) |
Posts a task to the task manager, which is later processed by the task handler of the corresponding stack layer. More... | |
bool | SYSTEM_ReadyToSleep (void) |
Returns the readiness of the system for sleep. More... | |
void | SYSTEM_RunTasks (void) |
System tasks execution entry point. More... | |
SYSTEM_TaskStatus_t | TIMER_TaskHandler (void) |
This function is called to process system timer task. SHOULD be defined in TIMER. More... | |
Variables | |
static volatile uint16_t | sysTaskFlag = 0u |
static SYSTEM_TaskStatus_t(* | taskHandlers [SYSTEM_TASK_ID_COUNT])(void) |
#define SYSTEM_TASK_ID_COUNT 5u |
Referenced by SYSTEM_RunTasks().
SYSTEM_TaskStatus_t APP_TaskHandler | ( | void | ) |
This function is called to process APP task. SHOULD be defined in APP.
References APP_TASK_ID, APP_TASKS_COUNT, appTaskFlags, appTaskHandlers, ATOMIC_SECTION_ENTER, ATOMIC_SECTION_EXIT, SYSTEM_PostTask(), and SYSTEM_TASK_SUCCESS.
Referenced by main(), and wsndemo_task().
SYSTEM_TaskStatus_t LORAWAN_TaskHandler | ( | void | ) |
This function is called to process LORAWAN task. SHOULD be defined in LORAWAN.
SYSTEM_TaskStatus_t PDS_TaskHandler | ( | void | ) |
This function is called to process pds task. SHOULD be defined in PDS.
This function is called to process pds task. SHOULD be defined in PDS.
SYSTEM_TaskStatus_t RADIO_TaskHandler | ( | void | ) |
This function is called to process RADIO task. SHOULD be defined in RADIO.
void SYSTEM_PostTask | ( | SYSTEM_Task_t | task | ) |
Posts a task to the task manager, which is later processed by the task handler of the corresponding stack layer.
A task is processed when the SYSTEM_RunTasks() function.
IDs of the tasks are listed in the SYSTEM_Task_t enum. Each task has its own priority and is called only if there is no any task with higher priority.
A handler is called when respective task can be run. Each task has its own task handler.
Correspondence between tasks and handlers is listed below:
RADIO RADIO_TaskHandler()
HAL - HAL_TaskHandler()
LORAWAN - LORAWAN_TaskHandler()
APP - APP_TaskHandler()
[in] | task | - ID of the posted task. |
References ATOMIC_SECTION_ENTER, ATOMIC_SECTION_EXIT, and sysTaskFlag.
Referenced by APP_TaskHandler(), appPostTask(), messageTimerCb(), MSG_Send(), PDS_TaskHandler(), pdsPostTask(), processRunRestoreBand(), processRxDataAvailable(), and Stack_Init().
bool SYSTEM_ReadyToSleep | ( | void | ) |
Returns the readiness of the system for sleep.
References sysTaskFlag.
Referenced by PMM_Sleep().
void SYSTEM_RunTasks | ( | void | ) |
System tasks execution entry point.
This function is called by the stack or from the main()
References ATOMIC_SECTION_ENTER, ATOMIC_SECTION_EXIT, sysTaskFlag, SYSTEM_TASK_ID_COUNT, and taskHandlers.
Referenced by main(), and pxp_monitor_start_scan().
SYSTEM_TaskStatus_t TIMER_TaskHandler | ( | void | ) |
This function is called to process system timer task. SHOULD be defined in TIMER.
|
static |
Referenced by SYSTEM_PostTask(), SYSTEM_ReadyToSleep(), and SYSTEM_RunTasks().
|
static |
Referenced by SYSTEM_RunTasks().