From 664434dfbac618d777306daa0719bf76992bcd43 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Sun, 14 Apr 2019 11:10:16 +0200 Subject: [PATCH] Fix: USART calls rx/tx --- armsrc/appmain.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/armsrc/appmain.c b/armsrc/appmain.c index fd0d4cafc..223bd2155 100644 --- a/armsrc/appmain.c +++ b/armsrc/appmain.c @@ -1136,7 +1136,7 @@ void UsbPacketReceived(uint8_t *packet, int len) { uint8_t my_rx[sizeof(UsbCommand)]; while (!BUTTON_PRESS() && !usb_poll_validate_length()) { LED_B_INV(); - if (usart_readbuffer(my_rx, sizeof(UsbCommand)) ) { + if (usart_readbuffer(my_rx) ) { //UsbPacketReceived(my_rx, sizeof(my_rx)); UsbCommand *my = (UsbCommand *)my_rx; @@ -1565,10 +1565,11 @@ void __attribute__((noreturn)) AppMain(void) { } #ifdef WITH_FPC_HOST // Check if there is a FPC packet available - if (usart_readcommand(rx) > 0) { + if (usart_readbuffer(rx)) { reply_via_fpc = 1; UsbPacketReceived(rx, sizeof(rx)); } + usart_readcheck(rx, sizeof(rx)); #endif // Press button for one second to enter a possible standalone mode