Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT Training




eTaskConfirmSleepModeStatus
[RTOS Kernel Control]

task.h
 eSleepModeStatus eTaskConfirmSleepModeStatus( void );

Tick-less idle mode specific function.

Provided for use within portSUPPRESS_TICKS_AND_SLEEP() to allow the port specific sleep function to determine if it may proceed with the sleep, and if the sleep can be indefinite.

This function is necessary because portSUPPRESS_TICKS_AND_SLEEP() is only called with the scheduler suspended, not from within a critical section. It is therefore possible for an interrupt to request a context switch between portSUPPRESS_TICKS_AND_SLEEP() being called and the low power mode actually being entered. eTaskConfirmSleepModeStatus() should be called from a short critical section between the timer being stopped and the sleep mode being entered.

The configUSE_TICKLESS_IDLE configuration constant must be set to 1 for eTaskConfirmSleepModeStatus() to be available.

Parameters:
None.
Returns:
If a task has been transitioned out of the Blocked state since portSUPPRESS_TICKS_AND_SLEEP() was called, or a context switch is being held pending (because the scheduler is suspended), then eTaskConfirmSleepModeStatus() will return eAbortSleep and sleep mode must not be entered.

If software timers are not being used, and all the application tasks are either Blocked with an indefinite timeout or Suspended, then eTaskConfirmSleepModeStatus() will return eNoTasksWaitingTimeout and portSUPPRESS_TICKS_AND_SLEEP() can enter a deep sleep state without first having to configure a timer to bring the microcontroller out of its sleep state at a pre-determined time in the future.

In all other cases eTaskConfirmSleepModeStatus() will return eStandardSleep.

Example usage:

eTaskConfirmSleepModeStatus() is used in the example implementation of portSUPPRESS_TICKS_AND_SLEEP().





[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]




Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

FreeRTOS kernel V10 is available for immediate download. Now MIT licensed.


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS