硬汉嵌入式论坛

 找回密码
 立即注册
查看: 3750|回复: 6
收起左侧

[FreeRTOS] prvIdleTask定义在哪

[复制链接]

3

主题

12

回帖

21

积分

新手上路

积分
21
发表于 2018-12-15 13:59:30 | 显示全部楼层 |阅读模式
在看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 )





vTaskStartScheduler

vTaskStartScheduler
回复

使用道具 举报

3

主题

12

回帖

21

积分

新手上路

积分
21
 楼主| 发表于 2018-12-15 14:35:46 | 显示全部楼层
顶一下,怎么没人来看看呢
回复

使用道具 举报

36

主题

2039

回帖

2147

积分

至尊会员

积分
2147
发表于 2018-12-15 14:48:28 | 显示全部楼层
本帖最后由 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 )
Ever tried. Ever failed. No matter. Try Again. Fail again. Fail better.
回复

使用道具 举报

3

主题

12

回帖

21

积分

新手上路

积分
21
 楼主| 发表于 2018-12-15 15:03:27 | 显示全部楼层
还是没看出来怎么联系起来 的
回复

使用道具 举报

36

主题

2039

回帖

2147

积分

至尊会员

积分
2147
发表于 2018-12-15 15:12:31 | 显示全部楼层
bian 发表于 2018-12-15 15:03
还是没看出来怎么联系起来 的

你太菜了,这就是个简单的宏定义呀
Ever tried. Ever failed. No matter. Try Again. Fail again. Fail better.
回复

使用道具 举报

3

主题

12

回帖

21

积分

新手上路

积分
21
 楼主| 发表于 2018-12-15 16:29:26 | 显示全部楼层
   
portTASK_FUNCTION   和  prvIdleTask 的联系啊
回复

使用道具 举报

0

主题

1

回帖

1

积分

新手上路

积分
1
发表于 2022-8-23 11:21:47 | 显示全部楼层
宏定义:#define portTASK_FUNCTION( vFunction, pvParameters ) void vFunction( void *pvParameters )


static portTASK_FUNCTION( prvIdleTask, pvParameters )
{...
}
宏定义应该会替换成:
static  void prvIdleTask( void *pvParameters )
{...
}
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|小黑屋|Archiver|手机版|硬汉嵌入式论坛

GMT+8, 2024-5-4 00:47 , Processed in 0.198978 second(s), 27 queries .

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表