mirror of
				https://github.com/FreeRTOS/FreeRTOS-Kernel.git
				synced 2025-11-04 11:09:01 +01:00 
			
		
		
		
	If tickless idle mode is in use then ensure prvResetNextTaskUnblockTime() is called after a task is unblocked due to a bit being set in an event group. This allows the MCU to re-enter sleep mode at the earliest possible time (rather than waiting until the timeout that would occur had the task not being unblocked be the event group) and matches a similar change made for queues and derivative objects (semaphores, etc.) some time ago.
This commit is contained in:
		
							parent
							
								
									853856e8cc
								
							
						
					
					
						commit
						881958514b
					
				@ -3317,6 +3317,20 @@ TCB_t *pxUnblockedTCB;
 | 
			
		||||
	configASSERT( pxUnblockedTCB );
 | 
			
		||||
	( void ) uxListRemove( pxEventListItem );
 | 
			
		||||
 | 
			
		||||
	#if( configUSE_TICKLESS_IDLE != 0 )
 | 
			
		||||
	{
 | 
			
		||||
		/* If a task is blocked on a kernel object then xNextTaskUnblockTime
 | 
			
		||||
		might be set to the blocked task's time out time.  If the task is
 | 
			
		||||
		unblocked for a reason other than a timeout xNextTaskUnblockTime is
 | 
			
		||||
		normally left unchanged, because it is automatically reset to a new
 | 
			
		||||
		value when the tick count equals xNextTaskUnblockTime.  However if
 | 
			
		||||
		tickless idling is used it might be more important to enter sleep mode
 | 
			
		||||
		at the earliest possible time - so reset xNextTaskUnblockTime here to
 | 
			
		||||
		ensure it is updated at the earliest possible time. */
 | 
			
		||||
		prvResetNextTaskUnblockTime();
 | 
			
		||||
	}
 | 
			
		||||
	#endif
 | 
			
		||||
 | 
			
		||||
	/* Remove the task from the delayed list and add it to the ready list.  The
 | 
			
		||||
	scheduler is suspended so interrupts will not be accessing the ready
 | 
			
		||||
	lists. */
 | 
			
		||||
@ -3597,6 +3611,8 @@ static portTASK_FUNCTION( prvIdleTask, pvParameters )
 | 
			
		||||
	const UBaseType_t uxNonApplicationTasks = 1;
 | 
			
		||||
	eSleepModeStatus eReturn = eStandardSleep;
 | 
			
		||||
 | 
			
		||||
		/* This function must be called from a critical section. */
 | 
			
		||||
 | 
			
		||||
		if( listCURRENT_LIST_LENGTH( &xPendingReadyList ) != 0 )
 | 
			
		||||
		{
 | 
			
		||||
			/* A task was made ready while the scheduler was suspended. */
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user