From f5077dedf9fc77a84a463e79fb2cddd2e9cd0ae6 Mon Sep 17 00:00:00 2001 From: richardbarry Date: Sun, 23 Sep 2012 09:35:53 +0000 Subject: [PATCH] Add eTaskStateGet() to FreeRTOS-MPU. git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@1780 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- FreeRTOS/Source/include/mpu_wrappers.h | 1 + FreeRTOS/Source/portable/GCC/ARM_CM3_MPU/port.c | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/FreeRTOS/Source/include/mpu_wrappers.h b/FreeRTOS/Source/include/mpu_wrappers.h index be49c3d88..5836047ed 100644 --- a/FreeRTOS/Source/include/mpu_wrappers.h +++ b/FreeRTOS/Source/include/mpu_wrappers.h @@ -83,6 +83,7 @@ only for ports that are using the MPU. */ #define vTaskDelay MPU_vTaskDelay #define uxTaskPriorityGet MPU_uxTaskPriorityGet #define vTaskPrioritySet MPU_vTaskPrioritySet + #define eTaskStateGet MPU_eTaskStateGet #define vTaskSuspend MPU_vTaskSuspend #define xTaskIsTaskSuspended MPU_xTaskIsTaskSuspended #define vTaskResume MPU_vTaskResume diff --git a/FreeRTOS/Source/portable/GCC/ARM_CM3_MPU/port.c b/FreeRTOS/Source/portable/GCC/ARM_CM3_MPU/port.c index 6bd015985..d2cbbeacc 100644 --- a/FreeRTOS/Source/portable/GCC/ARM_CM3_MPU/port.c +++ b/FreeRTOS/Source/portable/GCC/ARM_CM3_MPU/port.c @@ -178,6 +178,7 @@ void MPU_vTaskDelayUntil( portTickType * const pxPreviousWakeTime, portTickType void MPU_vTaskDelay( portTickType xTicksToDelay ); unsigned portBASE_TYPE MPU_uxTaskPriorityGet( xTaskHandle pxTask ); void MPU_vTaskPrioritySet( xTaskHandle pxTask, unsigned portBASE_TYPE uxNewPriority ); +eTaskState MPU_eTaskStateGet( xTaskHandle pxTask ); void MPU_vTaskSuspend( xTaskHandle pxTaskToSuspend ); signed portBASE_TYPE MPU_xTaskIsTaskSuspended( xTaskHandle xTask ); void MPU_vTaskResume( xTaskHandle pxTaskToResume ); @@ -733,6 +734,19 @@ portBASE_TYPE xRunningPrivileged = prvRaisePrivilege(); #endif /*-----------------------------------------------------------*/ +#if ( INCLUDE_eTaskStateGet == 1 ) + eTaskState MPU_eTaskStateGet( xTaskHandle pxTask ) + { + portBASE_TYPE xRunningPrivileged = prvRaisePrivilege(); + eTaskState eReturn; + + eReturn = eTaskStateGet( pxTask ); + portRESET_PRIVILEGE( xRunningPrivileged ); + return eReturn; + } +#endif +/*-----------------------------------------------------------*/ + #if ( INCLUDE_vTaskSuspend == 1 ) void MPU_vTaskSuspend( xTaskHandle pxTaskToSuspend ) { -- 2.39.5