#endif\r
\r
#ifndef configPRE_SLEEP_PROCESSING\r
- #define configPRE_SLEEP_PROCESSING()\r
+ #define configPRE_SLEEP_PROCESSING( x )\r
#endif\r
\r
#ifndef configPOST_SLEEP_PROCESSING\r
- #define configPOST_SLEEP_PROCESSING()\r
+ #define configPOST_SLEEP_PROCESSING( x )\r
#endif\r
\r
#endif /* INC_FREERTOS_H */\r
\r
#ifndef configSYSTICK_CLOCK_HZ\r
#define configSYSTICK_CLOCK_HZ configCPU_CLOCK_HZ\r
- #if configUSE_TICKLESS_IDLE == 1\r
- static const unsigned long ulStoppedTimerCompensation = 45UL;\r
- #endif\r
-#else /* configSYSTICK_CLOCK_HZ */\r
- #if configUSE_TICKLESS_IDLE == 1\r
- /* Assumes the SysTick clock is slower than the CPU clock. */\r
- static const unsigned long ulStoppedTimerCompensation = 45UL / ( configCPU_CLOCK_HZ / configSYSTICK_CLOCK_HZ );\r
- #endif\r
-#endif /* configSYSTICK_CLOCK_HZ */\r
+#endif\r
\r
/* Constants required to manipulate the core. Registers first... */\r
#define portNVIC_SYSTICK_CTRL_REG ( * ( ( volatile unsigned long * ) 0xe000e010 ) )\r
static unsigned portBASE_TYPE uxCriticalNesting = 0xaaaaaaaa;\r
\r
/*\r
- * Setup the timer to generate the tick interrupts.\r
+ * Setup the timer to generate the tick interrupts. The implementation in this\r
+ * file is weak to allow application writers to change the timer used to \r
+ * generate the tick interrupt.\r
*/\r
-static void prvSetupTimerInterrupt( void );\r
+void vPortSetupTimerInterrupt( void );\r
\r
/*\r
* Exception handlers.\r
/*\r
* The number of SysTick increments that make up one tick period.\r
*/\r
-static unsigned long ulTimerReloadValueForOneTick = 0;\r
+#if configUSE_TICKLESS_IDLE == 1\r
+ static unsigned long ulTimerReloadValueForOneTick = 0;\r
+#endif\r
\r
/*\r
* The maximum number of tick periods that can be suppressed is limited by the\r
static unsigned long xMaximumPossibleSuppressedTicks = 0;\r
#endif /* configUSE_TICKLESS_IDLE */\r
\r
+/*\r
+ * Compensate for the CPU cycles that pass while the SysTick is stopped (low\r
+ * power functionality only.\r
+ */\r
+#if configUSE_TICKLESS_IDLE == 1\r
+ static unsigned long ulStoppedTimerCompensation = 0;\r
+#endif /* configUSE_TICKLESS_IDLE */\r
\r
/*-----------------------------------------------------------*/\r
\r
\r
/* Start the timer that generates the tick ISR. Interrupts are disabled\r
here already. */\r
- prvSetupTimerInterrupt();\r
+ vPortSetupTimerInterrupt();\r
\r
/* Initialise the critical nesting count ready for the first task. */\r
uxCriticalNesting = 0;\r
" bx lr \n" \\r
:::"r0" \\r
);\r
+ \r
+ /* Just to avoid compiler warnings. */\r
+ ( void ) ulNewMaskValue;\r
}\r
/*-----------------------------------------------------------*/\r
\r
portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT;\r
#endif\r
\r
+ /* Only reset the systick load register if configUSE_TICKLESS_IDLE is set to\r
+ 1. If it is set to 0 tickless idle is not being used. If it is set to a \r
+ value other than 0 or 1 then a timer other than the SysTick is being used\r
+ to generate the tick interrupt. */\r
#if configUSE_TICKLESS_IDLE == 1\r
portNVIC_SYSTICK_LOAD_REG = ulTimerReloadValueForOneTick;\r
#endif\r
portNVIC_SYSTICK_CTRL_REG = portNVIC_SYSTICK_CLK_BIT | portNVIC_SYSTICK_INT_BIT | portNVIC_SYSTICK_ENABLE_BIT;\r
\r
/* Sleep until something happens. */\r
- configPRE_SLEEP_PROCESSING();\r
- __asm volatile( "wfi" );\r
- configPOST_SLEEP_PROCESSING();\r
+ configPRE_SLEEP_PROCESSING( xExpectedIdleTime );\r
+ if( xExpectedIdleTime > 0 )\r
+ {\r
+ __asm volatile( "wfi" );\r
+ }\r
+ configPOST_SLEEP_PROCESSING( xExpectedIdleTime );\r
\r
/* Stop SysTick. Again, the time the SysTick is stopped for is\r
accounted for as best it can be, but using the tickless mode will\r
* Setup the systick timer to generate the tick interrupts at the required\r
* frequency.\r
*/\r
-void prvSetupTimerInterrupt( void )\r
+__attribute__(( weak )) void vPortSetupTimerInterrupt( void )\r
{\r
- /* Calculate the constants required to configure the tick interrupt. */\r
- ulTimerReloadValueForOneTick = ( configSYSTICK_CLOCK_HZ / configTICK_RATE_HZ ) - 1UL;\r
+ /* Calculate the constants required to configure the tick interrupt. */ \r
#if configUSE_TICKLESS_IDLE == 1\r
+ {\r
+ ulTimerReloadValueForOneTick = ( configSYSTICK_CLOCK_HZ / configTICK_RATE_HZ ) - 1UL;\r
xMaximumPossibleSuppressedTicks = 0xffffffUL / ( ( configSYSTICK_CLOCK_HZ / configTICK_RATE_HZ ) - 1UL );\r
+ ulStoppedTimerCompensation = 45UL / ( configCPU_CLOCK_HZ / configSYSTICK_CLOCK_HZ );\r
+ }\r
#endif /* configUSE_TICKLESS_IDLE */\r
\r
/* Configure SysTick to interrupt at the requested rate. */\r
- portNVIC_SYSTICK_LOAD_REG = ulTimerReloadValueForOneTick;\r
+ portNVIC_SYSTICK_LOAD_REG = ( configSYSTICK_CLOCK_HZ / configTICK_RATE_HZ ) - 1UL;;\r
portNVIC_SYSTICK_CTRL_REG = portNVIC_SYSTICK_CLK_BIT | portNVIC_SYSTICK_INT_BIT | portNVIC_SYSTICK_ENABLE_BIT;\r
}\r
/*-----------------------------------------------------------*/\r
\r
#ifndef configSYSTICK_CLOCK_HZ\r
#define configSYSTICK_CLOCK_HZ configCPU_CLOCK_HZ\r
- #if configUSE_TICKLESS_IDLE == 1\r
- static const unsigned long ulStoppedTimerCompensation = 45UL;\r
- #endif\r
-#else /* configSYSTICK_CLOCK_HZ */\r
- #if configUSE_TICKLESS_IDLE == 1\r
- /* Assumes the SysTick clock is slower than the CPU clock. */\r
- static const unsigned long ulStoppedTimerCompensation = 45UL / ( configCPU_CLOCK_HZ / configSYSTICK_CLOCK_HZ );\r
- #endif\r
-#endif /* configSYSTICK_CLOCK_HZ */\r
+#endif\r
\r
/* Constants required to manipulate the core. Registers first... */\r
#define portNVIC_SYSTICK_CTRL_REG ( * ( ( volatile unsigned long * ) 0xe000e010 ) )\r
static unsigned portBASE_TYPE uxCriticalNesting = 0xaaaaaaaa;\r
\r
/*\r
- * Setup the timer to generate the tick interrupts.\r
+ * Setup the timer to generate the tick interrupts. The implementation in this\r
+ * file is weak to allow application writers to change the timer used to \r
+ * generate the tick interrupt.\r
*/\r
-static void prvSetupTimerInterrupt( void );\r
+void vPortSetupTimerInterrupt( void );\r
\r
/*\r
* Exception handlers.\r
/*\r
* The number of SysTick increments that make up one tick period.\r
*/\r
-static unsigned long ulTimerReloadValueForOneTick = 0;\r
+#if configUSE_TICKLESS_IDLE == 1\r
+ static unsigned long ulTimerReloadValueForOneTick = 0;\r
+#endif\r
\r
/*\r
* The maximum number of tick periods that can be suppressed is limited by the\r
static unsigned long xMaximumPossibleSuppressedTicks = 0;\r
#endif /* configUSE_TICKLESS_IDLE */\r
\r
+/*\r
+ * Compensate for the CPU cycles that pass while the SysTick is stopped (low\r
+ * power functionality only.\r
+ */\r
+#if configUSE_TICKLESS_IDLE == 1\r
+ static unsigned long ulStoppedTimerCompensation = 0;\r
+#endif /* configUSE_TICKLESS_IDLE */\r
\r
/*-----------------------------------------------------------*/\r
\r
\r
/* Start the timer that generates the tick ISR. Interrupts are disabled\r
here already. */\r
- prvSetupTimerInterrupt();\r
+ vPortSetupTimerInterrupt();\r
\r
/* Initialise the critical nesting count ready for the first task. */\r
uxCriticalNesting = 0;\r
portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT;\r
#endif\r
\r
+ /* Only reset the systick load register if configUSE_TICKLESS_IDLE is set to\r
+ 1. If it is set to 0 tickless idle is not being used. If it is set to a \r
+ value other than 0 or 1 then a timer other than the SysTick is being used\r
+ to generate the tick interrupt. */\r
#if configUSE_TICKLESS_IDLE == 1\r
portNVIC_SYSTICK_LOAD_REG = ulTimerReloadValueForOneTick;\r
#endif\r
portNVIC_SYSTICK_CTRL_REG = portNVIC_SYSTICK_CLK_BIT | portNVIC_SYSTICK_INT_BIT | portNVIC_SYSTICK_ENABLE_BIT;\r
\r
/* Sleep until something happens. */\r
- configPRE_SLEEP_PROCESSING();\r
- __asm volatile( "wfi" );\r
- configPOST_SLEEP_PROCESSING();\r
+ configPRE_SLEEP_PROCESSING( xExpectedIdleTime );\r
+ if( xExpectedIdleTime > 0 )\r
+ {\r
+ __asm volatile( "wfi" );\r
+ }\r
+ configPOST_SLEEP_PROCESSING( xExpectedIdleTime );\r
\r
/* Stop SysTick. Again, the time the SysTick is stopped for is\r
accounted for as best it can be, but using the tickless mode will\r
* Setup the systick timer to generate the tick interrupts at the required\r
* frequency.\r
*/\r
-void prvSetupTimerInterrupt( void )\r
+__attribute__(( weak )) void vPortSetupTimerInterrupt( void )\r
{\r
- /* Calculate the constants required to configure the tick interrupt. */\r
- ulTimerReloadValueForOneTick = ( configSYSTICK_CLOCK_HZ / configTICK_RATE_HZ ) - 1UL;\r
+ /* Calculate the constants required to configure the tick interrupt. */ \r
#if configUSE_TICKLESS_IDLE == 1\r
+ {\r
+ ulTimerReloadValueForOneTick = ( configSYSTICK_CLOCK_HZ / configTICK_RATE_HZ ) - 1UL;\r
xMaximumPossibleSuppressedTicks = 0xffffffUL / ( ( configSYSTICK_CLOCK_HZ / configTICK_RATE_HZ ) - 1UL );\r
+ ulStoppedTimerCompensation = 45UL / ( configCPU_CLOCK_HZ / configSYSTICK_CLOCK_HZ );\r
+ }\r
#endif /* configUSE_TICKLESS_IDLE */\r
\r
-\r
/* Configure SysTick to interrupt at the requested rate. */\r
- portNVIC_SYSTICK_LOAD_REG = ulTimerReloadValueForOneTick;\r
+ portNVIC_SYSTICK_LOAD_REG = ( configSYSTICK_CLOCK_HZ / configTICK_RATE_HZ ) - 1UL;;\r
portNVIC_SYSTICK_CTRL_REG = portNVIC_SYSTICK_CLK_BIT | portNVIC_SYSTICK_INT_BIT | portNVIC_SYSTICK_ENABLE_BIT;\r
}\r
/*-----------------------------------------------------------*/\r
\r
/* Scheduler utilities. */\r
extern void vPortYieldFromISR( void );\r
-\r
#define portYIELD() vPortYieldFromISR()\r
-\r
#define portEND_SWITCHING_ISR( xSwitchRequired ) if( xSwitchRequired ) vPortYieldFromISR()\r
/*-----------------------------------------------------------*/\r
\r
/*\r
FreeRTOS V7.3.0 - Copyright (C) 2012 Real Time Engineers Ltd.\r
\r
- FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME. PLEASE VISIT \r
+ FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME. PLEASE VISIT\r
http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
\r
***************************************************************************\r
FreeRTOS WEB site.\r
\r
1 tab == 4 spaces!\r
- \r
+\r
***************************************************************************\r
* *\r
* Having a problem? Start by reading the FAQ "My application does *\r
* *\r
***************************************************************************\r
\r
- \r
- http://www.FreeRTOS.org - Documentation, training, latest versions, license \r
- and contact details. \r
- \r
+\r
+ http://www.FreeRTOS.org - Documentation, training, latest versions, license\r
+ and contact details.\r
+\r
http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
including FreeRTOS+Trace - an indispensable productivity tool.\r
\r
- Real Time Engineers ltd license FreeRTOS to High Integrity Systems, who sell \r
- the code with commercial support, indemnification, and middleware, under \r
+ Real Time Engineers ltd license FreeRTOS to High Integrity Systems, who sell\r
+ the code with commercial support, indemnification, and middleware, under\r
the OpenRTOS brand: http://www.OpenRTOS.com. High Integrity Systems also\r
- provide a safety engineered and independently SIL3 certified version under \r
+ provide a safety engineered and independently SIL3 certified version under\r
the SafeRTOS brand: http://www.SafeRTOS.com.\r
*/\r
\r
* Implementation of functions defined in portable.h for the ARM CM3 port.\r
*----------------------------------------------------------*/\r
\r
+/* IAR includes. */\r
+#include <intrinsics.h>\r
+\r
/* Scheduler includes. */\r
#include "FreeRTOS.h"\r
#include "task.h"\r
\r
#ifndef configSYSTICK_CLOCK_HZ\r
#define configSYSTICK_CLOCK_HZ configCPU_CLOCK_HZ\r
- #if configUSE_TICKLESS_IDLE == 1\r
- static const unsigned long ulStoppedTimerCompensation = 45UL;\r
- #endif\r
-#else /* configSYSTICK_CLOCK_HZ */\r
- #if configUSE_TICKLESS_IDLE == 1\r
- /* Assumes the SysTick clock is slower than the CPU clock. */\r
- static const unsigned long ulStoppedTimerCompensation = 45UL / ( configCPU_CLOCK_HZ / configSYSTICK_CLOCK_HZ );\r
- #endif\r
-#endif /* configSYSTICK_CLOCK_HZ */\r
+#endif\r
\r
/* Constants required to manipulate the core. Registers first... */\r
#define portNVIC_SYSTICK_CTRL_REG ( * ( ( volatile unsigned long * ) 0xe000e010 ) )\r
static unsigned portBASE_TYPE uxCriticalNesting = 0xaaaaaaaa;\r
\r
/*\r
- * Setup the timer to generate the tick interrupts.\r
+ * Setup the timer to generate the tick interrupts. The implementation in this\r
+ * file is weak to allow application writers to change the timer used to\r
+ * generate the tick interrupt.\r
*/\r
-static void prvSetupTimerInterrupt( void );\r
+void vPortSetupTimerInterrupt( void );\r
\r
/*\r
* Exception handlers.\r
/*\r
* The number of SysTick increments that make up one tick period.\r
*/\r
-static unsigned long ulTimerReloadValueForOneTick = 0;\r
+#if configUSE_TICKLESS_IDLE == 1\r
+ static unsigned long ulTimerReloadValueForOneTick = 0;\r
+#endif\r
\r
/*\r
* The maximum number of tick periods that can be suppressed is limited by the\r
static unsigned long xMaximumPossibleSuppressedTicks = 0;\r
#endif /* configUSE_TICKLESS_IDLE */\r
\r
+/*\r
+ * Compensate for the CPU cycles that pass while the SysTick is stopped (low\r
+ * power functionality only.\r
+ */\r
+#if configUSE_TICKLESS_IDLE == 1\r
+ static unsigned long ulStoppedTimerCompensation = 0;\r
+#endif /* configUSE_TICKLESS_IDLE */\r
+\r
/*-----------------------------------------------------------*/\r
\r
/*\r
\r
/* Start the timer that generates the tick ISR. Interrupts are disabled\r
here already. */\r
- prvSetupTimerInterrupt();\r
+ vPortSetupTimerInterrupt();\r
\r
/* Initialise the critical nesting count ready for the first task. */\r
uxCriticalNesting = 0;\r
portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT;\r
#endif\r
\r
+ /* Only reset the systick load register if configUSE_TICKLESS_IDLE is set to\r
+ 1. If it is set to 0 tickless idle is not being used. If it is set to a\r
+ value other than 0 or 1 then a timer other than the SysTick is being used\r
+ to generate the tick interrupt. */\r
#if configUSE_TICKLESS_IDLE == 1\r
portNVIC_SYSTICK_LOAD_REG = ulTimerReloadValueForOneTick;\r
#endif\r
portNVIC_SYSTICK_CTRL_REG = portNVIC_SYSTICK_CLK_BIT | portNVIC_SYSTICK_INT_BIT | portNVIC_SYSTICK_ENABLE_BIT;\r
\r
/* Sleep until something happens. */\r
- configPRE_SLEEP_PROCESSING();\r
- __WFI();\r
- configPOST_SLEEP_PROCESSING();\r
+ configPRE_SLEEP_PROCESSING( xExpectedIdleTime );\r
+ if( xExpectedIdleTime > 0 )\r
+ {\r
+ __WFI();\r
+ }\r
+ configPOST_SLEEP_PROCESSING( xExpectedIdleTime );\r
\r
/* Stop SysTick. Again, the time the SysTick is stopped for is\r
accounted for as best it can be, but using the tickless mode will\r
* Setup the systick timer to generate the tick interrupts at the required\r
* frequency.\r
*/\r
-void prvSetupTimerInterrupt( void )\r
+__weak void vPortSetupTimerInterrupt( void )\r
{\r
- /* Configure the constants required to setup the tick interrupt. */\r
- ulTimerReloadValueForOneTick = ( configSYSTICK_CLOCK_HZ / configTICK_RATE_HZ ) - 1UL;\r
+ /* Calculate the constants required to configure the tick interrupt. */ \r
#if configUSE_TICKLESS_IDLE == 1\r
+ {\r
+ ulTimerReloadValueForOneTick = ( configSYSTICK_CLOCK_HZ / configTICK_RATE_HZ ) - 1UL;\r
xMaximumPossibleSuppressedTicks = 0xffffffUL / ( ( configSYSTICK_CLOCK_HZ / configTICK_RATE_HZ ) - 1UL );\r
+ ulStoppedTimerCompensation = 45UL / ( configCPU_CLOCK_HZ / configSYSTICK_CLOCK_HZ );\r
+ }\r
#endif /* configUSE_TICKLESS_IDLE */\r
\r
/* Configure SysTick to interrupt at the requested rate. */\r
- portNVIC_SYSTICK_LOAD_REG = ulTimerReloadValueForOneTick;\r
+ portNVIC_SYSTICK_LOAD_REG = ( configSYSTICK_CLOCK_HZ / configTICK_RATE_HZ ) - 1UL;;\r
portNVIC_SYSTICK_CTRL_REG = portNVIC_SYSTICK_CLK_BIT | portNVIC_SYSTICK_INT_BIT | portNVIC_SYSTICK_ENABLE_BIT;\r
}\r
/*-----------------------------------------------------------*/\r
/*\r
FreeRTOS V7.3.0 - Copyright (C) 2012 Real Time Engineers Ltd.\r
\r
- FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME. PLEASE VISIT \r
+ FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME. PLEASE VISIT\r
http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
\r
***************************************************************************\r
FreeRTOS WEB site.\r
\r
1 tab == 4 spaces!\r
- \r
+\r
***************************************************************************\r
* *\r
* Having a problem? Start by reading the FAQ "My application does *\r
* *\r
***************************************************************************\r
\r
- \r
- http://www.FreeRTOS.org - Documentation, training, latest versions, license \r
- and contact details. \r
- \r
+\r
+ http://www.FreeRTOS.org - Documentation, training, latest versions, license\r
+ and contact details.\r
+\r
http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
including FreeRTOS+Trace - an indispensable productivity tool.\r
\r
- Real Time Engineers ltd license FreeRTOS to High Integrity Systems, who sell \r
- the code with commercial support, indemnification, and middleware, under \r
+ Real Time Engineers ltd license FreeRTOS to High Integrity Systems, who sell\r
+ the code with commercial support, indemnification, and middleware, under\r
the OpenRTOS brand: http://www.OpenRTOS.com. High Integrity Systems also\r
- provide a safety engineered and independently SIL3 certified version under \r
+ provide a safety engineered and independently SIL3 certified version under\r
the SafeRTOS brand: http://www.SafeRTOS.com.\r
*/\r
\r
* Implementation of functions defined in portable.h for the ARM CM4F port.\r
*----------------------------------------------------------*/\r
\r
+/* Compiler includes. */\r
+#include <intrinsics.h>\r
+\r
/* Scheduler includes. */\r
#include "FreeRTOS.h"\r
#include "task.h"\r
\r
#ifndef configSYSTICK_CLOCK_HZ\r
#define configSYSTICK_CLOCK_HZ configCPU_CLOCK_HZ\r
- #if configUSE_TICKLESS_IDLE == 1\r
- static const unsigned long ulStoppedTimerCompensation = 45UL;\r
- #endif\r
-#else /* configSYSTICK_CLOCK_HZ */\r
- #if configUSE_TICKLESS_IDLE == 1\r
- /* Assumes the SysTick clock is slower than the CPU clock. */\r
- static const unsigned long ulStoppedTimerCompensation = 45UL / ( configCPU_CLOCK_HZ / configSYSTICK_CLOCK_HZ );\r
- #endif\r
-#endif /* configSYSTICK_CLOCK_HZ */\r
+#endif\r
\r
/* Constants required to manipulate the core. Registers first... */\r
#define portNVIC_SYSTICK_CTRL_REG ( * ( ( volatile unsigned long * ) 0xe000e010 ) )\r
static unsigned portBASE_TYPE uxCriticalNesting = 0xaaaaaaaa;\r
\r
/*\r
- * Setup the timer to generate the tick interrupts.\r
+ * Setup the timer to generate the tick interrupts. The implementation in this\r
+ * file is weak to allow application writers to change the timer used to\r
+ * generate the tick interrupt.\r
*/\r
-static void prvSetupTimerInterrupt( void );\r
+void vPortSetupTimerInterrupt( void );\r
\r
/*\r
* Exception handlers.\r
/*\r
* The number of SysTick increments that make up one tick period.\r
*/\r
-static unsigned long ulTimerReloadValueForOneTick = 0;\r
+#if configUSE_TICKLESS_IDLE == 1\r
+ static unsigned long ulTimerReloadValueForOneTick = 0;\r
+#endif\r
\r
/*\r
* The maximum number of tick periods that can be suppressed is limited by the\r
static unsigned long xMaximumPossibleSuppressedTicks = 0;\r
#endif /* configUSE_TICKLESS_IDLE */\r
\r
+/*\r
+ * Compensate for the CPU cycles that pass while the SysTick is stopped (low\r
+ * power functionality only.\r
+ */\r
+#if configUSE_TICKLESS_IDLE == 1\r
+ static unsigned long ulStoppedTimerCompensation = 0;\r
+#endif /* configUSE_TICKLESS_IDLE */\r
+\r
/*-----------------------------------------------------------*/\r
\r
/*\r
\r
/* Start the timer that generates the tick ISR. Interrupts are disabled\r
here already. */\r
- prvSetupTimerInterrupt();\r
+ vPortSetupTimerInterrupt();\r
\r
/* Initialise the critical nesting count ready for the first task. */\r
uxCriticalNesting = 0;\r
portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT;\r
#endif\r
\r
+ /* Only reset the systick load register if configUSE_TICKLESS_IDLE is set to\r
+ 1. If it is set to 0 tickless idle is not being used. If it is set to a\r
+ value other than 0 or 1 then a timer other than the SysTick is being used\r
+ to generate the tick interrupt. */\r
#if configUSE_TICKLESS_IDLE == 1\r
portNVIC_SYSTICK_LOAD_REG = ulTimerReloadValueForOneTick;\r
#endif\r
portNVIC_SYSTICK_CTRL_REG = portNVIC_SYSTICK_CLK_BIT | portNVIC_SYSTICK_INT_BIT | portNVIC_SYSTICK_ENABLE_BIT;\r
\r
/* Sleep until something happens. */\r
- configPRE_SLEEP_PROCESSING();\r
- __WFI();\r
- configPOST_SLEEP_PROCESSING();\r
+ configPRE_SLEEP_PROCESSING( xExpectedIdleTime );\r
+ if( xExpectedIdleTime > 0 )\r
+ {\r
+ __WFI();\r
+ }\r
+ configPOST_SLEEP_PROCESSING( xExpectedIdleTime );\r
\r
/* Stop SysTick. Again, the time the SysTick is stopped for is\r
accounted for as best it can be, but using the tickless mode will\r
* Setup the systick timer to generate the tick interrupts at the required\r
* frequency.\r
*/\r
-void prvSetupTimerInterrupt( void )\r
+__weak void vPortSetupTimerInterrupt( void )\r
{\r
- /* Configure the constants required to setup the tick interrupt. */\r
- ulTimerReloadValueForOneTick = ( configSYSTICK_CLOCK_HZ / configTICK_RATE_HZ ) - 1UL;\r
+ /* Calculate the constants required to configure the tick interrupt. */ \r
#if configUSE_TICKLESS_IDLE == 1\r
+ {\r
+ ulTimerReloadValueForOneTick = ( configSYSTICK_CLOCK_HZ / configTICK_RATE_HZ ) - 1UL;\r
xMaximumPossibleSuppressedTicks = 0xffffffUL / ( ( configSYSTICK_CLOCK_HZ / configTICK_RATE_HZ ) - 1UL );\r
+ ulStoppedTimerCompensation = 45UL / ( configCPU_CLOCK_HZ / configSYSTICK_CLOCK_HZ );\r
+ }\r
#endif /* configUSE_TICKLESS_IDLE */\r
\r
/* Configure SysTick to interrupt at the requested rate. */\r
- portNVIC_SYSTICK_LOAD_REG = ulTimerReloadValueForOneTick;\r
+ portNVIC_SYSTICK_LOAD_REG = ( configSYSTICK_CLOCK_HZ / configTICK_RATE_HZ ) - 1UL;;\r
portNVIC_SYSTICK_CTRL_REG = portNVIC_SYSTICK_CLK_BIT | portNVIC_SYSTICK_INT_BIT | portNVIC_SYSTICK_ENABLE_BIT;\r
}\r
/*-----------------------------------------------------------*/\r
\r
#ifndef configSYSTICK_CLOCK_HZ\r
#define configSYSTICK_CLOCK_HZ configCPU_CLOCK_HZ\r
- #if configUSE_TICKLESS_IDLE == 1\r
- static const unsigned long ulStoppedTimerCompensation = 45UL;\r
- #endif\r
-#else /* configSYSTICK_CLOCK_HZ */\r
- #if configUSE_TICKLESS_IDLE == 1\r
- /* Assumes the SysTick clock is slower than the CPU clock. */\r
- static const unsigned long ulStoppedTimerCompensation = 45UL / ( configCPU_CLOCK_HZ / configSYSTICK_CLOCK_HZ );\r
- #endif\r
-#endif /* configSYSTICK_CLOCK_HZ */\r
+#endif\r
+\r
+/* The __weak attribute does not work as you might expect with the Keil tools\r
+so the configOVERRIDE_DEFAULT_TICK_CONFIGURATION constant must be set to 1 if\r
+the application writer wants to provide their own implementation of \r
+vPortSetupTimerInterrupt(). Ensure configOVERRIDE_DEFAULT_TICK_CONFIGURATION\r
+is defined. */\r
+#ifndef configOVERRIDE_DEFAULT_TICK_CONFIGURATION\r
+ #define configOVERRIDE_DEFAULT_TICK_CONFIGURATION 0\r
+#endif\r
\r
/* Constants required to manipulate the core. Registers first... */\r
#define portNVIC_SYSTICK_CTRL_REG ( * ( ( volatile unsigned long * ) 0xe000e010 ) )\r
static unsigned portBASE_TYPE uxCriticalNesting = 0xaaaaaaaa;\r
\r
/*\r
- * Setup the timer to generate the tick interrupts.\r
+ * Setup the timer to generate the tick interrupts. The implementation in this\r
+ * file is weak to allow application writers to change the timer used to \r
+ * generate the tick interrupt.\r
*/\r
-static void prvSetupTimerInterrupt( void );\r
+void vPortSetupTimerInterrupt( void );\r
\r
/*\r
* Exception handlers.\r
/*\r
* The number of SysTick increments that make up one tick period.\r
*/\r
-static unsigned long ulTimerReloadValueForOneTick = 0;\r
+#if configUSE_TICKLESS_IDLE == 1\r
+ static unsigned long ulTimerReloadValueForOneTick = 0;\r
+#endif\r
\r
/*\r
* The maximum number of tick periods that can be suppressed is limited by the\r
static unsigned long xMaximumPossibleSuppressedTicks = 0;\r
#endif /* configUSE_TICKLESS_IDLE */\r
\r
+/*\r
+ * Compensate for the CPU cycles that pass while the SysTick is stopped (low\r
+ * power functionality only.\r
+ */\r
+#if configUSE_TICKLESS_IDLE == 1\r
+ static unsigned long ulStoppedTimerCompensation = 0;\r
+#endif /* configUSE_TICKLESS_IDLE */\r
+\r
/*-----------------------------------------------------------*/\r
\r
/*\r
\r
/* Start the timer that generates the tick ISR. Interrupts are disabled\r
here already. */\r
- prvSetupTimerInterrupt();\r
+ vPortSetupTimerInterrupt();\r
\r
/* Initialise the critical nesting count ready for the first task. */\r
uxCriticalNesting = 0;\r
}\r
#endif\r
\r
+ /* Only reset the systick load register if configUSE_TICKLESS_IDLE is set to\r
+ 1. If it is set to 0 tickless idle is not being used. If it is set to a \r
+ value other than 0 or 1 then a timer other than the SysTick is being used\r
+ to generate the tick interrupt. */\r
#if configUSE_TICKLESS_IDLE == 1\r
portNVIC_SYSTICK_LOAD_REG = ulTimerReloadValueForOneTick;\r
#endif\r
portNVIC_SYSTICK_CTRL_REG = portNVIC_SYSTICK_CLK_BIT | portNVIC_SYSTICK_INT_BIT | portNVIC_SYSTICK_ENABLE_BIT;\r
\r
/* Sleep until something happens. */\r
- configPRE_SLEEP_PROCESSING();\r
- __wfi();\r
- configPOST_SLEEP_PROCESSING();\r
+ configPRE_SLEEP_PROCESSING( xExpectedIdleTime );\r
+ if( xExpectedIdleTime > 0 )\r
+ {\r
+ __wfi();\r
+ }\r
+ configPOST_SLEEP_PROCESSING( xExpectedIdleTime );\r
\r
/* Stop SysTick. Again, the time the SysTick is stopped for is\r
accounted for as best it can be, but using the tickless mode will\r
* Setup the SysTick timer to generate the tick interrupts at the required\r
* frequency.\r
*/\r
-void prvSetupTimerInterrupt( void )\r
-{\r
- /* Calculate the constants required to configure the tick interrupt. */\r
- ulTimerReloadValueForOneTick = ( configSYSTICK_CLOCK_HZ / configTICK_RATE_HZ ) - 1UL;\r
- #if configUSE_TICKLESS_IDLE == 1\r
- xMaximumPossibleSuppressedTicks = 0xffffffUL / ( ( configSYSTICK_CLOCK_HZ / configTICK_RATE_HZ ) - 1UL );\r
- #endif /* configUSE_TICKLESS_IDLE */\r
+#if configOVERRIDE_DEFAULT_TICK_CONFIGURATION == 0\r
\r
- /* Configure SysTick to interrupt at the requested rate. */\r
- portNVIC_SYSTICK_LOAD_REG = ulTimerReloadValueForOneTick;\r
- portNVIC_SYSTICK_CTRL_REG = portNVIC_SYSTICK_CLK_BIT | portNVIC_SYSTICK_INT_BIT | portNVIC_SYSTICK_ENABLE_BIT;\r
-}\r
+ void vPortSetupTimerInterrupt( void )\r
+ {\r
+ /* Calculate the constants required to configure the tick interrupt. */ \r
+ #if configUSE_TICKLESS_IDLE == 1\r
+ {\r
+ ulTimerReloadValueForOneTick = ( configSYSTICK_CLOCK_HZ / configTICK_RATE_HZ ) - 1UL;\r
+ xMaximumPossibleSuppressedTicks = 0xffffffUL / ( ( configSYSTICK_CLOCK_HZ / configTICK_RATE_HZ ) - 1UL );\r
+ ulStoppedTimerCompensation = 45UL / ( configCPU_CLOCK_HZ / configSYSTICK_CLOCK_HZ );\r
+ }\r
+ #endif /* configUSE_TICKLESS_IDLE */\r
+ \r
+ /* Configure SysTick to interrupt at the requested rate. */\r
+ portNVIC_SYSTICK_LOAD_REG = ( configSYSTICK_CLOCK_HZ / configTICK_RATE_HZ ) - 1UL;;\r
+ portNVIC_SYSTICK_CTRL_REG = portNVIC_SYSTICK_CLK_BIT | portNVIC_SYSTICK_INT_BIT | portNVIC_SYSTICK_ENABLE_BIT;\r
+ }\r
+ \r
+#endif /* configOVERRIDE_DEFAULT_TICK_CONFIGURATION */\r
/*-----------------------------------------------------------*/\r
\r
__asm unsigned long ulPortSetInterruptMask( void )\r
msr basepri, r1\r
bx r14\r
}\r
-\r
/*-----------------------------------------------------------*/\r
\r
__asm void vPortClearInterruptMask( unsigned long ulNewMask )\r
\r
#ifndef configSYSTICK_CLOCK_HZ\r
#define configSYSTICK_CLOCK_HZ configCPU_CLOCK_HZ\r
- #if configUSE_TICKLESS_IDLE == 1\r
- static const unsigned long ulStoppedTimerCompensation = 45UL;\r
- #endif\r
-#else /* configSYSTICK_CLOCK_HZ */\r
- #if configUSE_TICKLESS_IDLE == 1\r
- /* Assumes the SysTick clock is slower than the CPU clock. */\r
- static const unsigned long ulStoppedTimerCompensation = 45UL / ( configCPU_CLOCK_HZ / configSYSTICK_CLOCK_HZ );\r
- #endif\r
-#endif /* configSYSTICK_CLOCK_HZ */\r
+#endif\r
+\r
+/* The __weak attribute does not work as you might expect with the Keil tools\r
+so the configOVERRIDE_DEFAULT_TICK_CONFIGURATION constant must be set to 1 if\r
+the application writer wants to provide their own implementation of \r
+vPortSetupTimerInterrupt(). Ensure configOVERRIDE_DEFAULT_TICK_CONFIGURATION\r
+is defined. */\r
+#ifndef configOVERRIDE_DEFAULT_TICK_CONFIGURATION\r
+ #define configOVERRIDE_DEFAULT_TICK_CONFIGURATION 0\r
+#endif\r
\r
/* Constants required to manipulate the core. Registers first... */\r
#define portNVIC_SYSTICK_CTRL_REG ( * ( ( volatile unsigned long * ) 0xe000e010 ) )\r
static unsigned portBASE_TYPE uxCriticalNesting = 0xaaaaaaaa;\r
\r
/*\r
- * Setup the timer to generate the tick interrupts.\r
+ * Setup the timer to generate the tick interrupts. The implementation in this\r
+ * file is weak to allow application writers to change the timer used to \r
+ * generate the tick interrupt.\r
*/\r
-static void prvSetupTimerInterrupt( void );\r
+void vPortSetupTimerInterrupt( void );\r
\r
/*\r
* Exception handlers.\r
/*\r
* The number of SysTick increments that make up one tick period.\r
*/\r
-static unsigned long ulTimerReloadValueForOneTick = 0;\r
+#if configUSE_TICKLESS_IDLE == 1\r
+ static unsigned long ulTimerReloadValueForOneTick = 0;\r
+#endif\r
\r
/*\r
* The maximum number of tick periods that can be suppressed is limited by the\r
static unsigned long xMaximumPossibleSuppressedTicks = 0;\r
#endif /* configUSE_TICKLESS_IDLE */\r
\r
+/*\r
+ * Compensate for the CPU cycles that pass while the SysTick is stopped (low\r
+ * power functionality only.\r
+ */\r
+#if configUSE_TICKLESS_IDLE == 1\r
+ static unsigned long ulStoppedTimerCompensation = 0;\r
+#endif /* configUSE_TICKLESS_IDLE */\r
+\r
/*-----------------------------------------------------------*/\r
\r
/*\r
\r
/* Start the timer that generates the tick ISR. Interrupts are disabled\r
here already. */\r
- prvSetupTimerInterrupt();\r
+ vPortSetupTimerInterrupt();\r
\r
/* Initialise the critical nesting count ready for the first task. */\r
uxCriticalNesting = 0;\r
}\r
#endif\r
\r
+ /* Only reset the systick load register if configUSE_TICKLESS_IDLE is set to\r
+ 1. If it is set to 0 tickless idle is not being used. If it is set to a \r
+ value other than 0 or 1 then a timer other than the SysTick is being used\r
+ to generate the tick interrupt. */\r
#if configUSE_TICKLESS_IDLE == 1\r
portNVIC_SYSTICK_LOAD_REG = ulTimerReloadValueForOneTick;\r
#endif\r
portNVIC_SYSTICK_CTRL_REG = portNVIC_SYSTICK_CLK_BIT | portNVIC_SYSTICK_INT_BIT | portNVIC_SYSTICK_ENABLE_BIT;\r
\r
/* Sleep until something happens. */\r
- configPRE_SLEEP_PROCESSING();\r
- __wfi();\r
- configPOST_SLEEP_PROCESSING();\r
+ configPRE_SLEEP_PROCESSING( xExpectedIdleTime );\r
+ if( xExpectedIdleTime > 0 )\r
+ {\r
+ __wfi();\r
+ }\r
+ configPOST_SLEEP_PROCESSING( xExpectedIdleTime );\r
\r
/* Stop SysTick. Again, the time the SysTick is stopped for is\r
accounted for as best it can be, but using the tickless mode will\r
/*-----------------------------------------------------------*/\r
\r
/*\r
- * Setup the systick timer to generate the tick interrupts at the required\r
+ * Setup the SysTick timer to generate the tick interrupts at the required\r
* frequency.\r
*/\r
-void prvSetupTimerInterrupt( void )\r
-{\r
- /* Calculate the constants required to configure the tick interrupt. */\r
- ulTimerReloadValueForOneTick = ( configSYSTICK_CLOCK_HZ / configTICK_RATE_HZ ) - 1UL;\r
- #if configUSE_TICKLESS_IDLE == 1\r
- xMaximumPossibleSuppressedTicks = 0xffffffUL / ( ( configSYSTICK_CLOCK_HZ / configTICK_RATE_HZ ) - 1UL );\r
- #endif /* configUSE_TICKLESS_IDLE */\r
+#if configOVERRIDE_DEFAULT_TICK_CONFIGURATION == 0\r
\r
- /* Configure SysTick to interrupt at the requested rate. */\r
- portNVIC_SYSTICK_LOAD_REG = ulTimerReloadValueForOneTick;\r
- portNVIC_SYSTICK_CTRL_REG = portNVIC_SYSTICK_CLK_BIT | portNVIC_SYSTICK_INT_BIT | portNVIC_SYSTICK_ENABLE_BIT;\r
-}\r
+ void vPortSetupTimerInterrupt( void )\r
+ {\r
+ /* Calculate the constants required to configure the tick interrupt. */ \r
+ #if configUSE_TICKLESS_IDLE == 1\r
+ {\r
+ ulTimerReloadValueForOneTick = ( configSYSTICK_CLOCK_HZ / configTICK_RATE_HZ ) - 1UL;\r
+ xMaximumPossibleSuppressedTicks = 0xffffffUL / ( ( configSYSTICK_CLOCK_HZ / configTICK_RATE_HZ ) - 1UL );\r
+ ulStoppedTimerCompensation = 45UL / ( configCPU_CLOCK_HZ / configSYSTICK_CLOCK_HZ );\r
+ }\r
+ #endif /* configUSE_TICKLESS_IDLE */\r
+ \r
+ /* Configure SysTick to interrupt at the requested rate. */\r
+ portNVIC_SYSTICK_LOAD_REG = ( configSYSTICK_CLOCK_HZ / configTICK_RATE_HZ ) - 1UL;;\r
+ portNVIC_SYSTICK_CTRL_REG = portNVIC_SYSTICK_CLK_BIT | portNVIC_SYSTICK_INT_BIT | portNVIC_SYSTICK_ENABLE_BIT;\r
+ }\r
+ \r
+#endif /* configOVERRIDE_DEFAULT_TICK_CONFIGURATION */\r
/*-----------------------------------------------------------*/\r
\r
__asm unsigned long ulPortSetInterruptMask( void )\r
msr basepri, r1\r
bx r14\r
}\r
-\r
/*-----------------------------------------------------------*/\r
\r
__asm void vPortClearInterruptMask( unsigned long ulNewMask )\r
/*\r
FreeRTOS V7.3.0 - Copyright (C) 2012 Real Time Engineers Ltd.\r
\r
- FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME. PLEASE VISIT \r
+ FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME. PLEASE VISIT\r
http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
\r
***************************************************************************\r
FreeRTOS WEB site.\r
\r
1 tab == 4 spaces!\r
- \r
+\r
***************************************************************************\r
* *\r
* Having a problem? Start by reading the FAQ "My application does *\r
* *\r
***************************************************************************\r
\r
- \r
- http://www.FreeRTOS.org - Documentation, training, latest versions, license \r
- and contact details. \r
- \r
+\r
+ http://www.FreeRTOS.org - Documentation, training, latest versions, license\r
+ and contact details.\r
+\r
http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
including FreeRTOS+Trace - an indispensable productivity tool.\r
\r
- Real Time Engineers ltd license FreeRTOS to High Integrity Systems, who sell \r
- the code with commercial support, indemnification, and middleware, under \r
+ Real Time Engineers ltd license FreeRTOS to High Integrity Systems, who sell\r
+ the code with commercial support, indemnification, and middleware, under\r
the OpenRTOS brand: http://www.OpenRTOS.com. High Integrity Systems also\r
- provide a safety engineered and independently SIL3 certified version under \r
+ provide a safety engineered and independently SIL3 certified version under\r
the SafeRTOS brand: http://www.SafeRTOS.com.\r
*/\r
\r
/*\r
* Return the amount of time, in ticks, that will pass before the kernel will\r
* next move a task from the Blocked state to the Running state.\r
+ *\r
+ * This conditional compilation should use inequality to 0, not equality to 1.\r
+ * This is to ensure portSUPPRESS_TICKS_AND_SLEEP() can be called when user\r
+ * defined low power mode implementations require configUSE_TICKLESS_IDLE to be\r
+ * set to a value other than 1.\r
*/\r
-#if ( configUSE_TICKLESS_IDLE == 1 )\r
+#if ( configUSE_TICKLESS_IDLE != 0 )\r
\r
static portTickType prvGetExpectedIdleTime( void ) PRIVILEGED_FUNCTION;\r
\r
}\r
/*----------------------------------------------------------*/\r
\r
-portTickType prvGetExpectedIdleTime( void )\r
-{\r
-portTickType xReturn;\r
+#if ( configUSE_TICKLESS_IDLE != 0 )\r
\r
- if( pxCurrentTCB->uxPriority > tskIDLE_PRIORITY )\r
+ portTickType prvGetExpectedIdleTime( void )\r
{\r
- xReturn = 0;\r
- }\r
- else if( listCURRENT_LIST_LENGTH( &( pxReadyTasksLists[ tskIDLE_PRIORITY ] ) ) > 1 )\r
- {\r
- /* There are other idle priority tasks in the ready state. If\r
- time slicing is used then the very next tick interrupt must be\r
- processed. */\r
- xReturn = 0;\r
- }\r
- else\r
- {\r
- xReturn = xNextTaskUnblockTime - xTickCount;\r
+ portTickType xReturn;\r
+ \r
+ if( pxCurrentTCB->uxPriority > tskIDLE_PRIORITY )\r
+ {\r
+ xReturn = 0;\r
+ }\r
+ else if( listCURRENT_LIST_LENGTH( &( pxReadyTasksLists[ tskIDLE_PRIORITY ] ) ) > 1 )\r
+ {\r
+ /* There are other idle priority tasks in the ready state. If\r
+ time slicing is used then the very next tick interrupt must be\r
+ processed. */\r
+ xReturn = 0;\r
+ }\r
+ else\r
+ {\r
+ xReturn = xNextTaskUnblockTime - xTickCount;\r
+ }\r
+ \r
+ return xReturn;\r
}\r
\r
- return xReturn;\r
-}\r
+#endif /* configUSE_TICKLESS_IDLE != 0 */\r
/*----------------------------------------------------------*/\r
\r
signed portBASE_TYPE xTaskResumeAll( void )\r
#endif\r
/*----------------------------------------------------------*/\r
\r
-#if ( configUSE_TICKLESS_IDLE == 1 )\r
+/* This conditional compilation should use inequality to 0, not equality to 1.\r
+This is to ensure vTaskStepTick() is available when user defined low power mode \r
+implementations require configUSE_TICKLESS_IDLE to be set to a value other than\r
+1. */\r
+#if ( configUSE_TICKLESS_IDLE != 0 )\r
\r
void vTaskStepTick( portTickType xTicksToJump )\r
{\r
}\r
#endif\r
\r
- #if ( configUSE_TICKLESS_IDLE == 1 )\r
+ /* This conditional compilation should use inequality to 0, not equality\r
+ to 1. This is to ensure portSUPPRESS_TICKS_AND_SLEEP() is called when\r
+ user defined low power mode implementations require\r
+ configUSE_TICKLESS_IDLE to be set to a value other than 1. */\r
+ #if ( configUSE_TICKLESS_IDLE != 0 )\r
{\r
portTickType xExpectedIdleTime;\r
/* If the expected idle time is 1 then the idle time would end at\r
routines returns. */\r
const portTickType xMinimumExpectedIdleTime = ( portTickType ) 2;\r
\r
- /* Don't enter low power if there are still tasks waiting\r
- deletion. */\r
- if( uxTasksDeleted == 0 )\r
+ /* It is not desirable to suspend then resume the scheduler on\r
+ each iteration of the idle task. Therefore, a preliminary\r
+ test of the expected idle time is performed without the\r
+ scheduler suspended. The result here is not necessarily\r
+ valid. */\r
+ xExpectedIdleTime = prvGetExpectedIdleTime();\r
+\r
+ if( xExpectedIdleTime >= xMinimumExpectedIdleTime )\r
{\r
- /* It is not desirable to suspend then resume the scheduler on\r
- each iteration of the idle task. Therefore, a preliminary\r
- test of the expected idle time is performed without the\r
- scheduler suspended. The result here is not necessarily\r
- valid. */\r
- xExpectedIdleTime = prvGetExpectedIdleTime();\r
-\r
- if( xExpectedIdleTime >= xMinimumExpectedIdleTime )\r
+ vTaskSuspendAll();\r
{\r
- vTaskSuspendAll();\r
- {\r
- /* Now the scheduler is suspended, the expected idle\r
- time can be sampled again, and this time its value can\r
- be used. */\r
- configASSERT( xNextTaskUnblockTime >= xTickCount );\r
- xExpectedIdleTime = prvGetExpectedIdleTime();\r
+ /* Now the scheduler is suspended, the expected idle\r
+ time can be sampled again, and this time its value can\r
+ be used. */\r
+ configASSERT( xNextTaskUnblockTime >= xTickCount );\r
+ xExpectedIdleTime = prvGetExpectedIdleTime();\r
\r
- if( xExpectedIdleTime >= xMinimumExpectedIdleTime )\r
- {\r
- portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime );\r
- }\r
+ if( xExpectedIdleTime >= xMinimumExpectedIdleTime )\r
+ {\r
+ portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime );\r
}\r
- xTaskResumeAll();\r
}\r
+ xTaskResumeAll();\r
}\r
}\r
#endif\r
\r
/* ucTasksDeleted is used to prevent vTaskSuspendAll() being called\r
too often in the idle task. */\r
- if( uxTasksDeleted > ( unsigned portBASE_TYPE ) 0U )\r
+ while( uxTasksDeleted > ( unsigned portBASE_TYPE ) 0U )\r
{\r
vTaskSuspendAll();\r
xListIsEmpty = listLIST_IS_EMPTY( &xTasksWaitingTermination );\r