Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
FreeRTOS tickless

The tickless feature of FreeRTOS allows the device to sleep for peroids longer than the predefined OS tick rate.

This is useful when no tasks are ready to execute for more than one OS tick. The benefit of this is lower power consumption.

The tickless feature is implemented using a timer, configured with the desired timeout value, to wake the device. The same timer is also used to generate the system tick, so that time is kept in the optimal way, eliminating drift in most cases. If some other source wakes the device before the sleep period is complete, but after more than one OS tick, there will be a slight drift, as the timers count value must be corrected.

Functions

void vPortSuppressTicksAndSleep (TickType_t xExpectedIdleTime)
 

Timer Constants

#define TIMER_HZ   ( configCPU_CLOCK_HZ )
 Frequency of timer. More...
 
#define TIMER_RELOAD_VALUE_ONE_TICK   ( TIMER_HZ / configTICK_RATE_HZ )
 Value per os tick of timer. More...
 
#define TIMER_MAX_COUNT   ( 0xffffffff )
 Maximum value of timer. More...
 
#define TIMER_MAX_POSSIBLE_SUPPRESSED_TICKS   ( TIMER_MAX_COUNT / TIMER_RELOAD_VALUE_ONE_TICK )
 Maximum possible suppressed ticks with timer. More...
 

Global instance and prototypes

static struct tc_module tc
 Timer instance. More...
 
bool volatile tickless_enable = false
 Global variable to control tickless operation. More...
 
bool volatile tickless_mode = false
 
void xPortSysTickHandler (void)
 External declaration of freeRTOS SysTick handler. More...
 
void vPortSetupTimerInterrupt (void)
 Function for setting up timer. More...
 
static void empty_callback (struct tc_module *const module_inst)
 Prototype for empty_callback for sleep timer. More...
 

#define TIMER_HZ   ( configCPU_CLOCK_HZ )

Frequency of timer.

#define TIMER_MAX_COUNT   ( 0xffffffff )

Maximum value of timer.

#define TIMER_MAX_POSSIBLE_SUPPRESSED_TICKS   ( TIMER_MAX_COUNT / TIMER_RELOAD_VALUE_ONE_TICK )

Maximum possible suppressed ticks with timer.

Referenced by vPortSuppressTicksAndSleep().

#define TIMER_RELOAD_VALUE_ONE_TICK   ( TIMER_HZ / configTICK_RATE_HZ )

Value per os tick of timer.

Referenced by vPortSetupTimerInterrupt(), and vPortSuppressTicksAndSleep().

static void empty_callback ( struct tc_module *const  module_inst)
static

Prototype for empty_callback for sleep timer.

Referenced by vPortSuppressTicksAndSleep().

void xPortSysTickHandler ( void  )

External declaration of freeRTOS SysTick handler.

Referenced by vPortSetupTimerInterrupt(), and vPortSuppressTicksAndSleep().

struct tc_module tc
static
bool volatile tickless_enable = false

Global variable to control tickless operation.

Referenced by about_task(), and vPortSuppressTicksAndSleep().

bool volatile tickless_mode = false