function |
|
uint32_t | osRtxErrorNotify (uint32_t code, void *object_id) |
OS error callback function. More... |
|
void | osRtxIdleThread (void *argument) |
OS idle thread. More... |
|
describe
function documentation
uint32_t osRtxErrorNotify | ( | uint32_t | code, |
void * | object_id | ||
) |
Some system error conditions can be detected at runtime. If the RTX kernel detects a runtime error, it calls the runtime error function osRtxErrorNotify for the object specified by the parameter object_id.
The parameter code passes the actual error code to this function:
error code | describe |
---|---|
osRtxErrorStackUnderflow | Thread stack overflow detected (thread_id = object_id) |
osRtxErrorISRQueueOverflow | ISR queue overflow detected when inserting object (object_id) |
osRtxErrorTimerQueueOverflow | User timer callback timer detected queue overflow (timer_id = object_id) |
osRtxErrorClibSpace | Standard C/C++ library libspace not available: increase OS_THREAD_LIBSPACE_NUM
|
osRtxErrorClibMutex | Standard C/C++ library mutex initialization failed |
The function osRtxErrorNotify must contain an infinite loop to prevent further program execution. You can use the simulator to step through infinite loops and trace code that introduces runtime errors. For overflow errors, this means you need to increase the size of the object that caused the overflow.
- Notice
- Cannot be called from an interrupt service routine.
code example
osRtxErrorClibMutexvoid osRtxIdleThread | ( | void * | argument | ) |
当没有其他线程准备运行时,函数 osRtxIdleThread 由 RTX 内核执行。默认情况下,该线程是一个空白的无终止循环,它什么都不做。它只是等待另一个任务准备运行。您可以更改 osRtxIdleThread 函数的代码,使 CPU 进入省电模式或空闲模式,请参阅无节拍低功耗操作。
该线程的默认堆栈大小在文件 RTX_Config.h 中定义。请参阅线程配置。
- 注意
- 不能从中断服务程序调用。
代码示例