#define portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime )\r
#endif\r
\r
-#ifndef portPRE_SLEEP_PROCESSING\r
- #define portPRE_SLEEP_PROCESSING()\r
+#ifndef configPRE_SLEEP_PROCESSING\r
+ #define configPRE_SLEEP_PROCESSING()\r
#endif\r
\r
-#ifndef portPOST_SLEEP_PROCESSING\r
- #define portPOST_SLEEP_PROCESSING()\r
+#ifndef configPOST_SLEEP_PROCESSING\r
+ #define configPOST_SLEEP_PROCESSING()\r
#endif\r
\r
#endif /* INC_FREERTOS_H */\r
*/\r
void vTaskSetTaskNumber( xTaskHandle xTask, unsigned portBASE_TYPE uxHandle );\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
-portTickType xTaskGetExpectedIdleTime( void );\r
-\r
/*\r
* If tickless mode is being used, or a low power mode is implemented, then\r
* the tick interrupt will not execute during idle periods. When this is the\r
*/\r
void vTaskStepTick( portTickType xTicksToJump );\r
\r
-/*\r
- * Returns the number of tick interrupts that have occurred while the scheduler \r
- * has been suspended. The count pending ticks is reset if xResetOnExit is set\r
- * to pdTRUE.\r
- */\r
-unsigned portBASE_TYPE uxTaskPendingTicksGet( portBASE_TYPE xResetOnExit );\r
-\r
#ifdef __cplusplus\r
}\r
#endif\r
\r
; Get the SPSR from the stack.\r
LDMFD LR!, {R0}\r
- MSR SPSR_CF, R0\r
+ MSR SPSR_CSXF, R0\r
\r
; Restore all system mode registers for the task.\r
LDMFD LR, {R0-R14}^\r
portNVIC_SYSTICK_CTRL_REG = portNVIC_SYSTICK_CLK_BIT | portNVIC_SYSTICK_INT_BIT | portNVIC_SYSTICK_ENABLE_BIT;\r
\r
/* Sleep until something happens. */\r
- portPRE_SLEEP_PROCESSING();\r
+ configPRE_SLEEP_PROCESSING();\r
__asm volatile( "wfi" );\r
- portPOST_SLEEP_PROCESSING();\r
+ configPOST_SLEEP_PROCESSING();\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
/* Tickless idle/low power functionality. */\r
-extern void vPortSuppressTicksAndSleep( portTickType xExpectedIdleTime );\r
-#define portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime ) vPortSuppressTicksAndSleep( xExpectedIdleTime )\r
+#ifndef portSUPPRESS_TICKS_AND_SLEEP\r
+ extern void vPortSuppressTicksAndSleep( portTickType xExpectedIdleTime );\r
+ #define portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime ) vPortSuppressTicksAndSleep( xExpectedIdleTime )\r
+#endif\r
/*-----------------------------------------------------------*/\r
\r
/* Architecture specific optimisations. */\r
portNVIC_SYSTICK_CTRL_REG = portNVIC_SYSTICK_CLK_BIT | portNVIC_SYSTICK_INT_BIT | portNVIC_SYSTICK_ENABLE_BIT;\r
\r
/* Sleep until something happens. */\r
- portPRE_SLEEP_PROCESSING();\r
+ configPRE_SLEEP_PROCESSING();\r
__asm volatile( "wfi" );\r
- portPOST_SLEEP_PROCESSING();\r
+ configPOST_SLEEP_PROCESSING();\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
/* Tickless idle/low power functionality. */\r
-extern void vPortSuppressTicksAndSleep( portTickType xExpectedIdleTime );\r
-#define portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime ) vPortSuppressTicksAndSleep( xExpectedIdleTime )\r
+#ifndef portSUPPRESS_TICKS_AND_SLEEP\r
+ extern void vPortSuppressTicksAndSleep( portTickType xExpectedIdleTime );\r
+ #define portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime ) vPortSuppressTicksAndSleep( xExpectedIdleTime )\r
+#endif\r
/*-----------------------------------------------------------*/\r
\r
/* Architecture specific optimisations. */\r
portNVIC_SYSTICK_CTRL_REG = portNVIC_SYSTICK_CLK_BIT | portNVIC_SYSTICK_INT_BIT | portNVIC_SYSTICK_ENABLE_BIT;\r
\r
/* Sleep until something happens. */\r
- portPRE_SLEEP_PROCESSING();\r
+ configPRE_SLEEP_PROCESSING();\r
__WFI();\r
- portPOST_SLEEP_PROCESSING();\r
+ configPOST_SLEEP_PROCESSING();\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
#define portCLEAR_INTERRUPT_MASK_FROM_ISR(x) vPortClearInterruptMask( x )\r
/*-----------------------------------------------------------*/\r
\r
-/* Tickless/low power functionality. */\r
-extern void vPortSuppressTicksAndSleep( portTickType xExpectedIdleTime );\r
-#define portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime ) vPortSuppressTicksAndSleep( xExpectedIdleTime )\r
+/* Tickless idle/low power functionality. */\r
+#ifndef portSUPPRESS_TICKS_AND_SLEEP\r
+ extern void vPortSuppressTicksAndSleep( portTickType xExpectedIdleTime );\r
+ #define portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime ) vPortSuppressTicksAndSleep( xExpectedIdleTime )\r
+#endif\r
/*-----------------------------------------------------------*/\r
\r
/* Task function macros as described on the FreeRTOS.org WEB site. These are\r
portNVIC_SYSTICK_CTRL_REG = portNVIC_SYSTICK_CLK_BIT | portNVIC_SYSTICK_INT_BIT | portNVIC_SYSTICK_ENABLE_BIT;\r
\r
/* Sleep until something happens. */\r
- portPRE_SLEEP_PROCESSING();\r
+ configPRE_SLEEP_PROCESSING();\r
__WFI();\r
- portPOST_SLEEP_PROCESSING();\r
+ configPOST_SLEEP_PROCESSING();\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
#define portALIGNMENT_ASSERT_pxCurrentTCB ( void )\r
/*-----------------------------------------------------------*/\r
\r
-/* Tickless/low power functionality. */\r
-extern void vPortSuppressTicksAndSleep( portTickType xExpectedIdleTime );\r
-#define portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime ) vPortSuppressTicksAndSleep( xExpectedIdleTime )\r
+/* Tickless idle/low power functionality. */\r
+#ifndef portSUPPRESS_TICKS_AND_SLEEP\r
+ extern void vPortSuppressTicksAndSleep( portTickType xExpectedIdleTime );\r
+ #define portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime ) vPortSuppressTicksAndSleep( xExpectedIdleTime )\r
+#endif\r
\r
/*-----------------------------------------------------------*/\r
\r
portNVIC_SYSTICK_CTRL_REG = portNVIC_SYSTICK_CLK_BIT | portNVIC_SYSTICK_INT_BIT | portNVIC_SYSTICK_ENABLE_BIT;\r
\r
/* Sleep until something happens. */\r
- portPRE_SLEEP_PROCESSING();\r
+ configPRE_SLEEP_PROCESSING();\r
__wfi();\r
- portPOST_SLEEP_PROCESSING();\r
+ configPOST_SLEEP_PROCESSING();\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
#define portCLEAR_INTERRUPT_MASK_FROM_ISR(x) vPortClearInterruptMask(x)\r
/*-----------------------------------------------------------*/\r
\r
-/* Tickless/low power optimisations. */\r
-extern void vPortSuppressTicksAndSleep( portTickType xExpectedIdleTime );\r
-#define portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime ) vPortSuppressTicksAndSleep( xExpectedIdleTime )\r
+/* Tickless idle/low power functionality. */\r
+#ifndef portSUPPRESS_TICKS_AND_SLEEP\r
+ extern void vPortSuppressTicksAndSleep( portTickType xExpectedIdleTime );\r
+ #define portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime ) vPortSuppressTicksAndSleep( xExpectedIdleTime )\r
+#endif\r
/*-----------------------------------------------------------*/\r
\r
/* Port specific optimisations. */\r
portNVIC_SYSTICK_CTRL_REG = portNVIC_SYSTICK_CLK_BIT | portNVIC_SYSTICK_INT_BIT | portNVIC_SYSTICK_ENABLE_BIT;\r
\r
/* Sleep until something happens. */\r
- portPRE_SLEEP_PROCESSING();\r
+ configPRE_SLEEP_PROCESSING();\r
__wfi();\r
- portPOST_SLEEP_PROCESSING();\r
+ configPOST_SLEEP_PROCESSING();\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
#define portALIGNMENT_ASSERT_pxCurrentTCB ( void )\r
/*-----------------------------------------------------------*/\r
\r
-/* Tickless/low power optimisations. */\r
-extern void vPortSuppressTicksAndSleep( portTickType xExpectedIdleTime );\r
-#define portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime ) vPortSuppressTicksAndSleep( xExpectedIdleTime )\r
+/* Tickless idle/low power functionality. */\r
+#ifndef portSUPPRESS_TICKS_AND_SLEEP\r
+ extern void vPortSuppressTicksAndSleep( portTickType xExpectedIdleTime );\r
+ #define portSUPPRESS_TICKS_AND_SLEEP( xExpectedIdleTime ) vPortSuppressTicksAndSleep( xExpectedIdleTime )\r
+#endif\r
/*-----------------------------------------------------------*/\r
\r
/* Port specific optimisations. */\r
\r
#endif\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
+#if ( configUSE_TICKLESS_IDLE == 1 )\r
+\r
+ static portTickType prvGetExpectedIdleTime( void ) PRIVILEGED_FUNCTION;\r
+\r
+#endif\r
\r
/*lint +e956 */\r
\r
}\r
/*----------------------------------------------------------*/\r
\r
-portTickType xTaskGetExpectedIdleTime( void )\r
+portTickType prvGetExpectedIdleTime( void )\r
{\r
portTickType xReturn;\r
\r
#endif\r
/*----------------------------------------------------------*/\r
\r
-void vTaskStepTick( portTickType xTicksToJump )\r
-{\r
- configASSERT( xTicksToJump <= xNextTaskUnblockTime );\r
- xTickCount += xTicksToJump;\r
-}\r
+#if ( configUSE_TICKLESS_IDLE == 1 )\r
+\r
+ void vTaskStepTick( portTickType xTicksToJump )\r
+ {\r
+ configASSERT( xTicksToJump <= xNextTaskUnblockTime );\r
+ xTickCount += xTicksToJump;\r
+ }\r
+\r
+#endif\r
\r
/*-----------------------------------------------------------\r
* SCHEDULER INTERNALS AVAILABLE FOR PORTING PURPOSES\r
/* Calculate the time at which the task should be woken if the event does\r
not occur. This may overflow but this doesn't matter. */\r
xTimeToWake = xTickCount + xTicksToWait;\r
+ \r
+ traceTASK_DELAY_UNTIL();\r
prvAddCurrentTaskToDelayedList( xTimeToWake );\r
}\r
\r
test of the expected idle time is performed without the\r
scheduler suspended. The result here is not necessarily\r
valid. */\r
- xExpectedIdleTime = xTaskGetExpectedIdleTime();\r
+ xExpectedIdleTime = prvGetExpectedIdleTime();\r
\r
if( xExpectedIdleTime >= xMinimumExpectedIdleTime )\r
{\r
time can be sampled again, and this time its value can\r
be used. */\r
configASSERT( xNextTaskUnblockTime >= xTickCount );\r
- xExpectedIdleTime = xTaskGetExpectedIdleTime();\r
+ xExpectedIdleTime = prvGetExpectedIdleTime();\r
\r
if( xExpectedIdleTime >= xMinimumExpectedIdleTime )\r
{\r
#endif\r
/*-----------------------------------------------------------*/\r
\r
-#if ( configUSE_TICKLESS_IDLE == 1 )\r
-\r
- unsigned portBASE_TYPE uxTaskPendingTicksGet( portBASE_TYPE xResetOnExit )\r
- {\r
- unsigned portBASE_TYPE uxReturn;\r
-\r
- uxReturn = uxMissedTicks;\r
-\r
- if( xResetOnExit == pdTRUE )\r
- {\r
- uxMissedTicks = 0;\r
- }\r
-\r
- return uxReturn;\r
- }\r
-\r
-#endif\r
-/*-----------------------------------------------------------*/\r
-\r
\r
\r
\r