osal_start_system运行操作系统函数
来源:互联网 发布:进入数据库命令 编辑:程序博客网 时间:2024/06/05 18:09
/*********************************************************************
* @fn osal_start_system
*
* @brief
*
* This function is the main loop function of the task system. It
* will look through all task events and call the task_event_processor()
* function for the task with the event. If there are no events (for
* all tasks), this function puts the processor into Sleep.
* This Function doesn't return.
*
* @param void
*
* @return none
* @fn osal_start_system
*
* @brief
*
* This function is the main loop function of the task system. It
* will look through all task events and call the task_event_processor()
* function for the task with the event. If there are no events (for
* all tasks), this function puts the processor into Sleep.
* This Function doesn't return.
*
* @param void
*
* @return none
*/
注解:这个是任务系统轮询的主要函数。他会查找发生的事件然后调用相应的事件执行函数。如果没有事件登记要发生,那么就进入睡眠模式。这个函数是永远不会返回的。
void osal_start_system( void ){#if !defined ( ZBIT ) && !defined ( UBIT ) for(;;) // Forever Loop#endif { uint8 idx = 0; osalTimeUpdate(); //扫描哪个事件被触发了,然后置相应的标志位 Hal_ProcessPoll(); // This replaces MT_SerialPoll() and osal_check_timer(). do { if (tasksEvents[idx]) // Task is highest priority that is ready. { break; //得到待处理的最高优先级任务索引号 idx } } while (++idx < tasksCnt); if (idx < tasksCnt) { uint16 events; halIntState_t intState; HAL_ENTER_CRITICAL_SECTION(intState); //进入临界区,保护 events = tasksEvents[idx]; //提取需要处理的任务中的事件 tasksEvents[idx] = 0; // Clear the Events for this task.清除本次任务的事件 HAL_EXIT_CRITICAL_SECTION(intState); //退出临界区 events = (tasksArr[idx])( idx, events ); ///通过指针调用任务处理函数,关键 HAL_ENTER_CRITICAL_SECTION(intState); ///进入临界区 tasksEvents[idx] |= events; // Add back unprocessed events to the current task.保存未处理的事件 HAL_EXIT_CRITICAL_SECTION(intState); //退出临界区 }#if defined( POWER_SAVING ) else // Complete pass through all task events with no activity? { osal_pwrmgr_powerconserve(); // Put the processor/system into sleep }#endif }}
- osal_start_system运行操作系统函数
- osal_start_system运行操作系统函数
- ZigBee--osal_start_system函数
- 操作系统的运行环境
- Linux操作系统运行级别
- Skyeye中运行操作系统
- 操作系统的运行环境
- Win7 64位操作系统下CreateProcess函数运行System32文件夹下批处理文件出错的原因
- Win7 64位操作系统下CreateProcess函数运行System32文件夹下批处理文件出错的原因
- 操作系统原理第二周:操作系统运行环境
- 操作系统--操作系统运行环境与运行机制
- 操作系统复习-1.3操作系统的运行环境
- 在Oracle运行操作系统命令
- 在Oracle运行操作系统命令
- 在Oracle运行操作系统命令
- 在Oracle运行操作系统命令
- 操作系统不能运行EXE程序
- 运行自己开发的操作系统
- Apache Math研读
- IOS开发之协议和代理
- 初学者学Java(十四)
- 自定义TableViewCell
- JavaScript 操作 Cookie
- osal_start_system运行操作系统函数
- 9/29-10/6待字闺中面试题练习
- HDU 4768 Flyer(13年长春网络赛-J题-二分)
- 经验总结
- url、httprequest、request使用详解
- Linux内核系统定时器TIMER实现过程分析
- eclips 隐藏QuickAccess
- 遍历Map集合方式
- javascript 怎么获取文件上传对话框中的全路径名