volatile uint16_t | sysOsTimer_Initialize (void) |
Initializes the timer used as time-base for the task scheduler. More... | |
volatile uint16_t | sysOsTimer_Enable (volatile bool interrupt_enable, volatile uint8_t interrupt_priority) |
A simple 16-bit timer is used to generate the time base of the operating system. This timer is set to overflow after the time period specified by MAIN_EXECUTION_PERIOD in the hardware abstraction layer. This time period is used to pace the high- and low priority task sequences of the main program.
Two public functions are provided to initialize the time base, configuring its desired period as well as setting up the interrupt priority of the high priority task sequence execution, and an ENABLE function, enabling the high priority task sequence execution interrupt.
Once the OS Timer and its interrupts are enabled, the main program will start to execute the user tasks with their respective priority and in their given order.
volatile uint16_t sysOsTimer_Enable | ( | volatile bool | interrupt_enable, |
volatile uint8_t | interrupt_priority | ||
) |
Definition at line 81 of file init_timer1.c.
uint16_t sysOsTimer_Initialize | ( | void | ) |
Initializes the timer used as time-base for the task scheduler.
The internal PLL is set up to operate the CPU at maximum speed of 100 MIPS (100 MHz instruction cycle).
The task scheduler runs on a specific, usually fixed time base specified in the state machine section of the hardware abstraction layer (e.g. 100us). This routine initializes a device timer exclusively used for that purpose which is not shared with other tasks/peripherals to ensure stable, deterministic behavior of the firmware. The timer does not use interrupts. The scheduler task execution period is controlled by polling on the timer overrun bit, allowing some more relaxed timing while not putting additional burden on the CPU.
Definition at line 40 of file init_timer1.c.