当前位置: 首页 > news >正文

做盗版电影网站赚钱吗电脑课做网站所需的软件

做盗版电影网站赚钱吗,电脑课做网站所需的软件,店铺网站怎么建,网络服务商主要包括两个Delay函数有两个延时函数vTaskDelay#xff1a;至少等待指定个数的Tick Interrupt才能变为就绪态xTaskDelayUtil#xff1a;等待到指定的绝对时刻#xff0c;才能变为就绪态个人感觉这两个延时函数就是#xff0c;比如一个我等3个小时#xff0c;一个是我等到下午3点的…两个Delay函数有两个延时函数vTaskDelay至少等待指定个数的Tick Interrupt才能变为就绪态xTaskDelayUtil等待到指定的绝对时刻才能变为就绪态个人感觉这两个延时函数就是比如一个我等3个小时一个是我等到下午3点的区别。两个函数的原型如下vTaskDelay:void vTaskDelay( const TickType_t xTicksToDelay ){BaseType_t xAlreadyYielded pdFALSE;/* A delay time of zero just forces a reschedule. */if( xTicksToDelay ( TickType_t ) 0U ){configASSERT( uxSchedulerSuspended 0 );vTaskSuspendAll();{traceTASK_DELAY();/* A task that is removed from the event list while the* scheduler is suspended will not get placed in the ready* list or removed from the blocked list until the scheduler* is resumed.** This task cannot be in an event list as it is the currently* executing task. */prvAddCurrentTaskToDelayedList( xTicksToDelay, pdFALSE );}xAlreadyYielded xTaskResumeAll();}else{mtCOVERAGE_TEST_MARKER();}/* Force a reschedule if xTaskResumeAll has not already done so, we may* have put ourselves to sleep. */if( xAlreadyYielded pdFALSE ){portYIELD_WITHIN_API();}else{mtCOVERAGE_TEST_MARKER();}} xTaskDelayUtil BaseType_t xTaskDelayUntil( TickType_t * const pxPreviousWakeTime,const TickType_t xTimeIncrement ){TickType_t xTimeToWake;BaseType_t xAlreadyYielded, xShouldDelay pdFALSE;configASSERT( pxPreviousWakeTime );configASSERT( ( xTimeIncrement 0U ) );configASSERT( uxSchedulerSuspended 0 );vTaskSuspendAll();{/* Minor optimisation. The tick count cannot change in this* block. */const TickType_t xConstTickCount xTickCount;/* Generate the tick time at which the task wants to wake. */xTimeToWake *pxPreviousWakeTime xTimeIncrement;if( xConstTickCount *pxPreviousWakeTime ){/* The tick count has overflowed since this function was* lasted called. In this case the only time we should ever* actually delay is if the wake time has also overflowed,* and the wake time is greater than the tick time. When this* is the case it is as if neither time had overflowed. */if( ( xTimeToWake *pxPreviousWakeTime ) ( xTimeToWake xConstTickCount ) ){xShouldDelay pdTRUE;}else{mtCOVERAGE_TEST_MARKER();}}else{/* The tick time has not overflowed. In this case we will* delay if either the wake time has overflowed, and/or the* tick time is less than the wake time. */if( ( xTimeToWake *pxPreviousWakeTime ) || ( xTimeToWake xConstTickCount ) ){xShouldDelay pdTRUE;}else{mtCOVERAGE_TEST_MARKER();}}/* Update the wake time ready for the next call. */*pxPreviousWakeTime xTimeToWake;if( xShouldDelay ! pdFALSE ){traceTASK_DELAY_UNTIL( xTimeToWake );/* prvAddCurrentTaskToDelayedList() needs the block time, not* the time to wake, so subtract the current tick count. */prvAddCurrentTaskToDelayedList( xTimeToWake - xConstTickCount, pdFALSE );}else{mtCOVERAGE_TEST_MARKER();}}xAlreadyYielded xTaskResumeAll();/* Force a reschedule if xTaskResumeAll has not already done so, we may* have put ourselves to sleep. */if( xAlreadyYielded pdFALSE ){portYIELD_WITHIN_API();}else{mtCOVERAGE_TEST_MARKER();}return xShouldDelay;} 下面是图示使用vTaskDelay(n)时进入退出vTaskDelay的时间间隔至少是n个Tick中断使用xTaskDelayUtil(Pre,n)时前后两次退出xTaskDelayUntil的时间至少是n个Tick中断退出xTaskDelayUntil时任务就进入就绪态一般都能得到执行机会所以可以使用xTaskDelayUntil来让任务周期性的运行实验证明程序创建2个任务Task1高优先级设置变量flag为1然后调用vTaskDelay(xDelay50ms)或vTaskDelayUntil(xLastWakeTime,xDelay50ms)Task2:低优先级设置变量flag0main函数代码如下int main(void) {prvSetupHardware();/*Task1的优先级更高Task1先执行*/xTaskCreate(vTask1,Task1,1000,NULL,2,NULL);xTaskCreate(vTask2,Task2,1000,NULL,1,NULL);/*启动调度器*/vTaskStartScheduler();/*如果程序运行到这里就表示出错了一般是内存不足*/return 0;}Task1的代码中使用条件开关来选择Delay函数把#if 1 改为 #if 0 就可以使用vTaskDelayUntil代码如下void vTask1(void *pvParameters) {const TickType_t xDelay50ms pdMS_TO_TICKS(50UL);TickType_t xLastWakeTime;int i;/*获得当前的Tick Count*/xLastWakeTime xTaskGetTickCount();for(;;){flag 1;/*故意加入多个循环让程序运行时间长一点*/for(i0;i5;i)printf(Task1 is running\r\n); #if 1vTaskDelay(xDelay50ms); #else vTaskDelayUntil(PreWakeTime,xDelay50ms);} }使用MDK的逻辑分析仪可以观察flag变量的bit波形如下flag为1时表示Task1正在运行flag为0时表示Task2正在运行也就是Task1处于阻塞状态vTaskDelay指定的是阻塞时间vTaskDelayUntil指定的是任务执行的间隔周期
http://www.w-s-a.com/news/522739/

