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().




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

Latest News

FreeRTOS v10.2.1 is available for immediate download. MIT licensed, includes 64-bit RISC-V, NXP Cortex-M33 demo & Nuvoton Cortex-M23 demo & STM32H745 dual core (AMP) demo.

New MIT licensed IoT MQTT and IoT Task Pool libraries now available. Includes demo projects.

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

Careers

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
Renesas
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