Go to the source code of this file.
Defines | |
#define | MAXPROCESS 8 |
#define | MAXEVENT 8 |
#define | WORKSPACE 256 |
#define | TICK 5 |
#define | SYSTEM 3 |
#define | PERIODIC 2 |
#define | RR 1 |
#define | NULL 0 |
#define | IDLE 0 |
Typedefs | |
typedef event | EVENT |
Functions | |
void | OS_Init (void) |
Setup the RTOS and create main() as the first SYSTEM level task. | |
void | OS_Abort (void) |
Abort the execution of this RTOS due to an unrecoverable erorr. | |
int | Task_Create (void(*f)(void), int arg, unsigned int level, unsigned int name) |
void | Task_Terminate (void) |
The calling task terminates itself. | |
void | Task_Next (void) |
The calling task gives up its share of the processor voluntarily. | |
int | Task_GetArg (void) |
Retrieve the assigned parameter. | |
EVENT * | Event_Init (void) |
Initialize a new, non-NULL Event descriptor. | |
void | Event_Wait (EVENT *e) |
Wait for the next occurrence of a signal on e. The calling process always blocks. | |
void | Event_Signal (EVENT *e) |
Resume a single waiting task on e. It is a no-op if there is no waiting process. | |
void | Event_Broadcast (EVENT *e) |
Resume ALL waiting tasks on e. It is a no-op if there is no waiting process. | |
void | Signal_And_Next (EVENT *e) |
Resume a waiting task on e and at the same time relinquish the processor. | |
void | Broadcast_And_Next (EVENT *e) |
Resume ALL waiting tasks on e and at the same time relinquish the processor. | |
Variables | |
const unsigned char | PPP [] |
const unsigned int | PT |
Definition in file os.h.
#define TICK 5 |
milliseconds, or something close to this value
#define SYSTEM 3 |
a scheduling level: system tasks with first-come-first-served policy
#define PERIODIC 2 |
a scheduling level: periodic tasks with predefined intervals
#define RR 1 |
A scheduling level: first-come-first-served cooperative tasks
typedef struct event EVENT |
void OS_Init | ( | void | ) |
void OS_Abort | ( | void | ) |
Abort the execution of this RTOS due to an unrecoverable erorr.
Abort the execution of this RTOS due to an unrecoverable erorr.
int Task_Create | ( | void(*)(void) | f, | |
int | arg, | |||
unsigned int | level, | |||
unsigned int | name | |||
) |
f | a parameterless function to be created as a process instance | |
arg | an integer argument to be assigned to this process instanace | |
level | assigned scheduling level: SYSTEM, PERIODIC or RR | |
name | assigned PERIODIC process name |
void Task_Terminate | ( | void | ) |
void Task_Next | ( | void | ) |
int Task_GetArg | ( | void | ) |
EVENT* Event_Init | ( | void | ) |
void Event_Wait | ( | EVENT * | e | ) |
void Event_Signal | ( | EVENT * | e | ) |
Resume a single waiting task on e. It is a no-op if there is no waiting process.
e | an Event descriptor |
void Event_Broadcast | ( | EVENT * | e | ) |
Resume ALL waiting tasks on e. It is a no-op if there is no waiting process.
e | an Event descriptor |
void Signal_And_Next | ( | EVENT * | e | ) |
Resume a waiting task on e and at the same time relinquish the processor.
e | an Event descriptor |
void Broadcast_And_Next | ( | EVENT * | e | ) |
Resume ALL waiting tasks on e and at the same time relinquish the processor.
e | an Event descriptor |
const unsigned char PPP[] |
A periodic task scheduling plan (read-only, defined by the application).
This is specified by the application. The scheduling ordering and duration of all PERIODIC tasks are specified by this plan. The total number of occurrences of all PERIODIC tasks, including IDLE, is given by PT. e.g., PPP[] = { A, 2, IDLE, 5, B, 1, A, 2, C, 4 }; PT = 5;
const unsigned int PT |