]> git.sur5r.net Git - freertos/commitdiff
Remove "FromISR' functions from the list of functions that switch to a privileged...
authorrtel <rtel@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Mon, 17 Dec 2018 22:04:18 +0000 (22:04 +0000)
committerrtel <rtel@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Mon, 17 Dec 2018 22:04:18 +0000 (22:04 +0000)
Add the vTimerSetReloadMode() API function.

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

FreeRTOS/Source/include/mpu_prototypes.h
FreeRTOS/Source/include/mpu_wrappers.h
FreeRTOS/Source/include/timers.h
FreeRTOS/Source/portable/Common/mpu_wrappers.c
FreeRTOS/Source/timers.c

index 55ee9a23e128d3c0dbb0e4ca96e696bb202207d7..b4cc346124619873543bdeb24aa7a661eb53f6a4 100644 (file)
@@ -64,7 +64,6 @@ UBaseType_t MPU_uxTaskGetStackHighWaterMark( TaskHandle_t xTask );
 configSTACK_DEPTH_TYPE MPU_uxTaskGetStackHighWaterMark2( TaskHandle_t xTask );\r
 void MPU_vTaskSetApplicationTaskTag( TaskHandle_t xTask, TaskHookFunction_t pxHookFunction );\r
 TaskHookFunction_t MPU_xTaskGetApplicationTaskTag( TaskHandle_t xTask );\r
-TaskHookFunction_t MPU_xTaskGetApplicationTaskTagFromISR( TaskHandle_t xTask );\r
 void MPU_vTaskSetThreadLocalStoragePointer( TaskHandle_t xTaskToSet, BaseType_t xIndex, void *pvValue );\r
 void * MPU_pvTaskGetThreadLocalStoragePointer( TaskHandle_t xTaskToQuery, BaseType_t xIndex );\r
 BaseType_t MPU_xTaskCallApplicationTaskHook( TaskHandle_t xTask, void *pvParameter );\r
@@ -121,6 +120,7 @@ BaseType_t MPU_xTimerIsTimerActive( TimerHandle_t xTimer );
 TaskHandle_t MPU_xTimerGetTimerDaemonTaskHandle( void );\r
 BaseType_t MPU_xTimerPendFunctionCall( PendedFunction_t xFunctionToPend, void *pvParameter1, uint32_t ulParameter2, TickType_t xTicksToWait );\r
 const char * MPU_pcTimerGetName( TimerHandle_t xTimer );\r
+void MPU_vTimerSetReloadMode( TimerHandle_t xTimer, const UBaseType_t uxAutoReload );\r
 TickType_t MPU_xTimerGetPeriod( TimerHandle_t xTimer );\r
 TickType_t MPU_xTimerGetExpiryTime( TimerHandle_t xTimer );\r
 BaseType_t MPU_xTimerCreateTimerTask( void );\r
@@ -138,10 +138,8 @@ UBaseType_t MPU_uxEventGroupGetNumber( void* xEventGroup );
 \r
 /* MPU versions of message/stream_buffer.h API functions. */\r
 size_t MPU_xStreamBufferSend( StreamBufferHandle_t xStreamBuffer, const void *pvTxData, size_t xDataLengthBytes, TickType_t xTicksToWait );\r
-size_t MPU_xStreamBufferSendFromISR( StreamBufferHandle_t xStreamBuffer, const void *pvTxData, size_t xDataLengthBytes, BaseType_t * const pxHigherPriorityTaskWoken );\r
 size_t MPU_xStreamBufferReceive( StreamBufferHandle_t xStreamBuffer, void *pvRxData, size_t xBufferLengthBytes, TickType_t xTicksToWait );\r
 size_t MPU_xStreamBufferNextMessageLengthBytes( StreamBufferHandle_t xStreamBuffer );\r
-size_t MPU_xStreamBufferReceiveFromISR( StreamBufferHandle_t xStreamBuffer, void *pvRxData, size_t xBufferLengthBytes, BaseType_t * const pxHigherPriorityTaskWoken );\r
 void MPU_vStreamBufferDelete( StreamBufferHandle_t xStreamBuffer );\r
 BaseType_t MPU_xStreamBufferIsFull( StreamBufferHandle_t xStreamBuffer );\r
 BaseType_t MPU_xStreamBufferIsEmpty( StreamBufferHandle_t xStreamBuffer );\r
index 04348c6149bc2a90db5028d7765e42e146fb4d5c..66e9a9fd125ca69f7f2fdfffdcf449a12a0628b2 100644 (file)
@@ -70,7 +70,6 @@ only for ports that are using the MPU. */
                #define uxTaskGetStackHighWaterMark2                    MPU_uxTaskGetStackHighWaterMark2\r
                #define vTaskSetApplicationTaskTag                              MPU_vTaskSetApplicationTaskTag\r
                #define xTaskGetApplicationTaskTag                              MPU_xTaskGetApplicationTaskTag\r
-               #define xTaskGetApplicationTaskTagFromISR               MPU_xTaskGetApplicationTaskTagFromISR\r
                #define vTaskSetThreadLocalStoragePointer               MPU_vTaskSetThreadLocalStoragePointer\r
                #define pvTaskGetThreadLocalStoragePointer              MPU_pvTaskGetThreadLocalStoragePointer\r
                #define xTaskCallApplicationTaskHook                    MPU_xTaskCallApplicationTaskHook\r
@@ -126,6 +125,7 @@ only for ports that are using the MPU. */
                #define xTimerGetTimerDaemonTaskHandle                  MPU_xTimerGetTimerDaemonTaskHandle\r
                #define xTimerPendFunctionCall                                  MPU_xTimerPendFunctionCall\r
                #define pcTimerGetName                                                  MPU_pcTimerGetName\r
+               #define vTimerSetReloadMode                                             MPU_vTimerSetReloadMode\r
                #define xTimerGetPeriod                                                 MPU_xTimerGetPeriod\r
                #define xTimerGetExpiryTime                                             MPU_xTimerGetExpiryTime\r
                #define xTimerGenericCommand                                    MPU_xTimerGenericCommand\r
@@ -142,10 +142,8 @@ only for ports that are using the MPU. */
                /* Map standard message/stream_buffer.h API functions to the MPU\r
                equivalents. */\r
                #define xStreamBufferSend                                               MPU_xStreamBufferSend\r
-               #define xStreamBufferSendFromISR                                MPU_xStreamBufferSendFromISR\r
                #define xStreamBufferReceive                                    MPU_xStreamBufferReceive\r
                #define xStreamBufferNextMessageLengthBytes             MPU_xStreamBufferNextMessageLengthBytes\r
-               #define xStreamBufferReceiveFromISR                             MPU_xStreamBufferReceiveFromISR\r
                #define vStreamBufferDelete                                             MPU_vStreamBufferDelete\r
                #define xStreamBufferIsFull                                             MPU_xStreamBufferIsFull\r
                #define xStreamBufferIsEmpty                                    MPU_xStreamBufferIsEmpty\r
index 3a44d49da4a572ed1205508e2b3998bd22801038..6d05b6a95f1e8cce04392249e4207277ad851b5f 100644 (file)
@@ -1231,6 +1231,23 @@ BaseType_t xTimerPendFunctionCall( PendedFunction_t xFunctionToPend, void *pvPar
  */\r
 const char * pcTimerGetName( TimerHandle_t xTimer ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */\r
 \r
+/**\r
+ * void vTimerSetReloadMode( TimerHandle_t xTimer, const UBaseType_t uxAutoReload );\r
+ *\r
+ * Updates a timer to be either an autoreload timer, in which case the timer\r
+ * automatically resets itself each time it expires, or a one shot timer, in\r
+ * which case the timer will only expire once unless it is manually restarted.\r
+ *\r
+ * @param xTimer The handle of the timer being updated.\r
+ *\r
+ * @param uxAutoReload If uxAutoReload is set to pdTRUE then the timer will\r
+ * expire repeatedly with a frequency set by the timer's period (see the\r
+ * xTimerPeriodInTicks parameter of the xTimerCreate() API function).  If\r
+ * uxAutoReload is set to pdFALSE then the timer will be a one-shot timer and\r
+ * enter the dormant state after it expires.\r
+ */\r
+void vTimerSetReloadMode( TimerHandle_t xTimer, const UBaseType_t uxAutoReload ) PRIVILEGED_FUNCTION;\r
+\r
 /**\r
  * TickType_t xTimerGetPeriod( TimerHandle_t xTimer );\r
  *\r
index ca490d6bfa20d94c2b8e945a130c88eee60ae430..0cb79c4c7246a7e21baf984f85b7c0bdc7aadcfe 100644 (file)
@@ -357,19 +357,6 @@ BaseType_t xRunningPrivileged = xPortRaisePrivilege();
 #endif\r
 /*-----------------------------------------------------------*/\r
 \r
-#if ( configUSE_APPLICATION_TASK_TAG == 1 )\r
-       TaskHookFunction_t MPU_xTaskGetApplicationTaskTagFromISR( TaskHandle_t xTask )\r
-       {\r
-       TaskHookFunction_t xReturn;\r
-       BaseType_t xRunningPrivileged = xPortRaisePrivilege();\r
-\r
-               xReturn = xTaskGetApplicationTaskTagFromISR( xTask );\r
-               vPortResetPrivilege( xRunningPrivileged );\r
-               return xReturn;\r
-       }\r
-#endif\r
-/*-----------------------------------------------------------*/\r
-\r
 #if ( configNUM_THREAD_LOCAL_STORAGE_POINTERS != 0 )\r
        void MPU_vTaskSetThreadLocalStoragePointer( TaskHandle_t xTaskToSet, BaseType_t xIndex, void *pvValue )\r
        {\r
@@ -647,17 +634,6 @@ BaseType_t xReturn;
 }\r
 /*-----------------------------------------------------------*/\r
 \r
-BaseType_t MPU_xQueuePeekFromISR( QueueHandle_t pxQueue, void * const pvBuffer )\r
-{\r
-BaseType_t xRunningPrivileged = xPortRaisePrivilege();\r
-BaseType_t xReturn;\r
-\r
-       xReturn = xQueuePeekFromISR( pxQueue, pvBuffer );\r
-       vPortResetPrivilege( xRunningPrivileged );\r
-       return xReturn;\r
-}\r
-/*-----------------------------------------------------------*/\r
-\r
 TaskHandle_t MPU_xQueueGetMutexHolder( QueueHandle_t xSemaphore )\r
 {\r
 BaseType_t xRunningPrivileged = xPortRaisePrivilege();\r
@@ -997,6 +973,17 @@ BaseType_t xRunningPrivileged = xPortRaisePrivilege();
 #endif\r
 /*-----------------------------------------------------------*/\r
 \r
+#if( configUSE_TIMERS == 1 )\r
+       void MPU_vTimerSetReloadMode( TimerHandle_t xTimer, const UBaseType_t uxAutoReload )\r
+       {\r
+       BaseType_t xRunningPrivileged = xPortRaisePrivilege();\r
+\r
+               vTimerSetReloadMode( xTimer, uxAutoReload );\r
+               vPortResetPrivilege( xRunningPrivileged );\r
+       }\r
+#endif\r
+/*-----------------------------------------------------------*/\r
+\r
 #if( configUSE_TIMERS == 1 )\r
        const char * MPU_pcTimerGetName( TimerHandle_t xTimer )\r
        {\r
@@ -1150,18 +1137,6 @@ BaseType_t xRunningPrivileged = xPortRaisePrivilege();
 }\r
 /*-----------------------------------------------------------*/\r
 \r
-size_t MPU_xStreamBufferSendFromISR( StreamBufferHandle_t xStreamBuffer, const void *pvTxData, size_t xDataLengthBytes, BaseType_t * const pxHigherPriorityTaskWoken )\r
-{\r
-size_t xReturn;\r
-BaseType_t xRunningPrivileged = xPortRaisePrivilege();\r
-\r
-       xReturn = xStreamBufferSendFromISR( xStreamBuffer, pvTxData, xDataLengthBytes, pxHigherPriorityTaskWoken );\r
-       vPortResetPrivilege( xRunningPrivileged );\r
-\r
-       return xReturn;\r
-}\r
-/*-----------------------------------------------------------*/\r
-\r
 size_t MPU_xStreamBufferNextMessageLengthBytes( StreamBufferHandle_t xStreamBuffer )\r
 {\r
 size_t xReturn;\r
@@ -1186,18 +1161,6 @@ BaseType_t xRunningPrivileged = xPortRaisePrivilege();
 }\r
 /*-----------------------------------------------------------*/\r
 \r
-size_t MPU_xStreamBufferReceiveFromISR( StreamBufferHandle_t xStreamBuffer, void *pvRxData, size_t xBufferLengthBytes, BaseType_t * const pxHigherPriorityTaskWoken )\r
-{\r
-size_t xReturn;\r
-BaseType_t xRunningPrivileged = xPortRaisePrivilege();\r
-\r
-       xReturn = xStreamBufferReceiveFromISR( xStreamBuffer, pvRxData, xBufferLengthBytes, pxHigherPriorityTaskWoken );\r
-       vPortResetPrivilege( xRunningPrivileged );\r
-\r
-       return xReturn;\r
-}\r
-/*-----------------------------------------------------------*/\r
-\r
 void MPU_vStreamBufferDelete( StreamBufferHandle_t xStreamBuffer )\r
 {\r
 BaseType_t xRunningPrivileged = xPortRaisePrivilege();\r
index a64565b4108a9fc8afe5ec5b90492c19f9623805..837fe3d14d1684faf3272dc268aa270a733ea530 100644 (file)
@@ -439,6 +439,26 @@ Timer_t *pxTimer = xTimer;
 }\r
 /*-----------------------------------------------------------*/\r
 \r
+void vTimerSetReloadMode( TimerHandle_t xTimer, const UBaseType_t uxAutoReload )\r
+{\r
+Timer_t * pxTimer =  xTimer;\r
+\r
+       configASSERT( xTimer );\r
+       taskENTER_CRITICAL();\r
+       {\r
+               if( uxAutoReload != pdFALSE )\r
+               {\r
+                       pxTimer->ucStatus |= tmrSTATUS_IS_AUTORELOAD;\r
+               }\r
+               else\r
+               {\r
+                       pxTimer->ucStatus &= ~tmrSTATUS_IS_AUTORELOAD;\r
+               }\r
+       }\r
+       taskEXIT_CRITICAL();\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
 TickType_t xTimerGetExpiryTime( TimerHandle_t xTimer )\r
 {\r
 Timer_t * pxTimer =  xTimer;\r