From 57273d04d4929a7d921a63a8c555dfd674fdba0d Mon Sep 17 00:00:00 2001 From: Oskar Weigl Date: Sat, 23 Sep 2017 21:10:48 -0700 Subject: [PATCH] add ! as alternative end char, do parsing --- Src/freertos.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Src/freertos.c b/Src/freertos.c index 41094c23..630b5a2c 100644 --- a/Src/freertos.c +++ b/Src/freertos.c @@ -189,10 +189,10 @@ void usb_cmd_thread(void const * argument) { // Record into parse buffer when actively reading if (read_active) { parse_buffer[parse_buffer_idx++] = c; - if (c == '\r' || c == '\n') { + if (c == '\r' || c == '\n' || c == "!") { // End of command string: exchange end char with terminating null parse_buffer[parse_buffer_idx-1] = '\0'; - osDelay(1); + motor_parse_cmd(parse_buffer, parse_buffer_idx); // Reset receieve state machine reset_read_state = true; break;