From acdc0aa40fc02b56593c13e4b8bd48f880d48cca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Tue, 5 Jun 2018 10:00:26 +0100 Subject: [PATCH] Change OS Task priority for ReceiverThread MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Having the same priority as the CLR makes the USB communication smoother and allows the debugger to connect - Remove the PLATFORM_WAIT hack from MonitorReboot command - Remove PLATFORM_WAIT from targetHAL on all platforms Signed-off-by: José Simões --- src/CLR/Debugger/Debugger.cpp | 4 ---- src/HAL/Include/nanoHAL.h | 2 -- targets/CMSIS-OS/ChibiOS/Include/targetHAL.h | 4 +--- targets/FreeRTOS/ESP32_DevKitC/Include/targetHAL.h | 5 +---- targets/FreeRTOS/ESP32_DevKitC/nanoCLR/app_main.c | 2 +- 5 files changed, 3 insertions(+), 14 deletions(-) diff --git a/src/CLR/Debugger/Debugger.cpp b/src/CLR/Debugger/Debugger.cpp index 5dcc46aac9..cca03a3f61 100644 --- a/src/CLR/Debugger/Debugger.cpp +++ b/src/CLR/Debugger/Debugger.cpp @@ -815,10 +815,6 @@ bool CLR_DBG_Debugger::Monitor_Reboot( WP_Message* msg) WP_ReplyToCommand(msg, true, false, NULL, 0); - // Allow some time for CLR to Reboot - // FIXME find a better way to syncronise the reboot with clr - PLATFORM_WAIT( 1000 ); - return true; } diff --git a/src/HAL/Include/nanoHAL.h b/src/HAL/Include/nanoHAL.h index 6dd90aa3f9..5f3a32042b 100644 --- a/src/HAL/Include/nanoHAL.h +++ b/src/HAL/Include/nanoHAL.h @@ -1832,8 +1832,6 @@ bool Watchdog_GetSetEnabled ( bool enabled, bool fSet ); //#define GLOBAL_LOCK_SOCKETS(x) // UNDONE: FIXME: SmartPtr_IRQ x #define GLOBAL_UNLOCK(x) -#define PLATFORM_WAIT(milliSecs) - #if defined(_DEBUG) #define ASSERT_IRQ_MUST_BE_OFF() ASSERT( HAL_Windows_HasGlobalLock()) #define ASSERT_IRQ_MUST_BE_ON() ASSERT(!HAL_Windows_HasGlobalLock()) diff --git a/targets/CMSIS-OS/ChibiOS/Include/targetHAL.h b/targets/CMSIS-OS/ChibiOS/Include/targetHAL.h index b8ba6831e1..2f410373c2 100644 --- a/targets/CMSIS-OS/ChibiOS/Include/targetHAL.h +++ b/targets/CMSIS-OS/ChibiOS/Include/targetHAL.h @@ -13,9 +13,7 @@ #define GLOBAL_UNLOCK(x); chSysUnlock(); #define ASSERT_IRQ_MUST_BE_OFF() // TODO need to determine if this needs implementation -#define PLATFORM_WAIT(milliSecs) osDelay(milliSecs); - -// Defininitions for Sockets/Network +// Definitions for Sockets/Network #define GLOBAL_LOCK_SOCKETS(x) #define SOCKETS_MAX_COUNT 16 #define LPCSTR const uint8_t* diff --git a/targets/FreeRTOS/ESP32_DevKitC/Include/targetHAL.h b/targets/FreeRTOS/ESP32_DevKitC/Include/targetHAL.h index 6a28fcd11f..08aa8aabc5 100644 --- a/targets/FreeRTOS/ESP32_DevKitC/Include/targetHAL.h +++ b/targets/FreeRTOS/ESP32_DevKitC/Include/targetHAL.h @@ -15,10 +15,7 @@ extern portMUX_TYPE globalLockMutex; #define GLOBAL_UNLOCK(x) taskEXIT_CRITICAL(&globalLockMutex); #define ASSERT_IRQ_MUST_BE_OFF() // TODO need to determine if this needs implementation - -#define PLATFORM_WAIT(milliSecs) vTaskDelay(milliSecs/portTICK_PERIOD_MS); - -// Defininitions for Sockets/Network +// Definitions for Sockets/Network #define GLOBAL_LOCK_SOCKETS(x) #define SOCKETS_MAX_COUNT 16 #define LPCSTR const uint8_t* diff --git a/targets/FreeRTOS/ESP32_DevKitC/nanoCLR/app_main.c b/targets/FreeRTOS/ESP32_DevKitC/nanoCLR/app_main.c index 03741f888b..2e7b3c2701 100644 --- a/targets/FreeRTOS/ESP32_DevKitC/nanoCLR/app_main.c +++ b/targets/FreeRTOS/ESP32_DevKitC/nanoCLR/app_main.c @@ -55,7 +55,7 @@ void app_main() Esp32FlashDriver_InitializeDevice(0); - xTaskCreatePinnedToCore(&receiver_task, "ReceiverThread", 2048, NULL, 6, NULL, 1); + xTaskCreatePinnedToCore(&receiver_task, "ReceiverThread", 2048, NULL, 5, NULL, 1); // Start the main task pinned to 2nd core xTaskCreatePinnedToCore(&main_task, "main_task", 15000, NULL, 5, NULL, 1);