cocoOS  5.0.1
os_task.h File Reference
#include "os_defines.h"
#include "os_msgqueue.h"

Go to the source code of this file.

Macros

#define TASK_OFS1   30000
 
#define TASK_OFS2   31000
 
#define OS_SUSPEND_TASK(id)
 
#define OS_RESUME_TASK(id)
 

Typedefs

typedef struct tcb tcb
 

Enumerations

enum  TaskState_t {
  SUSPENDED, WAITING_SEM, WAITING_TIME, WAITING_EVENT,
  WAITING_EVENT_TIMEOUT, READY, RUNNING, KILLED
}
 

Functions

void os_task_init (void)
 
uint8_t os_task_highest_prio_ready_task (void)
 
uint8_t os_task_next_ready_task (void)
 
void os_task_ready_set (uint8_t tid)
 
void os_task_wait_sem_set (uint8_t tid, Sem_t sem)
 
void os_task_suspend (uint8_t tid)
 
void os_task_resume (uint8_t tid)
 
void os_task_kill (uint8_t tid)
 
uint8_t os_task_prio_get (uint8_t tid)
 
void os_task_clear_wait_queue (uint8_t tid)
 
void os_task_wait_time_set (uint8_t tid, uint8_t id, uint16_t time)
 
void os_task_wait_event (uint8_t tid, Evt_t eventId, uint8_t waitSingleEvent, uint16_t timeout)
 
void os_task_tick (uint8_t id, uint16_t tickSize)
 
void os_task_signal_event (Evt_t eventId)
 
void os_task_run (void)
 
uint16_t os_task_internal_state_get (uint8_t tid)
 
void os_task_internal_state_set (uint8_t tid, uint16_t state)
 
void os_task_release_waiting_task (Sem_t sem)
 
uint8_t os_task_waiting_this_semaphore (Sem_t sem)
 
MsgQ_t os_task_msgQ_get (uint8_t tid)
 
void os_task_set_wait_queue (uint8_t tid, MsgQ_t queue)
 
MsgQ_t os_task_get_wait_queue (uint8_t tid)
 
void os_task_set_change_event (uint8_t tid, Evt_t event)
 
Evt_t os_task_get_change_event (uint8_t tid)
 
void os_task_set_msg_result (uint8_t tid, uint8_t result)
 
uint8_t os_task_get_msg_result (uint8_t tid)
 
uint16_t os_task_timeout_get (uint8_t tid)
 

Detailed Description

Task header file

Macro Definition Documentation

#define OS_RESUME_TASK (   id)
Value:
do {\
os_task_resume( id );\
if ( id == running_tid ) {\
OS_SCHEDULE(TASK_OFS2);\
}\
} while (0)
#define OS_SUSPEND_TASK (   id)
Value:
do {\
os_task_suspend( id );\
if ( id == running_tid ) {\
OS_SCHEDULE(TASK_OFS1);\
}\
} while (0)