初级会员
- 积分
- 148
- 金钱
- 148
- 注册时间
- 2019-5-4
- 在线时间
- 54 小时
|
10金钱
for( ;; )
{
//获取当前定时器列表 最近一次过期时间点 如果定时器列表为空 xNextExpireTime == 0
xNextExpireTime = prvGetNextExpireTime( &xListWasEmpty );
prvProcessTimerOrBlockTask( xNextExpireTime, xListWasEmpty );
prvProcessReceivedCommands();
}
static void prvProcessTimerOrBlockTask( const TickType_t xNextExpireTime, BaseType_t xListWasEmpty )
{
TickType_t xTimeNow;
BaseType_t xTimerListsWereSwitched;
vTaskSuspendAll();
{
xTimeNow = prvSampleTimeNow( &xTimerListsWereSwitched );
if( xTimerListsWereSwitched == pdFALSE )
{
/* The tick count has not overflowed, has the timer expired? */
if( ( xListWasEmpty == pdFALSE ) && ( xNextExpireTime <= xTimeNow ) )
{
( void ) xTaskResumeAll();
prvProcessExpiredTimer( xNextExpireTime, xTimeNow );
}
else
{
if( xListWasEmpty != pdFALSE )
{
/* The current timer list is empty - is the overflow list
also empty? */
xListWasEmpty = listLIST_IS_EMPTY( pxOverflowTimerList );
}
1、假设 现在滴答定时器没有溢出 , 当前定时器列表为空 , 溢出定时器列表不为空 ,xListWasEmpty = pdFALSE , xNextExpireTime = 0
xNextExpireTime - xTimeNow 不该等于复数吗 ?该怎么阻塞 ?
2、如果阻塞了,滴答定时器溢出了 ,该怎么交换两个定时器列表 ?
vQueueWaitForMessageRestricted( xTimerQueue, ( xNextExpireTime - xTimeNow ), xListWasEmpty );
if( xTaskResumeAll() == pdFALSE )
{
portYIELD_WITHIN_API();
}
else
{
mtCOVERAGE_TEST_MARKER();
}
}
}
else
{
( void ) xTaskResumeAll();
}
}
}
1、假设 现在滴答定时器没有溢出 , 当前定时器列表为空 , 溢出定时器列表不为空 ,xListWasEmpty = pdFALSE , xNextExpireTime = 0
xNextExpireTime - xTimeNow 不该等于复数吗 ?该怎么阻塞 ?
2、如果阻塞了,滴答定时器溢出了 ,该怎么交换两个定时器列表 ?
|
|