BRTOS
1.90
Brazilian Real-Time Operating System
|
BRTOS kernel functions. More...
#include "BRTOS.h"
Functions | |
uint8_t | OSSchedule (void) |
Priority Preemptive Scheduler (Internal kernel function). More... | |
BRTOS_TH | OSGetCurrentTaskHandle (void) |
Return the handle of the current task. The user must call this function in order to receive the current task handle. More... | |
OS_CPU_TYPE | OSGetTaskPriority (BRTOS_TH task_handle) |
Return the priority of the specified task. The user must call this function in order to receive the priority of the specified task. More... | |
ostick_t | OSGetTickCount (void) |
Return current tick count. The user must call this function in order to receive the current tick count. More... | |
ostick_t | OSGetCount (void) |
Return current tick count. Internal BRTOS function. More... | |
void | OSIncCounter (void) |
Update the tick counter. More... | |
uint8_t | OSDelayTask (ostick_t time_wait) |
Wait for a specified period. A task that calling this function will be suspended for a certain time. When this time is reached the task back to ready state. More... | |
uint8_t | OSDelayTaskHMSM (uint8_t hours, uint8_t minutes, uint8_t seconds, uint16_t miliseconds) |
Wait for a specified period (in hours, minutes, seconds and miliseconds). A task that calling this function will be suspended for a certain time. When this time is reached the task back to ready state. More... | |
void | OS_TICK_HANDLER (void) |
Tick timer interrupt handler routine (Internal kernel function). | |
uint8_t | BRTOSStart (void) |
Start the Operating System Scheduler The user must call this function to start the tasks execution. More... | |
void | PreInstallTasks (void) |
Function that initialize the kernel main variables. This function resets the kernel main variables, preparing the system to be started. More... | |
uint8_t | OSBlockPriority (uint8_t iPriority) |
Blocks a specific priority Blocks the task that is associated with the specified priority. The user must be careful when using this function in together with mutexes. This can lead to undesired results due the "cealing priority" property used in the mutex. More... | |
uint8_t | OSUnBlockPriority (uint8_t iPriority) |
UnBlock a specific priority UnBlocks the task that is associated with the specified priority. The user must be careful when using this function in together with mutexes. This can lead to undesired results due the "cealing priority" property used in the mutex. More... | |
uint8_t | OSBlockMultipleTask (uint8_t TaskStart, uint8_t TaskNumber) |
Blocks a set of tasks. More... | |
uint8_t | OSUnBlockMultipleTask (uint8_t TaskStart, uint8_t TaskNumber) |
UnBlocks a set of tasks. More... | |
void | Idle (void) |
Idle Task. May be used to implement low power commands. More... | |
void | BRTOSInit (void) |
Initialize BRTOS control blocks and tick timer (Internal kernel function). | |
void | initEvents (void) |
Initialize event control blocks. More... | |
uint8_t | SAScheduler (PriorityType ReadyList) |
Sucessive Aproximation Scheduler (Internal kernel function). More... | |
Variables | |
const CHAR8 version[] | PROGMEM = BRTOS_VERSION |
Informs BRTOS version. | |
uint8_t | PriorityVector [configMAX_TASK_INSTALL] |
Allocate task priorities. | |
uint16_t | iStackAddress = 0 |
Virtual stack counter - Informs the stack occupation in bytes. | |
uint16_t | iQueueAddress = 0 |
Queue heap control. | |
stack_pointer_t | StackAddress |
Virtual stack pointer. | |
uint8_t | NumberOfInstalledTasks |
Number of Installed tasks at the moment. | |
volatile uint8_t | currentTask |
Current task being executed. | |
volatile uint32_t | OSDuty =0 |
Used to compute the CPU load. | |
volatile uint32_t | OSDutyTmp =0 |
Used to compute the CPU load. | |
volatile uint16_t | LastOSDuty = 0 |
Last CPU load computed. | |
uint16_t | DutyCnt = 0 |
Used to compute the CPU load. | |
uint32_t | TaskAlloc = 0 |
Used to search a empty task control block. | |
uint8_t | iNesting = 0 |
Used to inform if the current code position is an interrupt handler code. | |
ContextType | ContextTask [NUMBER_OF_TASKS+1] |
BRTOS kernel functions.
Kernel functions, such as: scheduler, block tasks, unblock tasks, Delay, Change Context
uint8_t BRTOSStart | ( | void | ) |
Start the Operating System Scheduler The user must call this function to start the tasks execution.
void Idle | ( | void | ) |
Idle Task. May be used to implement low power commands.
void initEvents | ( | void | ) |
Initialize event control blocks.
uint8_t OSBlockMultipleTask | ( | uint8_t | TaskStart, |
uint8_t | TaskNumber | ||
) |
Blocks a set of tasks.
TaskStart | Number of the first task to be blocked |
TaskNumber | Number of tasks to be blocked from the specified task start |
uint8_t OSBlockPriority | ( | uint8_t | iPriority | ) |
Blocks a specific priority Blocks the task that is associated with the specified priority. The user must be careful when using this function in together with mutexes. This can lead to undesired results due the "cealing priority" property used in the mutex.
iPriority | Priority to be blocked |
uint8_t OSDelayTask | ( | ostick_t | time_wait | ) |
Wait for a specified period. A task that calling this function will be suspended for a certain time. When this time is reached the task back to ready state.
time_wait | Time in ticks to delay. System default = 1ms. The user can change the time value. |
uint8_t OSDelayTaskHMSM | ( | uint8_t | hours, |
uint8_t | minutes, | ||
uint8_t | seconds, | ||
uint16_t | miliseconds | ||
) |
Wait for a specified period (in hours, minutes, seconds and miliseconds). A task that calling this function will be suspended for a certain time. When this time is reached the task back to ready state.
hours | Hours to delay |
minutes | Minutes to delay |
seconds | Seconds to delay |
miliseconds | Miliseconds to delay |
ostick_t OSGetCount | ( | void | ) |
Return current tick count. Internal BRTOS function.
BRTOS_TH OSGetCurrentTaskHandle | ( | void | ) |
Return the handle of the current task. The user must call this function in order to receive the current task handle.
BRTOS_TH OSGetTaskPriority | ( | BRTOS_TH | task_handle | ) |
Return the priority of the specified task. The user must call this function in order to receive the priority of the specified task.
ostick_t OSGetTickCount | ( | void | ) |
Return current tick count. The user must call this function in order to receive the current tick count.
void OSIncCounter | ( | void | ) |
Update the tick counter.
uint8_t OSSchedule | ( | void | ) |
Priority Preemptive Scheduler (Internal kernel function).
BRTOS Scheduler function (Internal kernel function).
uint8_t OSUnBlockMultipleTask | ( | uint8_t | TaskStart, |
uint8_t | TaskNumber | ||
) |
UnBlocks a set of tasks.
TaskStart | Number of the first task to be unblocked |
TaskNumber | Number of tasks to be unblocked from the specified task start |
uint8_t OSUnBlockPriority | ( | uint8_t | iPriority | ) |
UnBlock a specific priority UnBlocks the task that is associated with the specified priority. The user must be careful when using this function in together with mutexes. This can lead to undesired results due the "cealing priority" property used in the mutex.
iPriority | Priority to be unblocked |
void PreInstallTasks | ( | void | ) |
Function that initialize the kernel main variables. This function resets the kernel main variables, preparing the system to be started.
uint8_t SAScheduler | ( | PriorityType | ReadyList | ) |
Sucessive Aproximation Scheduler (Internal kernel function).
ReadyList | List of the tasks ready to run |
ContextType ContextTask[NUMBER_OF_TASKS+1] |
Task context info ContextTask[0] not used Last ContexTask is the Idle Task