相关文章:

  • 网站开发工程师发展趋势山东省建设工程电子信息网站
  • 适合大学生创业的网站建设类型吉林省舒兰市建设银行网站
  • 呼和浩特网站建设哪家好培训学校加盟费用
  • 网站如何做友情链接有道云笔记WordPress
  • 贵阳企业网站建设制作赤峰浩诚网站建设公司
  • asp官方网站微信模板素材
  • wordpress 留言给站长发邮件做百度推广员赚钱吗
  • 北京建站公司做网站价格专门找人做软件的网站
  • 商务网站的特点ui软件界面设计
  • 广州个性化网站开发网站索引量是什么意思
  • 公司网站制作专业公司python做后台网站的多吗
  • 桂林建站平台哪家好给别人做网站怎么收取费用
  • python做网站显示表格用visual做的网站
  • 彩票网站建设需要什么聊城网站建设首选天成网络
  • 安徽建设工程网站wordpress标签云代码
  • 推荐佛山顺德网站建设手机网站建设域名空间
  • 电子商务网站建设策划书例子企业官网用什么cms系统
  • 网站栏目设计怎么写平面设计接单报价表
  • 做网站美工要学什么网站推广的方法包括
  • 哪个网站可以做笔译兼职wordpress加表单
  • 百度站内搜索 wordpress微餐饮建站费用
  • 用什么做网站的访问量统计制作手工作品
  • 微信公众号搭建网站河南卫生基层系统网站建设
  • steam账号注册网站重庆手机版建站系统哪家好
  • 中新生态城建设局门户网站wordpress云盘视频播放
  • 大型网站开发基本流程wordpress记录用户搜索
  • 云服务器安装win系统做网站wordpress边栏扩大尺寸
  • 网站开发面试自我介绍软件下载网站如何建设
  • 可以做翻译任务的网站陕西省建设厅八大员证
  • 昆明 网站推广重庆网页优化seo公司