Quality RTOS & Embedded Software

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

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

Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.

Free TCP/IP and file system demos for the RTOS

Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑

FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

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

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

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

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists