From 59098b3d6271d8c19476283b4d7d4949383b3785 Mon Sep 17 00:00:00 2001 From: rtel Date: Tue, 28 Jan 2014 12:32:03 +0000 Subject: [PATCH] vQueueAddToRegistry() now takes a const char * instead of a char *. tmrCOMMAND_CHANGE_PERIOD_FROM_ISR constant added for the "FromISR" version of the software timer change period API function. git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@2183 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- FreeRTOS/Source/include/queue.h | 2 +- FreeRTOS/Source/include/timers.h | 13 +++++++------ FreeRTOS/Source/portable/GCC/ARM_CA9/port.c | 12 ++++++++---- FreeRTOS/Source/queue.c | 4 ++-- FreeRTOS/Source/timers.c | 1 + 5 files changed, 19 insertions(+), 13 deletions(-) diff --git a/FreeRTOS/Source/include/queue.h b/FreeRTOS/Source/include/queue.h index 8a83ef258..d559e2dca 100644 --- a/FreeRTOS/Source/include/queue.h +++ b/FreeRTOS/Source/include/queue.h @@ -1514,7 +1514,7 @@ BaseType_t xQueueGiveMutexRecursive( QueueHandle_t pxMutex ) PRIVILEGED_FUNCTION * preferably in ROM/Flash), not on the stack. */ #if configQUEUE_REGISTRY_SIZE > 0 - void vQueueAddToRegistry( QueueHandle_t xQueue, char *pcName ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */ + void vQueueAddToRegistry( QueueHandle_t xQueue, const char *pcName ) PRIVILEGED_FUNCTION; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */ #endif /* diff --git a/FreeRTOS/Source/include/timers.h b/FreeRTOS/Source/include/timers.h index b25144eb0..3faf36d6e 100644 --- a/FreeRTOS/Source/include/timers.h +++ b/FreeRTOS/Source/include/timers.h @@ -102,6 +102,7 @@ or interrupt version of the queue send function should be used. */ #define tmrCOMMAND_START_FROM_ISR ( ( BaseType_t ) 6 ) #define tmrCOMMAND_RESET_FROM_ISR ( ( BaseType_t ) 7 ) #define tmrCOMMAND_STOP_FROM_ISR ( ( BaseType_t ) 8 ) +#define tmrCOMMAND_CHANGE_PERIOD_FROM_ISR ( ( BaseType_t ) 9 ) /** @@ -662,7 +663,7 @@ TaskHandle_t xTimerGetTimerDaemonTaskHandle( void ); /** * BaseType_t xTimerStartFromISR( TimerHandle_t xTimer, - * BaseType_t *pxHigherPriorityTaskWoken ); + * BaseType_t *pxHigherPriorityTaskWoken ); * * A version of xTimerStart() that can be called from an interrupt service * routine. @@ -748,7 +749,7 @@ TaskHandle_t xTimerGetTimerDaemonTaskHandle( void ); /** * BaseType_t xTimerStopFromISR( TimerHandle_t xTimer, - * BaseType_t *pxHigherPriorityTaskWoken ); + * BaseType_t *pxHigherPriorityTaskWoken ); * * A version of xTimerStop() that can be called from an interrupt service * routine. @@ -811,8 +812,8 @@ TaskHandle_t xTimerGetTimerDaemonTaskHandle( void ); /** * BaseType_t xTimerChangePeriodFromISR( TimerHandle_t xTimer, - * TickType_t xNewPeriod, - * BaseType_t *pxHigherPriorityTaskWoken ); + * TickType_t xNewPeriod, + * BaseType_t *pxHigherPriorityTaskWoken ); * * A version of xTimerChangePeriod() that can be called from an interrupt * service routine. @@ -880,11 +881,11 @@ TaskHandle_t xTimerGetTimerDaemonTaskHandle( void ); * } * @endverbatim */ -#define xTimerChangePeriodFromISR( xTimer, xNewPeriod, pxHigherPriorityTaskWoken ) xTimerGenericCommand( ( xTimer ), tmrCOMMAND_CHANGE_PERIOD, ( xNewPeriod ), ( pxHigherPriorityTaskWoken ), 0U ) +#define xTimerChangePeriodFromISR( xTimer, xNewPeriod, pxHigherPriorityTaskWoken ) xTimerGenericCommand( ( xTimer ), tmrCOMMAND_CHANGE_PERIOD_FROM_ISR, ( xNewPeriod ), ( pxHigherPriorityTaskWoken ), 0U ) /** * BaseType_t xTimerResetFromISR( TimerHandle_t xTimer, - * BaseType_t *pxHigherPriorityTaskWoken ); + * BaseType_t *pxHigherPriorityTaskWoken ); * * A version of xTimerReset() that can be called from an interrupt service * routine. diff --git a/FreeRTOS/Source/portable/GCC/ARM_CA9/port.c b/FreeRTOS/Source/portable/GCC/ARM_CA9/port.c index 30eb3be11..023c269d3 100644 --- a/FreeRTOS/Source/portable/GCC/ARM_CA9/port.c +++ b/FreeRTOS/Source/portable/GCC/ARM_CA9/port.c @@ -352,12 +352,16 @@ uint32_t ulAPSR; if( ( portICCBPR_BINARY_POINT_REGISTER & portBINARY_POINT_BITS ) <= portMAX_BINARY_POINT_VALUE ) { - /* Start the timer that generates the tick ISR. Interrupts are - turned off in the CPU itself to ensure the tick does not execute - while the scheduler is being started. Interrupts are automatically - turned back on in the CPU when the first task starts executing. */ + /* Interrupts are turned off in the CPU itself to ensure tick does + not execute while the scheduler is being started. Interrupts are + automatically turned back on in the CPU when the first task starts + executing. */ portCPU_IRQ_DISABLE(); + + /* Start the timer that generates the tick ISR. */ configSETUP_TICK_INTERRUPT(); + + /* Start the first task executing. */ vPortRestoreTaskContext(); } } diff --git a/FreeRTOS/Source/queue.c b/FreeRTOS/Source/queue.c index 3fb1b6ce5..61f907852 100644 --- a/FreeRTOS/Source/queue.c +++ b/FreeRTOS/Source/queue.c @@ -167,7 +167,7 @@ typedef struct QueueDefinition more user friendly. */ typedef struct QUEUE_REGISTRY_ITEM { - char *pcQueueName; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */ + const char *pcQueueName; /*lint !e971 Unqualified char types are allowed for strings and single characters only. */ QueueHandle_t xHandle; } QueueRegistryItem_t; @@ -2143,7 +2143,7 @@ BaseType_t xReturn; #if ( configQUEUE_REGISTRY_SIZE > 0 ) - void vQueueAddToRegistry( QueueHandle_t xQueue, char *pcQueueName ) /*lint !e971 Unqualified char types are allowed for strings and single characters only. */ + void vQueueAddToRegistry( QueueHandle_t xQueue, const char *pcQueueName ) /*lint !e971 Unqualified char types are allowed for strings and single characters only. */ { UBaseType_t ux; diff --git a/FreeRTOS/Source/timers.c b/FreeRTOS/Source/timers.c index 8f6747a89..c3cddd0e7 100644 --- a/FreeRTOS/Source/timers.c +++ b/FreeRTOS/Source/timers.c @@ -664,6 +664,7 @@ TickType_t xTimeNow; break; case tmrCOMMAND_CHANGE_PERIOD : + case tmrCOMMAND_CHANGE_PERIOD_FROM_ISR : pxTimer->xTimerPeriodInTicks = xMessage.u.xTimerParameters.xMessageValue; configASSERT( ( pxTimer->xTimerPeriodInTicks > 0 ) ); -- 2.39.5