Fix: USART calls rx/tx

This commit is contained in:
iceman1001 2019-04-14 11:10:16 +02:00
parent dd404a67a1
commit 664434dfba

View file

@ -1136,7 +1136,7 @@ void UsbPacketReceived(uint8_t *packet, int len) {
uint8_t my_rx[sizeof(UsbCommand)]; uint8_t my_rx[sizeof(UsbCommand)];
while (!BUTTON_PRESS() && !usb_poll_validate_length()) { while (!BUTTON_PRESS() && !usb_poll_validate_length()) {
LED_B_INV(); LED_B_INV();
if (usart_readbuffer(my_rx, sizeof(UsbCommand)) ) { if (usart_readbuffer(my_rx) ) {
//UsbPacketReceived(my_rx, sizeof(my_rx)); //UsbPacketReceived(my_rx, sizeof(my_rx));
UsbCommand *my = (UsbCommand *)my_rx; UsbCommand *my = (UsbCommand *)my_rx;
@ -1565,10 +1565,11 @@ void __attribute__((noreturn)) AppMain(void) {
} }
#ifdef WITH_FPC_HOST #ifdef WITH_FPC_HOST
// Check if there is a FPC packet available // Check if there is a FPC packet available
if (usart_readcommand(rx) > 0) { if (usart_readbuffer(rx)) {
reply_via_fpc = 1; reply_via_fpc = 1;
UsbPacketReceived(rx, sizeof(rx)); UsbPacketReceived(rx, sizeof(rx));
} }
usart_readcheck(rx, sizeof(rx));
#endif #endif
// Press button for one second to enter a possible standalone mode // Press button for one second to enter a possible standalone mode