|
PIC24 Support Libraries
|
Central code for Embedded Systems Operating System (ESOS) More...
#include "esos.h"Go to the source code of this file.
Macros | |
| #define | MAX_NUM_USER_TASKS 16 |
Functions | |
| ESOS_TASK_HANDLE | esos_RegisterTask (uint8(*taskname)(ESOS_TASK_HANDLE pstTask)) |
| uint8 | esos_UnregisterTask (uint8(*taskname)(ESOS_TASK_HANDLE pstTask)) |
| ESOS_TASK_HANDLE | esos_GetFreeChildTaskStruct () |
| void | esos_SetRandomUint32Seed (uint32 u32_in) |
| uint32 | esos_GetRandomUint32 (void) |
| uint8 | esos_GetMaxNumberTasks (void) |
| ESOS_TMR_HANDLE | esos_RegisterTimer (void(*timername)(void), uint32 u32_period) |
| uint8 | esos_UnregisterTimer (ESOS_TMR_HANDLE hnd_timer) |
| ESOS_TMR_HANDLE | esos_GetTimerHandle (void(*pfnTmrFcn)(void)) |
| uint8 | esos_ChangeTimerPeriod (ESOS_TMR_HANDLE hnd_timer, uint32 u32_period) |
Central code for Embedded Systems Operating System (ESOS)
Definition in file esos.c.
| #define MAX_NUM_USER_TASKS 16 |
Define the maximum number of user tasks in the system
Definition at line 57 of file esos.c.
Referenced by esos_GetMaxNumberTasks(), and esos_RegisterTask().
| uint8 esos_ChangeTimerPeriod | ( | ESOS_TMR_HANDLE | hnd_timer, |
| uint32 | u32_period | ||
| ) |
Change a timer period.
| hnd_timer | handle to timer whose period is to be changed |
| u32_period | new period for timer selected by mask |
| FALSE | if timer is not currently running |
| TRUE | if timer period was changed |
| ESOS_TASK_HANDLE esos_GetFreeChildTaskStruct | ( | ) |
| uint8 esos_GetMaxNumberTasks | ( | void | ) |
| uint32 esos_GetRandomUint32 | ( | void | ) |
Returns a 31-bit pseudo-random number generated by the Park-Miller algorithm.
| ESOS_TMR_HANDLE esos_GetTimerHandle | ( | void(*)(void) | pfnTmrFcn) |
Finds the timer handle to the provided and ACTIVE timer function
| pfnTmrFcn | pointer to timer function (will execute each time timer expires) |
| ESOS_TMR_FAILURE | could not find the function in the active timer list |
| timerHandle | handle to timer |
| ESOS_TASK_HANDLE esos_RegisterTask | ( | uint8(*)(ESOS_TASK_HANDLE pstTask) | taskname) |
Adds a task to the scheduler. Task will start executing at the next opportunity. (almost immediately)
| taskname | name of task (argument to ESOS_USER_TASK declaration |
| NULLPTR | if no more tasks can execute at this time (scheduler is full) |
| TaskHandle | the handle of the just registered and scheduled task |
Definition at line 94 of file esos.c.
Referenced by user_init().
| ESOS_TMR_HANDLE esos_RegisterTimer | ( | void(*)(void) | timername, |
| uint32 | u32_period | ||
| ) |
Adds a timer to the ESOS timer service. Timer function will execute at its next opportunity. Timer functions must have void arguments and void returns.
| timername | name under which timer was declared in ESOS_USER_TIMER. and contains the code to run when software timer expires |
| u32_period | period of timer in system ticks (currently, milliseconds) |
| ESOS_TMR_FAILURE | if no more timers can added at this time |
| timerhandle | if timer service was registered |
Definition at line 302 of file esos.c.
Referenced by user_init().
| void esos_SetRandomUint32Seed | ( | uint32 | u32_in) |
Sets the seed value in the ESOS pseudo-random number generator (PRNG).
| uint8 esos_UnregisterTask | ( | uint8(*)(ESOS_TASK_HANDLE pstTask) | taskname) |
Removes the task from the scheduler
| taskname | name of task (argument to ESOS_USER_TASK declaration |
| TRUE | if task was found in scheduler and removed |
| FALSE | otherwise |
| uint8 esos_UnregisterTimer | ( | ESOS_TMR_HANDLE | hnd_timer) |
Removes a timer from the ESOS timer service.
| hnd_timer | handle to timer to remove |
| FALSE | if timer wasn't active in the first place |
| TRUE | if timer was stopped and removed |
1.8.4