FreeRTOS源码解析 -> vTaskStartScheduler()
来源:互联网 发布:ubuntu如何搜索文件 编辑:程序博客网 时间:2024/05/16 07:32
xPortStartScheduler()会在后面介绍port.c的时候详细说明。
void vTaskStartScheduler( void ){ portBASE_TYPE xReturn;/* Add the idle task at the lowest priority. *//*空闲任务的责任是要将分配给已删除任务的内存释放掉。 在vTaskDelete()删除任务后,在prvIdleTask释放内存*/xReturn = xTaskCreate( prvIdleTask, ( signed char * ) "IDLE", tskIDLE_STACK_SIZE, ( void * ) NULL, ( tskIDLE_PRIORITY | portPRIVILEGE_BIT ), ( xTaskHandle * ) NULL );#if ( configUSE_TIMERS == 1 ){if( xReturn == pdPASS ){xReturn = xTimerCreateTimerTask();}}#endif //上面的idle任务创建成功if( xReturn == pdPASS ){/* Interrupts are turned off here, to ensure a tick does not occurbefore or during the call to xPortStartScheduler(). The stacks ofthe created tasks contain a status word with interrupts switched onso interrupts will automatically get re-enabled when the first taskstarts to run.STEPPING THROUGH HERE USING A DEBUGGER CAN CAUSE BIG PROBLEMS IF THEDEBUGGER ALLOWS INTERRUPTS TO BE PROCESSED. */portDISABLE_INTERRUPTS(); //调度器flag,用于判断调度器是否在运行xSchedulerRunning = pdTRUE;//计数器清零xTickCount = ( portTickType ) 0;/* If configGENERATE_RUN_TIME_STATS is defined then the followingmacro must be defined to configure the timer/counter used to generatethe run time counter time base. */portCONFIGURE_TIMER_FOR_RUN_TIME_STATS(); /* Setting up the timer tick is hardware specific and thus in theportable interface. *//*启动任务调度*/if( xPortStartScheduler() ){/* Should not reach here as if the scheduler is running thefunction will not return. */}else{/* Should only reach here if a task calls xTaskEndScheduler(). */}}/* This line will only be reached if the kernel could not be started. */configASSERT( xReturn );}
0 0
- FreeRTOS源码解析 -> vTaskStartScheduler()
- FreeRTOS源码解析 -> xTaskCreate()
- FreeRTOS源码解析 -> vTaskDelete()
- FreeRTOS源码解析 -> vTaskDelayUntil()
- FreeRTOS源码解析 -> vTaskSuspend
- FreeRTOS源码解析 -> vTaskResume()
- FreeRTOS之源码及移植解析
- FreeRTOS的队列发送源码解析
- Tracealyzer for FreeRTOS(FreeRTOS+Trace) 详解(源码解析+移植)
- Tracealyzer for FreeRTOS(FreeRTOS+Trace) 详解(源码解析+移植)
- FreeRTOS 源码分析
- FreeRtos heap1源码分析
- FreeRtos heap2源码分析
- FreeRtos heap3源码分析
- FreeRtos heap4源码分析
- FreeRtos heap5源码分析
- FreeRTOS 源码结构说明
- FreeRTOS源码阅读(一)
- 关于UIImagePickerController读取照片时的卡顿和照片压缩
- 新年快乐!
- Java和C++谁是更纯的面向对象的语言
- Mac下对APK进行反编译
- 不知不觉已经20年了!
- FreeRTOS源码解析 -> vTaskStartScheduler()
- 2015马上就要到了
- 谈谈网站静态化
- 转正后的新开始!For来临的新一年!
- unity之外键
- 零基础学习EasyUI-01
- linux下安装vmwaretools
- 光照阴影2d。。
- hdoj1010