From 267fcc5c386ff09413e6a089e61e98d761ebc3ec Mon Sep 17 00:00:00 2001 From: rtel Date: Mon, 5 Oct 2015 15:23:09 +0000 Subject: [PATCH] Demo tasks: - Complete the demo projects for the RX113 using IAR, GCC and Renesas compilers by including a basic UART CLI. Standard demo tasks: - Add some volatile qualifiers to variables in IntQueue.c. git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@2384 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- FreeRTOS/Demo/Common/Minimal/IntQueue.c | 5 +- FreeRTOS/Demo/Common/Minimal/recmutex.c | 17 +- .../.HardwareDebuglinker | 6 +- .../.cproject | 114 ++++- .../RX100_RX113-RSK_GCC_e2studio_IAR/.project | 126 ++++- .../.settings/language.settings.xml | 2 +- .../RTOSDemo HardwareDebug.launch | 4 +- .../RTOSDemo.ewd | 2 +- .../RTOSDemo.ewp | 25 +- .../settings/RTOSDemo.dbgdt | 34 +- .../settings/RTOSDemo.dni | 234 +++++----- .../settings/RTOSDemo.wsdt | 6 +- .../src/Blinky_Demo/main_blinky.c | 22 +- .../src/FreeRTOSConfig.h | 50 +- .../src/Full_Demo/IntQueueTimer.c | 6 +- .../src/Full_Demo/main_full.c | 83 ++-- .../src/Renesas_Code/r_rsk_async.c | 112 ----- .../src/Renesas_Code/r_rsk_async.h | 50 -- .../src/Renesas_Code/vector_table.c | 12 +- .../src/cg_src/r_cg_macrodriver.h | 1 + .../src/cg_src/r_cg_sbrk.c | 86 ---- .../src/cg_src/r_cg_sbrk.h | 48 -- .../src/cg_src/r_cg_sci.h | 6 +- .../src/cg_src/r_cg_sci_user_GCC.c | 364 +++++++++++++++ .../{r_cg_sci_user.c => r_cg_sci_user_IAR.c} | 199 ++++++-- .../src/main.c | 9 +- .../.cproject | 14 +- .../RX100_RX113-RSK_Renesas_e2studio/.project | 79 +++- .../src/Blinky_Demo/main_blinky.c | 22 +- .../src/FreeRTOSConfig.h | 40 +- .../src/Full_Demo/main_full.c | 72 +-- .../src/Renesas_Code/r_rsk_async.c | 112 ----- .../src/Renesas_Code/r_rsk_async.h | 50 -- .../src/cg_src/r_cg_sci.h | 8 +- .../src/cg_src/r_cg_sci_user.c | 175 +++++-- .../src/main.c | 21 +- .../DemosModifiedForLowTickRate/recmutex.c | 429 ------------------ FreeRTOS/Demo/WIN32-MSVC/WIN32.vcxproj | 2 +- .../Demo/WIN32-MSVC/WIN32.vcxproj.filters | 9 +- FreeRTOS/Source/portable/IAR/RX100/port.c | 1 - .../Source/portable/Renesas/RX100/portmacro.h | 4 +- 41 files changed, 1305 insertions(+), 1356 deletions(-) delete mode 100644 FreeRTOS/Demo/RX100_RX113-RSK_GCC_e2studio_IAR/src/Renesas_Code/r_rsk_async.c delete mode 100644 FreeRTOS/Demo/RX100_RX113-RSK_GCC_e2studio_IAR/src/Renesas_Code/r_rsk_async.h delete mode 100644 FreeRTOS/Demo/RX100_RX113-RSK_GCC_e2studio_IAR/src/cg_src/r_cg_sbrk.c delete mode 100644 FreeRTOS/Demo/RX100_RX113-RSK_GCC_e2studio_IAR/src/cg_src/r_cg_sbrk.h create mode 100644 FreeRTOS/Demo/RX100_RX113-RSK_GCC_e2studio_IAR/src/cg_src/r_cg_sci_user_GCC.c rename FreeRTOS/Demo/RX100_RX113-RSK_GCC_e2studio_IAR/src/cg_src/{r_cg_sci_user.c => r_cg_sci_user_IAR.c} (58%) delete mode 100644 FreeRTOS/Demo/RX100_RX113-RSK_Renesas_e2studio/src/Renesas_Code/r_rsk_async.c delete mode 100644 FreeRTOS/Demo/RX100_RX113-RSK_Renesas_e2studio/src/Renesas_Code/r_rsk_async.h delete mode 100644 FreeRTOS/Demo/WIN32-MSVC/DemosModifiedForLowTickRate/recmutex.c diff --git a/FreeRTOS/Demo/Common/Minimal/IntQueue.c b/FreeRTOS/Demo/Common/Minimal/IntQueue.c index 4a68d85ad..e97eaed6d 100644 --- a/FreeRTOS/Demo/Common/Minimal/IntQueue.c +++ b/FreeRTOS/Demo/Common/Minimal/IntQueue.c @@ -195,7 +195,7 @@ an interrupt. */ static QueueHandle_t xNormallyEmptyQueue, xNormallyFullQueue; /* Variables used to detect a stall in one of the tasks. */ -static UBaseType_t uxHighPriorityLoops1 = 0, uxHighPriorityLoops2 = 0, uxLowPriorityLoops1 = 0, uxLowPriorityLoops2 = 0; +static volatile UBaseType_t uxHighPriorityLoops1 = 0, uxHighPriorityLoops2 = 0, uxLowPriorityLoops1 = 0, uxLowPriorityLoops2 = 0; /* Any unexpected behaviour sets xErrorStatus to fail and log the line that caused the error in xErrorLine. */ @@ -207,7 +207,7 @@ static BaseType_t xWasSuspended = pdFALSE; /* The values that are sent to the queues. An incremented value is sent each time to each queue. */ -volatile UBaseType_t uxValueForNormallyEmptyQueue = 0, uxValueForNormallyFullQueue = 0; +static volatile UBaseType_t uxValueForNormallyEmptyQueue = 0, uxValueForNormallyFullQueue = 0; /* A handle to some of the tasks is required so they can be suspended/resumed. */ TaskHandle_t xHighPriorityNormallyEmptyTask1, xHighPriorityNormallyEmptyTask2, xHighPriorityNormallyFullTask1, xHighPriorityNormallyFullTask2; @@ -718,7 +718,6 @@ static UBaseType_t uxNextOperation = 0; timerNORMALLY_FULL_TX(); timerNORMALLY_FULL_TX(); timerNORMALLY_FULL_TX(); - timerNORMALLY_FULL_TX(); } return xHigherPriorityTaskWoken; diff --git a/FreeRTOS/Demo/Common/Minimal/recmutex.c b/FreeRTOS/Demo/Common/Minimal/recmutex.c index f59d360d3..f36e0b928 100644 --- a/FreeRTOS/Demo/Common/Minimal/recmutex.c +++ b/FreeRTOS/Demo/Common/Minimal/recmutex.c @@ -123,7 +123,7 @@ be overridden by a definition in FreeRTOSConfig.h. */ #define recmuMAX_COUNT ( 10 ) /* Misc. */ -#define recmuSHORT_DELAY ( 20 / portTICK_PERIOD_MS ) +#define recmuSHORT_DELAY ( pdMS_TO_TICKS( 20 ) ) #define recmuNO_DELAY ( ( TickType_t ) 0 ) #define recmuEIGHT_TICK_DELAY ( ( TickType_t ) 8 ) @@ -227,6 +227,10 @@ UBaseType_t ux; { xErrorOccurred = pdTRUE; } + + #if( configUSE_PREEMPTION == 0 ) + taskYIELD(); + #endif } /* Having given it back the same number of times as it was taken, we @@ -344,7 +348,14 @@ static void prvRecursiveMutexPollingTask( void *pvParameters ) error will be latched if the polling task has not returned the mutex by the time this fixed period has expired. */ vTaskResume( xBlockingTaskHandle ); - vTaskResume( xControllingTaskHandle ); + #if( configUSE_PREEMPTION == 0 ) + taskYIELD(); + #endif + + vTaskResume( xControllingTaskHandle ); + #if( configUSE_PREEMPTION == 0 ) + taskYIELD(); + #endif /* The other two tasks should now have executed and no longer be suspended. */ @@ -433,7 +444,7 @@ static UBaseType_t uxLastControllingCycles = 0, uxLastBlockingCycles = 0, uxLast } else { - xReturn = pdTRUE; + xReturn = pdPASS; } return xReturn; diff --git a/FreeRTOS/Demo/RX100_RX113-RSK_GCC_e2studio_IAR/.HardwareDebuglinker b/FreeRTOS/Demo/RX100_RX113-RSK_GCC_e2studio_IAR/.HardwareDebuglinker index 8f67047ba..cc70f7a08 100644 --- a/FreeRTOS/Demo/RX100_RX113-RSK_GCC_e2studio_IAR/.HardwareDebuglinker +++ b/FreeRTOS/Demo/RX100_RX113-RSK_GCC_e2studio_IAR/.HardwareDebuglinker @@ -87,7 +87,7 @@ - + @@ -114,11 +114,11 @@ - + - + diff --git a/FreeRTOS/Demo/RX100_RX113-RSK_GCC_e2studio_IAR/.cproject b/FreeRTOS/Demo/RX100_RX113-RSK_GCC_e2studio_IAR/.cproject index 29d7efc14..34ae58d0e 100644 --- a/FreeRTOS/Demo/RX100_RX113-RSK_GCC_e2studio_IAR/.cproject +++ b/FreeRTOS/Demo/RX100_RX113-RSK_GCC_e2studio_IAR/.cproject @@ -49,6 +49,7 @@