Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem

[RTOS Kernel Control]

 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.

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 ]    [ Privacy ]    [ Sitemap ]    [ ]

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

Latest News

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

Meet Richard Barry and learn about running FreeRTOS on RISC-V at FOSDEM 2019

Version 10.1.1 of the FreeRTOS kernel is available for immediate download. MIT licensed.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


FreeRTOS and other embedded software careers at AWS.

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

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

Xilinx Microblaze and Zynq partner