Go to the documentation of this file.
30 #define TRACE_LEVEL TRACE_LEVEL_OFF
42 #if (configSUPPORT_STATIC_ALLOCATION == 1)
46 configMINIMAL_STACK_SIZE,
67 vTaskStartScheduler();
88 stackSize *=
sizeof(uint32_t);
91 #if (configSUPPORT_STATIC_ALLOCATION == 1)
93 if(params->
tcb != NULL && params->
stack != NULL)
96 handle = xTaskCreateStatic((TaskFunction_t) taskCode,
name,
98 (StackType_t *) params->
stack, params->
tcb);
105 status = xTaskCreate((TaskFunction_t) taskCode,
name, params->
stackSize,
128 vTaskDelete((TaskHandle_t) taskId);
162 if(xTaskGetSchedulerState() != taskSCHEDULER_NOT_STARTED)
177 if(xTaskGetSchedulerState() != taskSCHEDULER_NOT_STARTED)
194 #if (configSUPPORT_STATIC_ALLOCATION == 1)
196 event->handle = xSemaphoreCreateBinaryStatic(&event->
buffer);
199 event->handle = xSemaphoreCreateBinary();
225 vSemaphoreDelete(event->
handle);
238 xSemaphoreGive(event->
handle);
250 xSemaphoreTake(event->
handle, 0);
271 ret = xSemaphoreTake(event->
handle, portMAX_DELAY);
293 portBASE_TYPE flag =
FALSE;
296 xSemaphoreGiveFromISR(event->
handle, &flag);
314 #if (configSUPPORT_STATIC_ALLOCATION == 1)
316 semaphore->
handle = xSemaphoreCreateCountingStatic(count, count,
320 semaphore->
handle = xSemaphoreCreateCounting(count, count);
324 if(semaphore->
handle != NULL)
343 if(semaphore->
handle != NULL)
346 vSemaphoreDelete(semaphore->
handle);
367 ret = xSemaphoreTake(semaphore->
handle, portMAX_DELAY);
388 xSemaphoreGive(semaphore->
handle);
401 #if (configSUPPORT_STATIC_ALLOCATION == 1)
403 mutex->
handle = xSemaphoreCreateMutexStatic(&mutex->
buffer);
406 mutex->
handle = xSemaphoreCreateMutex();
432 vSemaphoreDelete(mutex->
handle);
445 xSemaphoreTake(mutex->
handle, portMAX_DELAY);
457 xSemaphoreGive(mutex->
handle);
471 time = xTaskGetTickCount();
490 p = pvPortMalloc(size);
494 size, (uintptr_t)
p);
512 TRACE_DEBUG(
"Freeing memory at 0x%08" PRIXPTR
"\r\n", (uintptr_t)
p);
520 #if (configSUPPORT_STATIC_ALLOCATION == 1 && !defined(IDF_VER))
526 void vApplicationGetIdleTaskMemory(StaticTask_t **ppxIdleTaskTCBBuffer,
527 StackType_t **ppxIdleTaskStackBuffer, uint32_t *pulIdleTaskStackSize)
529 static StaticTask_t xIdleTaskTCB;
530 static StackType_t uxIdleTaskStack[configMINIMAL_STACK_SIZE];
532 *ppxIdleTaskTCBBuffer = &xIdleTaskTCB;
533 *ppxIdleTaskStackBuffer = uxIdleTaskStack;
534 *pulIdleTaskStackSize = configMINIMAL_STACK_SIZE;
546 void vApplicationStackOverflowHook(TaskHandle_t pxTask,
char *pcTaskName)
551 taskDISABLE_INTERRUPTS();
563 void vAssertCalled(
const char *pcFile,
unsigned long ulLine)
565 volatile unsigned long ul = 0;
570 taskENTER_CRITICAL();
OsTaskId osCreateTask(const char_t *name, OsTaskCode taskCode, void *arg, const OsTaskParameters *params)
Create a task.
void osResetEvent(OsEvent *event)
Set the specified event object to the nonsignaled state.
void osDeleteEvent(OsEvent *event)
Delete an event object.
void osSuspendAllTasks(void)
Suspend scheduler activity.
#define OS_INVALID_TASK_ID
void osReleaseMutex(OsMutex *mutex)
Release ownership of the specified mutex object.
bool_t osCreateMutex(OsMutex *mutex)
Create a mutex object.
portInt8Type buffer[portQUEUE_OVERHEAD_BYTES *2]
void osAcquireMutex(OsMutex *mutex)
Acquire ownership of the specified mutex object.
systime_t osGetSystemTime(void)
Retrieve system time.
void osSetEvent(OsEvent *event)
Set the specified event object to the signaled state.
portInt8Type buffer[portQUEUE_OVERHEAD_BYTES *2]
bool_t osWaitForEvent(OsEvent *event, systime_t timeout)
Wait until the specified event is in the signaled state.
void osStartKernel(void)
Start kernel.
__weak_func void * osAllocMem(size_t size)
Allocate a memory block.
void(* OsTaskCode)(void *arg)
Task routine.
void osInitKernel(void)
Kernel initialization.
#define OS_SYSTICKS_TO_MS(n)
const OsTaskParameters OS_TASK_DEFAULT_PARAMS
#define OS_MS_TO_SYSTICKS(n)
void osDeleteMutex(OsMutex *mutex)
Delete a mutex object.
portInt8Type buffer[portQUEUE_OVERHEAD_BYTES *2]
RTOS abstraction layer (FreeRTOS)
void osDeleteSemaphore(OsSemaphore *semaphore)
Delete a semaphore object.
void osResumeAllTasks(void)
Resume scheduler activity.
uint32_t systime_t
System time.
bool_t osSetEventFromIsr(OsEvent *event)
Set an event object to the signaled state from an interrupt service routine.
void osDeleteTask(OsTaskId taskId)
Delete a task.
bool_t osCreateEvent(OsEvent *event)
Create an event object.
__weak_func void osFreeMem(void *p)
Release a previously allocated memory block.
void osReleaseSemaphore(OsSemaphore *semaphore)
Release the specified semaphore object.
void osSwitchTask(void)
Yield control to the next task.
thread_t * OsTaskId
Task identifier.
bool_t osWaitForSemaphore(OsSemaphore *semaphore, systime_t timeout)
Wait for the specified semaphore to be available.
void osDelayTask(systime_t delay)
Delay routine.
bool_t osCreateSemaphore(OsSemaphore *semaphore, uint_t count)
Create a semaphore object.