FreeRTOS复习
高薪工作1. FreeRTOS⼀共9K的代码,分成3部分:
a. 50%: task.c
b. 40%: queue.c
儿童歌曲免费下载>大学英语三级c. 6%: hardware-dependent
Par 1:其中最主要的这9⾏代码,其他8900多⾏都是为他服务,保证real time OS始终执⾏当前最⾼优先度的task:
#define taskSELECT_HIGHEST_PRIORITY_TASK()
{
/* Find the highest priority queue that contains ready tasks. */
while( listLIST_IS_EMPTY( &( pxReadyTasksLists[ uxTopReadyPriority ] ) ) )flux
{
same
configASSERT( uxTopReadyPriority );
--uxTopReadyPriority;
}
/* listGET_OWNER_OF_NEXT_ENTRY indexes through the list, so the tasks of
the same priority get an equal share of the processor time. */
island是什么意思listGET_OWNER_OF_NEXT_ENTRY( pxCurrentTCB, &( pxReadyTasksLists[ uxTopReadyPriority ] ) );
} /* taskSELECT_HIGHEST_PRIORITY_TASK */
Part 2: 在FreeRTOS ⾥⾯,⽤TCB来代表每个ur defined task。
/*
保密协议英文* Task control block. A task control block (TCB) is allocated for each task,
* and stores task state information, including a pointer to the task's context
美少女战士 歌词* (the task's run time environment, including register values)violet怎么读
*/
typedef struct tskTaskControlBlock
{
volatile portSTACK_TYPE *pxTopOfStack; /*。。。。。。。。。。*/
} tskTCB;
参考资料:
阴阜
2. Dev Board ARM M3 LPC17xx