prvIdleTask定义在哪
在看FreeRTOS, vTaskStartScheduler源码的时候有个疑问prvIdleTask这个任务定义到底在哪。根据查找就说:portTASK_FUNCTION就是prvIdleTask。。怎么实现的啊,请指教一下
* -----------------------------------------------------------
* The Idle task.
* ----------------------------------------------------------
*
* The portTASK_FUNCTION() macro is used to allow port/compiler specific
* language extensions.The equivalent prototype for this function is:
*
* void prvIdleTask( void *pvParameters );
*
*/
static portTASK_FUNCTION( prvIdleTask, pvParameters )
{
/* Stop warnings. */
( void ) pvParameters;
/** THIS IS THE RTOS IDLE TASK - WHICH IS CREATED AUTOMATICALLY WHEN THE
SCHEDULER IS STARTED. **/
/* In case a task that has a secure context deletes itself, in which case
the idle task is responsible for deleting the task's secure context, if
any. */
portTASK_CALLS_SECURE_FUNCTIONS();
for( ;; )
{
/* See if any tasks have deleted themselves - if so then the idle task
is responsible for freeing the deleted task's TCB and stack. */
prvCheckTasksWaitingTermination();
#if ( configUSE_PREEMPTION == 0 )
顶一下,怎么没人来看看呢 本帖最后由 byccc 于 2018-12-15 14:49 编辑
/* Task function macros as described on the FreeRTOS.org WEB site.These are
not necessary for to use this port.They are defined so the common demo files
(which build with all the ports) will build. */
#define portTASK_FUNCTION_PROTO( vFunction, pvParameters ) void vFunction( void *pvParameters )
#define portTASK_FUNCTION( vFunction, pvParameters ) void vFunction( void *pvParameters )
还是没看出来怎么联系起来 的 bian 发表于 2018-12-15 15:03
还是没看出来怎么联系起来 的
你太菜了,这就是个简单的宏定义呀 :L
portTASK_FUNCTION 和prvIdleTask 的联系啊 宏定义:#define portTASK_FUNCTION( vFunction, pvParameters ) void vFunction( void *pvParameters )
static portTASK_FUNCTION( prvIdleTask, pvParameters )
{...
}
宏定义应该会替换成:
staticvoid prvIdleTask( void *pvParameters )
{...
}
页:
[1]