/*\r
- FreeRTOS V8.0.0:rc1 - Copyright (C) 2014 Real Time Engineers Ltd.\r
+ FreeRTOS V8.0.0 - Copyright (C) 2014 Real Time Engineers Ltd.\r
All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
#include "queue.h"\r
#include "timers.h"\r
\r
-#if ( INCLUDE_xTimerPendFunctionCallFromISR == 1 ) && ( configUSE_TIMERS == 0 )\r
- #error configUSE_TIMERS must be set to 1 to make the INCLUDE_xTimerPendFunctionCallFromISR() function available.\r
+#if ( INCLUDE_xTimerPendFunctionCall == 1 ) && ( configUSE_TIMERS == 0 )\r
+ #error configUSE_TIMERS must be set to 1 to make the xTimerPendFunctionCall() function available.\r
#endif\r
\r
/* Lint e961 and e750 are suppressed as a MISRA exception justified because the\r
#if( configUSE_TRACE_FACILITY == 1 )\r
UBaseType_t uxTimerNumber; /*<< An ID assigned by trace tools such as FreeRTOS+Trace */\r
#endif\r
-} Timer_t;\r
+} xTIMER;\r
+\r
+/* The old xTIMER name is maintained above then typedefed to the new Timer_t\r
+name below to enable the use of older kernel aware debuggers. */\r
+typedef xTIMER Timer_t;\r
\r
/* The definition of messages that can be sent and received on the timer queue.\r
Two types of message can be queued - messages that manipulate a software timer,\r
\r
/* Don't include xCallbackParameters if it is not going to be used as\r
it makes the structure (and therefore the timer queue) larger. */\r
- #if ( INCLUDE_xTimerPendFunctionCallFromISR == 1 )\r
+ #if ( INCLUDE_xTimerPendFunctionCall == 1 )\r
CallbackParameters_t xCallbackParameters;\r
- #endif /* INCLUDE_xTimerPendFunctionCallFromISR */\r
+ #endif /* INCLUDE_xTimerPendFunctionCall */\r
} u;\r
} DaemonTaskMessage_t;\r
\r
}\r
/*-----------------------------------------------------------*/\r
\r
-BaseType_t xTimerGenericCommand( TimerHandle_t xTimer, const BaseType_t xCommandID, const TickType_t xOptionalValue, BaseType_t * const pxHigherPriorityTaskWoken, const TickType_t xBlockTime )\r
+BaseType_t xTimerGenericCommand( TimerHandle_t xTimer, const BaseType_t xCommandID, const TickType_t xOptionalValue, BaseType_t * const pxHigherPriorityTaskWoken, const TickType_t xTicksToWait )\r
{\r
BaseType_t xReturn = pdFAIL;\r
DaemonTaskMessage_t xMessage;\r
{\r
if( xTaskGetSchedulerState() == taskSCHEDULER_RUNNING )\r
{\r
- xReturn = xQueueSendToBack( xTimerQueue, &xMessage, xBlockTime );\r
+ xReturn = xQueueSendToBack( xTimerQueue, &xMessage, xTicksToWait );\r
}\r
else\r
{\r
\r
while( xQueueReceive( xTimerQueue, &xMessage, tmrNO_DELAY ) != pdFAIL ) /*lint !e603 xMessage does not have to be initialised as it is passed out, not in, and it is not used unless xQueueReceive() returns pdTRUE. */\r
{\r
- #if ( INCLUDE_xTimerPendFunctionCallFromISR == 1 )\r
+ #if ( INCLUDE_xTimerPendFunctionCall == 1 )\r
{\r
- if( xMessage.xMessageID == tmrCOMMAND_EXECUTE_CALLBACK )\r
+ /* Negative commands are pended function calls rather than timer\r
+ commands. */\r
+ if( xMessage.xMessageID < 0 )\r
{\r
const CallbackParameters_t * const pxCallback = &( xMessage.u.xCallbackParameters );\r
\r
mtCOVERAGE_TEST_MARKER();\r
}\r
}\r
- #endif /* INCLUDE_xTimerPendFunctionCallFromISR */\r
+ #endif /* INCLUDE_xTimerPendFunctionCall */\r
\r
- if( xMessage.xMessageID != tmrCOMMAND_EXECUTE_CALLBACK )\r
+ /* Commands that are positive are timer commands rather than pended\r
+ function calls. */\r
+ if( xMessage.xMessageID >= ( BaseType_t ) 0 )\r
{\r
/* The messages uses the xTimerParameters member to work on a\r
software timer. */\r
break;\r
\r
case tmrCOMMAND_CHANGE_PERIOD :\r
+ case tmrCOMMAND_CHANGE_PERIOD_FROM_ISR :\r
pxTimer->xTimerPeriodInTicks = xMessage.u.xTimerParameters.xMessageValue;\r
configASSERT( ( pxTimer->xTimerPeriodInTicks > 0 ) );\r
\r
taskEXIT_CRITICAL();\r
\r
return xTimerIsInActiveList;\r
-}\r
+} /*lint !e818 Can't be pointer to const due to the typedef. */\r
/*-----------------------------------------------------------*/\r
\r
void *pvTimerGetTimerID( const TimerHandle_t xTimer )\r
}\r
/*-----------------------------------------------------------*/\r
\r
-#if( INCLUDE_xTimerPendFunctionCallFromISR == 1 )\r
+#if( INCLUDE_xTimerPendFunctionCall == 1 )\r
\r
BaseType_t xTimerPendFunctionCallFromISR( PendedFunction_t xFunctionToPend, void *pvParameter1, uint32_t ulParameter2, BaseType_t *pxHigherPriorityTaskWoken )\r
{\r
\r
/* Complete the message with the function parameters and post it to the\r
daemon task. */\r
- xMessage.xMessageID = tmrCOMMAND_EXECUTE_CALLBACK;\r
+ xMessage.xMessageID = tmrCOMMAND_EXECUTE_CALLBACK_FROM_ISR;\r
xMessage.u.xCallbackParameters.pxCallbackFunction = xFunctionToPend;\r
xMessage.u.xCallbackParameters.pvParameter1 = pvParameter1;\r
xMessage.u.xCallbackParameters.ulParameter2 = ulParameter2;\r
\r
xReturn = xQueueSendFromISR( xTimerQueue, &xMessage, pxHigherPriorityTaskWoken );\r
+ \r
+ tracePEND_FUNC_CALL_FROM_ISR( xFunctionToPend, pvParameter1, ulParameter2, xReturn );\r
+\r
+ return xReturn;\r
+ }\r
+\r
+#endif /* INCLUDE_xTimerPendFunctionCall */\r
+/*-----------------------------------------------------------*/\r
+\r
+#if( INCLUDE_xTimerPendFunctionCall == 1 )\r
+\r
+ BaseType_t xTimerPendFunctionCall( PendedFunction_t xFunctionToPend, void *pvParameter1, uint32_t ulParameter2, TickType_t xTicksToWait )\r
+ {\r
+ DaemonTaskMessage_t xMessage;\r
+ BaseType_t xReturn;\r
+\r
+ /* Complete the message with the function parameters and post it to the\r
+ daemon task. */\r
+ xMessage.xMessageID = tmrCOMMAND_EXECUTE_CALLBACK;\r
+ xMessage.u.xCallbackParameters.pxCallbackFunction = xFunctionToPend;\r
+ xMessage.u.xCallbackParameters.pvParameter1 = pvParameter1;\r
+ xMessage.u.xCallbackParameters.ulParameter2 = ulParameter2;\r
+\r
+ xReturn = xQueueSendToBack( xTimerQueue, &xMessage, xTicksToWait );\r
\r
+ tracePEND_FUNC_CALL( xFunctionToPend, pvParameter1, ulParameter2, xReturn );\r
+ \r
return xReturn;\r
}\r
\r
-#endif /* INCLUDE_xTimerPendFunctionCallFromISR */\r
+#endif /* INCLUDE_xTimerPendFunctionCall */\r
/*-----------------------------------------------------------*/\r
\r
/* This entire source file will be skipped if the application is not configured\r