EmbeddedEtcher
Functions
scheduler.c File Reference
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include "scheduler.h"
#include "error.h"
#include "heap.h"
#include "printf.h"
#include "ossettings.h"
#include "../platform/system_timer.h"
Include dependency graph for scheduler.c:

Functions

uint32_t osSchedulerGetSysT (void)
 
uint8_t osTaskCreate (void(*ifnc_ptr)(void *), char *itask_name, void *iarguments, uint8_t ipriority, const osTCB_t *oTaskHandle)
 
void osTaskDelete (osTCB_t *iotask)
 
void osTaskDelay (uint8_t idelay)
 
void osTaskDelayUntil (uint32_t iwakeup_time, uint8_t idelay)
 
void osRunScheduler (void)
 
void osPrintTask (uint8_t iindex)
 
void osPrintAllTasks (void)
 

Function Documentation

◆ osPrintAllTasks()

void osPrintAllTasks ( void  )

Print all information about all tasks.

◆ osPrintTask()

void osPrintTask ( uint8_t  iindex)

Print all information about one task.

Parameters
iindexIndex in the TCB array.

◆ osRunScheduler()

void osRunScheduler ( void  )

System core. Scheduler needs to be executed by a timer interrupt.

◆ osSchedulerGetSysT()

uint32_t osSchedulerGetSysT ( void  )

Get the system time.

Return values
Givesback the number of ticks since system has been initialized.

◆ osTaskCreate()

uint8_t osTaskCreate ( void(*)(void *)  ifnc_ptr,
char *  itask_name,
void *  iarguments,
uint8_t  ipriority,
const osTCB_t oTaskHandle 
)

Spawn a task.

Parameters
ifnc_ptrPointer to the task function.
itask_nameInternal task name.
iargumentsEnables passing user-defined arguments to the task.
ipriorityA higher value means a higher priority of the task.
oTaskHandlePointer to TCB.
Return values
1(task has been spawned) or 0 (FAILED)

◆ osTaskDelay()

void osTaskDelay ( uint8_t  idelay)

Delay function. DO NOT USE FOR PERIODIC TASKS!

Parameters
idelayDelay in system ticks.

◆ osTaskDelayUntil()

void osTaskDelayUntil ( uint32_t  iwakeup_time,
uint8_t  idelay 
)

Delay until function. DO USE FOR PERIODIC TASKS!

Parameters
iwakeup_timeTime when the task execution started.
idelayNumber of system ticks until the task shall be executed again.

◆ osTaskDelete()

void osTaskDelete ( osTCB_t iotask)

Simply delete task by setting the function pointer to NULL.

Parameters
iotaskPointer to TCB.