From ef9ce28ba1790085d0e92d0a62b06e540b0afb57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Sim=C3=B5es?= Date: Wed, 1 Nov 2017 11:46:33 +0000 Subject: [PATCH] Improvements in Wire Protocol responsivness MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Adjust timeouts and delays Signed-off-by: José Simões --- targets/CMSIS-OS/ChibiOS/common/WireProtocol_HAL_Interface.c | 4 ++-- targets/CMSIS-OS/ChibiOS/common/WireProtocol_ReceiverThread.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/targets/CMSIS-OS/ChibiOS/common/WireProtocol_HAL_Interface.c b/targets/CMSIS-OS/ChibiOS/common/WireProtocol_HAL_Interface.c index c4d29d3f9c..3560a2daf2 100644 --- a/targets/CMSIS-OS/ChibiOS/common/WireProtocol_HAL_Interface.c +++ b/targets/CMSIS-OS/ChibiOS/common/WireProtocol_HAL_Interface.c @@ -51,7 +51,7 @@ bool WP_ReceiveBytes(uint8_t* ptr, uint16_t* size) if(semaphoreResult == MSG_OK) { // read from serial stream - volatile size_t read = chnReadTimeout(&SDU1, ptr, *size, MS2ST(100)); + volatile size_t read = chnReadTimeout(&SDU1, ptr, *size, MS2ST(250)); ptr += read; *size -= read; @@ -95,7 +95,7 @@ bool WP_ReceiveBytes(uint8_t* ptr, uint16_t* size) { // non blocking read from serial port with 100ms timeout - volatile size_t read = sdReadTimeout(&SD2, ptr, *size, MS2ST(100)); + volatile size_t read = sdReadTimeout(&SD2, ptr, *size, MS2ST(250)); ptr += read; *size -= read; diff --git a/targets/CMSIS-OS/ChibiOS/common/WireProtocol_ReceiverThread.c b/targets/CMSIS-OS/ChibiOS/common/WireProtocol_ReceiverThread.c index 0da6def09f..8520ed9a50 100644 --- a/targets/CMSIS-OS/ChibiOS/common/WireProtocol_ReceiverThread.c +++ b/targets/CMSIS-OS/ChibiOS/common/WireProtocol_ReceiverThread.c @@ -32,7 +32,7 @@ void ReceiverThread(void const * argument) WP_Message_Process(&inboundMessage); // delay here to give other threads a chance to run - osDelay(500); + osDelay(100); } // nothing to deinitialize or cleanup, so it's safe to return