]> git.sur5r.net Git - freertos/commitdiff
Remove #error that attempted to catch stdint.h not being included.
authorrtel <rtel@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Thu, 23 Jan 2014 14:51:53 +0000 (14:51 +0000)
committerrtel <rtel@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Thu, 23 Jan 2014 14:51:53 +0000 (14:51 +0000)
Split the previously overloaded trmCOMMAND_nnn definitions into individual definitions to enable better logging.

git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@2175 1d2547de-c912-0410-9cb9-b8ca96c0e9e2

FreeRTOS/Source/include/FreeRTOS.h
FreeRTOS/Source/include/projdefs.h
FreeRTOS/Source/include/timers.h
FreeRTOS/Source/timers.c

index a069658aaf7c406e03a6dab0bf3875327f2a3512..43d7f7191e6726381530fa35f2b1bdc7c80ecc7d 100644 (file)
  * Include the generic headers required for the FreeRTOS port being used.\r
  */\r
 #include <stddef.h>\r
-#include <stdint.h>\r
+\r
+/*\r
+ * If stdint.h cannot be located then:\r
+ *   + If using GCC ensure the -nostdint options is *not* being used.\r
+ *   + Ensure the project's include path includes the directory in which your\r
+ *     compiler stores stdint.h.\r
+ *   + Set any compiler options necessary for it to support C99, as technically\r
+ *     stdint.h is only mandatory with C99 (FreeRTOS does not require C99 in any\r
+ *     other way).\r
+ *   + The FreeRTOS download includes a simple stdint.h definition that can be\r
+ *     used in cases where none is provided by the compiler.  The files only\r
+ *     contains the typedefs required to build FreeRTOS.  Read the instructions\r
+ *     in FreeRTOS/source/stdint.readme for more information.\r
+ */\r
+#include <stdint.h> /* READ COMMENT ABOVE. */\r
 \r
 #ifdef __cplusplus\r
 extern "C" {\r
 #endif\r
 \r
-/* Check stdint.h was included. */\r
-#ifndef UINT32_MAX\r
-       /* Check if the FreeRTOS stdint subset has been included. */\r
-       #ifndef FREERTOS_STDINT\r
-               #error Read the instructions in FreeRTOS/source/stdint.readme if stdint.h is not provided with your compiler or you are building with standard libraries excluded (for example, with -nostdint in GCC).\r
-       #endif /* FREERTOS_STDINT */\r
-#endif /* UINT32_MAX */\r
-\r
 /* Basic FreeRTOS definitions. */\r
 #include "projdefs.h"\r
 \r
index 93c53b876d329c7e76fa49ea3790c50d50e53c4a..f4058e3bf054e7d90be7ace6ed258224afd8b435 100644 (file)
@@ -66,7 +66,7 @@
 #ifndef PROJDEFS_H\r
 #define PROJDEFS_H\r
 \r
-/* \r
+/*\r
  * Defines the prototype to which task functions must conform.  Defined in this\r
  * file to ensure the type is known before portable.h is included.\r
  */\r
index 7c8a9cd7bc744c12be788ea6414bb826024af819..2b9698d36cda7b1ab96875444feaa2988da17d60 100644 (file)
@@ -86,12 +86,22 @@ extern "C" {
 \r
 /* IDs for commands that can be sent/received on the timer queue.  These are to\r
 be used solely through the macros that make up the public software timer API,\r
-as defined below. */\r
+as defined below.  The commands that are sent from interrupts must use the\r
+highest numbers as tmrFIRST_FROM_ISR_COMMAND is used to determine if the task\r
+or interrupt version of the queue send function should be used. */\r
 #define tmrCOMMAND_EXECUTE_CALLBACK                    ( ( BaseType_t ) -1 )\r
 #define tmrCOMMAND_START                                       ( ( BaseType_t ) 0 )\r
-#define tmrCOMMAND_STOP                                                ( ( BaseType_t ) 1 )\r
-#define tmrCOMMAND_CHANGE_PERIOD                       ( ( BaseType_t ) 2 )\r
-#define tmrCOMMAND_DELETE                                      ( ( BaseType_t ) 3 )\r
+#define tmrCOMMAND_START_DONT_TRACE                    ( ( BaseType_t ) 1 )\r
+#define tmrCOMMAND_RESET                                       ( ( BaseType_t ) 2 )\r
+#define tmrCOMMAND_STOP                                                ( ( BaseType_t ) 3 )\r
+#define tmrCOMMAND_CHANGE_PERIOD                       ( ( BaseType_t ) 4 )\r
+#define tmrCOMMAND_DELETE                                      ( ( BaseType_t ) 5 )\r
+\r
+#define tmrFIRST_FROM_ISR_COMMAND                      ( ( BaseType_t ) 6 )\r
+#define tmrCOMMAND_START_FROM_ISR                      ( ( BaseType_t ) 7 )\r
+#define tmrCOMMAND_RESET_FROM_ISR                      ( ( BaseType_t ) 8 )\r
+#define tmrCOMMAND_STOP_FROM_ISR                       ( ( BaseType_t ) 9 )\r
+\r
 \r
 /**\r
  * Type by which software timers are referenced.  For example, a call to\r
@@ -647,7 +657,7 @@ TaskHandle_t xTimerGetTimerDaemonTaskHandle( void );
  * }\r
  * @endverbatim\r
  */\r
-#define xTimerReset( xTimer, xBlockTime ) xTimerGenericCommand( ( xTimer ), tmrCOMMAND_START, ( xTaskGetTickCount() ), NULL, ( xBlockTime ) )\r
+#define xTimerReset( xTimer, xBlockTime ) xTimerGenericCommand( ( xTimer ), tmrCOMMAND_RESET, ( xTaskGetTickCount() ), NULL, ( xBlockTime ) )\r
 \r
 /**\r
  * BaseType_t xTimerStartFromISR(      TimerHandle_t xTimer,\r
@@ -733,7 +743,7 @@ TaskHandle_t xTimerGetTimerDaemonTaskHandle( void );
  * }\r
  * @endverbatim\r
  */\r
-#define xTimerStartFromISR( xTimer, pxHigherPriorityTaskWoken ) xTimerGenericCommand( ( xTimer ), tmrCOMMAND_START, ( xTaskGetTickCountFromISR() ), ( pxHigherPriorityTaskWoken ), 0U )\r
+#define xTimerStartFromISR( xTimer, pxHigherPriorityTaskWoken ) xTimerGenericCommand( ( xTimer ), tmrCOMMAND_START_FROM_ISR, ( xTaskGetTickCountFromISR() ), ( pxHigherPriorityTaskWoken ), 0U )\r
 \r
 /**\r
  * BaseType_t xTimerStopFromISR(       TimerHandle_t xTimer,\r
@@ -796,7 +806,7 @@ TaskHandle_t xTimerGetTimerDaemonTaskHandle( void );
  * }\r
  * @endverbatim\r
  */\r
-#define xTimerStopFromISR( xTimer, pxHigherPriorityTaskWoken ) xTimerGenericCommand( ( xTimer ), tmrCOMMAND_STOP, 0, ( pxHigherPriorityTaskWoken ), 0U )\r
+#define xTimerStopFromISR( xTimer, pxHigherPriorityTaskWoken ) xTimerGenericCommand( ( xTimer ), tmrCOMMAND_STOP_FROM_ISR, 0, ( pxHigherPriorityTaskWoken ), 0U )\r
 \r
 /**\r
  * BaseType_t xTimerChangePeriodFromISR( TimerHandle_t xTimer,\r
@@ -955,7 +965,7 @@ TaskHandle_t xTimerGetTimerDaemonTaskHandle( void );
  * }\r
  * @endverbatim\r
  */\r
-#define xTimerResetFromISR( xTimer, pxHigherPriorityTaskWoken ) xTimerGenericCommand( ( xTimer ), tmrCOMMAND_START, ( xTaskGetTickCountFromISR() ), ( pxHigherPriorityTaskWoken ), 0U )\r
+#define xTimerResetFromISR( xTimer, pxHigherPriorityTaskWoken ) xTimerGenericCommand( ( xTimer ), tmrCOMMAND_RESET_FROM_ISR, ( xTaskGetTickCountFromISR() ), ( pxHigherPriorityTaskWoken ), 0U )\r
 \r
 \r
 /**\r
index fe0591a1080c57ada2a31f8d9d220f334db1843d..26f537d723e43c0f92a12e4ffecd4244c8f37cb8 100644 (file)
@@ -105,6 +105,9 @@ typedef struct tmrTimerControl
        UBaseType_t                             uxAutoReload;           /*<< Set to pdTRUE if the timer should be automatically restarted once expired.  Set to pdFALSE if the timer is, in effect, a one-shot timer. */\r
        void                                    *pvTimerID;                     /*<< An ID to identify the timer.  This allows the timer to be identified when the same callback is used for multiple timers. */\r
        TimerCallbackFunction_t pxCallbackFunction;     /*<< The function that will be called when the timer expires. */\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
 \r
 /* The definition of messages that can be sent and received on the timer queue.\r
@@ -316,7 +319,7 @@ DaemonTaskMessage_t xMessage;
                xMessage.u.xTimerParameters.xMessageValue = xOptionalValue;\r
                xMessage.u.xTimerParameters.pxTimer = ( Timer_t * ) xTimer;\r
 \r
-               if( pxHigherPriorityTaskWoken == NULL )\r
+               if( xCommandID < tmrFIRST_FROM_ISR_COMMAND )\r
                {\r
                        if( xTaskGetSchedulerState() == taskSCHEDULER_RUNNING )\r
                        {\r
@@ -377,7 +380,7 @@ Timer_t * const pxTimer = ( Timer_t * ) listGET_OWNER_OF_HEAD_ENTRY( pxCurrentTi
                {\r
                        /* The timer expired before it was added to the active timer\r
                        list.  Reload it now.  */\r
-                       xResult = xTimerGenericCommand( pxTimer, tmrCOMMAND_START, xNextExpireTime, NULL, tmrNO_DELAY );\r
+                       xResult = xTimerGenericCommand( pxTimer, tmrCOMMAND_START_DONT_TRACE, xNextExpireTime, NULL, tmrNO_DELAY );\r
                        configASSERT( xResult );\r
                        ( void ) xResult;\r
                }\r
@@ -621,6 +624,10 @@ TickType_t xTimeNow;
                        switch( xMessage.xMessageID )\r
                        {\r
                                case tmrCOMMAND_START :\r
+                           case tmrCOMMAND_START_FROM_ISR :\r
+                           case tmrCOMMAND_RESET :\r
+                           case tmrCOMMAND_RESET_FROM_ISR :\r
+                               case tmrCOMMAND_START_DONT_TRACE :\r
                                        /* Start or restart a timer. */\r
                                        if( prvInsertTimerInActiveList( pxTimer,  xMessage.u.xTimerParameters.xMessageValue + pxTimer->xTimerPeriodInTicks, xTimeNow, xMessage.u.xTimerParameters.xMessageValue ) == pdTRUE )\r
                                        {\r
@@ -631,7 +638,7 @@ TickType_t xTimeNow;
 \r
                                                if( pxTimer->uxAutoReload == ( UBaseType_t ) pdTRUE )\r
                                                {\r
-                                                       xResult = xTimerGenericCommand( pxTimer, tmrCOMMAND_START, xMessage.u.xTimerParameters.xMessageValue + pxTimer->xTimerPeriodInTicks, NULL, tmrNO_DELAY );\r
+                                                       xResult = xTimerGenericCommand( pxTimer, tmrCOMMAND_START_DONT_TRACE, xMessage.u.xTimerParameters.xMessageValue + pxTimer->xTimerPeriodInTicks, NULL, tmrNO_DELAY );\r
                                                        configASSERT( xResult );\r
                                                        ( void ) xResult;\r
                                                }\r
@@ -647,6 +654,7 @@ TickType_t xTimeNow;
                                        break;\r
 \r
                                case tmrCOMMAND_STOP :\r
+                               case tmrCOMMAND_STOP_FROM_ISR :\r
                                        /* The timer has already been removed from the active list.\r
                                        There is nothing to do here. */\r
                                        break;\r
@@ -721,7 +729,7 @@ BaseType_t xResult;
                        }\r
                        else\r
                        {\r
-                               xResult = xTimerGenericCommand( pxTimer, tmrCOMMAND_START, xNextExpireTime, NULL, tmrNO_DELAY );\r
+                               xResult = xTimerGenericCommand( pxTimer, tmrCOMMAND_START_DONT_TRACE, xNextExpireTime, NULL, tmrNO_DELAY );\r
                                configASSERT( xResult );\r
                                ( void ) xResult;\r
                        }\r