From 970fda699da63085d7a5ddb0ba51e6752b0c377c Mon Sep 17 00:00:00 2001 From: Jonas Arnold Date: Fri, 25 Nov 2022 15:57:08 +0100 Subject: [PATCH] tried Remote (parse commands from ESP on Robo) does not work yet --- ADIS_Sumo_Styger/Sumo/Remote.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/ADIS_Sumo_Styger/Sumo/Remote.c b/ADIS_Sumo_Styger/Sumo/Remote.c index 0c34ff8..7b806fe 100644 --- a/ADIS_Sumo_Styger/Sumo/Remote.c +++ b/ADIS_Sumo_Styger/Sumo/Remote.c @@ -52,8 +52,17 @@ static void RemoteTask(void *pv) { } #endif for(;;) { - res = xQueueReceive(REMOTE_RxFromESP_Queue, &ch, portMAX_DELAY); /* make sure we empty the queue */ - /*! \todo ADIS: implement handling remote stream from ESP **/ + res = xQueueReceive(REMOTE_RxFromESP_Queue, &ch, pdMS_TO_TICKS(10)); /* wait max 10 ms */ + if (res==errQUEUE_EMPTY) { + ch = '\0'; /* nothing received */ + } + else if(res == pdPASS) { + /* something was received */ + /* handle remote stream from ESP */ + if(ch == '@'){ + BUZ_Beep(200, 500); + } + } } }