首页 > 其他分享 >34. 启动任务调度器

34. 启动任务调度器

时间:2023-08-28 22:23:19浏览次数:30  
标签:启动 void portPRIVILEGE xReturn 34 BIT 任务调度 define

1. 开启任务调度器

vTaskStartScheduler()

void vTaskStartScheduler( void )
    if ( configSUPPORT_STATIC_ALLOCATION == 1 )
    {
            /* The Idle task is being created using dynamically allocated RAM. */
            //创建空闲任务
            xReturn = xTaskCreate( prvIdleTask,
                      configIDLE_TASK_NAME, //"IDLE"
                      configMINIMAL_STACK_SIZE, //128 word
                      ( void * ) NULL,
                        /* In effect ( tskIDLE_PRIORITY | portPRIVILEGE_BIT ), but tskIDLE_PRIORITY is zero. */
                       portPRIVILEGE_BIT, //#define portPRIVILEGE_BIT    ( ( UBaseType_t ) 0x00 )
                       &xIdleTaskHandle ); // static TaskHandle_t xIdleTaskHandle = NULL;
        
            #if ( configUSE_TIMERS == 1 )
            {
                if( xReturn == pdPASS )
                {
                    //创建软件定时器任务
                    xReturn = xTimerCreateTimerTask();
                }
            }
            #endif /* configUSE_TIMERS */
            
             if( xReturn == pdPASS )
            {
                 /* Interrupts are turned off here, to ensure a tick does not occur
                 * before or during the call to xPortStartScheduler().  The stacks of
                 * the created tasks contain a status word with interrupts switched on
                 * so interrupts will automatically get re-enabled when the first task
                 * starts to run. */
                portDISABLE_INTERRUPTS();
                 
                xNextTaskUnblockTime = portMAX_DELAY;// #define portMAX_DELAY   ( TickType_t ) 0xffffffffUL
                xSchedulerRunning = pdTRUE;
                xTickCount = ( TickType_t ) configINITIAL_TICK_COUNT; // #define configINITIAL_TICK_COUNT    0
                 
                if( xPortStartScheduler() != pdFALSE )
                {
                    /* Should not reach here as if the scheduler is running the
                     * function will not return. */
                }
             }
    }
 BaseType_t xTimerCreateTimerTask( void )
{
    BaseType_t xReturn = pdFAIL;
     

 

标签:启动,void,portPRIVILEGE,xReturn,34,BIT,任务调度,define
From: https://www.cnblogs.com/-glb/p/17663523.html

相关文章

  • 2834. 找出美丽数组的最小和-360
    找出美丽数组的最小和给你两个正整数:n和target。如果数组nums满足下述条件,则称其为美丽数组。nums.length==n.nums由两两互不相同的正整数组成。在范围[0,n-1]内,不存在两个不同下标i和j,使得nums[i]+nums[j]==target。返回符合条件的美丽数组所可......
  • 数组二分查找:35. 搜索插入位置、34. 在排序数组中查找元素的第一个和最后一个位置
    35. 搜索插入位置1classSolution:2defsearchInsert(self,nums:List[int],target:int)->int:3left,right=0,len(nums)-145whileleft<=right:#左闭右闭6mid=left+(right-left)//27ifnum......
  • 深入探讨Android启动优化策略
    在当今激烈竞争的移动应用市场,应用的启动速度直接影响着用户的第一印象和满意度。作为主流的移动操作系统之一,Android的启动优化是开发者必须关注的关键领域。本文将详细介绍一些强大有效的Android启动优化策略,帮助你优化应用的启动过程,为用户创造更出色的体验。冷启动与热启动在着......
  • docker为已启动的容器添加端口映射
    针对已运行的容器添加端口映射1、查看容器是否映射端口dockerport[容器id或容器名]1有端口映射:无端口映射:2、查看容器完整Iddockerinspect[容器id]|grepId//得到以下结果//"Id":"fcae55f5180a79487662de426863565c7df05ed9b87854093b62776734928d25"......
  • eclipse运行不自动启动浏览器的方法
    通过服务器启动,将不启动浏览器步骤如下:java文件右击--RunAs-->RunConfigurationsRun后将不启动浏览器......
  • 【1342C】Yet Another Counting Problem(数论)
    题目大意:求有多少\(x(1\lel\lex\ler\le10^{18})\)满足\((x\moda)\modb\neq(x\modb)\moda(1\lea,b\le200)\),有\(q(1\leq\le500)\)次询问。设答案为\(f(l,r)\),考虑前缀和\(f(l,r)=f(1,r)-f(1,l-1)\),现在问题在于计算\(f(1,x)(1\lex\le10^{18})\)。我们可以发现规......
  • 黑魂234 交互作用事件(正面处决)
    在InteractionManager脚本里,修改成这样:添加一个新的列表存放ecastm的物件,需要的留下,不需要的进行移除。private改成public。 ActorManager脚本改成这样: 碰撞触发物体后按下KeyF(C键)会显示绑定EventCasterManager的EventName。在DirectorManager脚本写下这个新的代码:就是把......
  • Idea 启动报错Error: A JNI error has occurred, please check your installation and
    idea运行程序的时候,出现Error:AJNIerrorhasoccurred,pleasecheckyourinstallationandtryagain这个错误的话,抛出异常:java.lang.NoClassDefFoundError:org/springframework/web/socket/server/standard/ServerEndpointExporter atjava.lang.Class.getDeclaredMetho......
  • Day34(2023.08.22)
    行程8:45    到达上海市信息安全测评认证中心(黄浦区陆家浜路1308号)9:00  久事体育软件测试11:30--13:00   吃饭休息13:00  久事体育软件测试17:00      下班......
  • docker 启动redis 启动配置文件可以去网上查找一篇
    dockerrun--privileged=true-d--nameredis-p6379:6379-v/Users/zs/docker/redis/conf/redis.conf:/etc/redis/redis.conf-v/Users/zs/docker/redis/data:/dataredisredis-server/etc/redis/redis.conf   configurl参考如下 https://blog.csdn.net/xuyan......