From e886490a2de55e47b074a43c67293e896bd72a4a Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Tue, 10 Oct 2017 14:04:20 +0200 Subject: [PATCH] CHG: from normal poll, to the length validating one. --- bootrom/bootrom.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bootrom/bootrom.c b/bootrom/bootrom.c index 94327b0ad..fe893e319 100644 --- a/bootrom/bootrom.c +++ b/bootrom/bootrom.c @@ -88,7 +88,7 @@ void UsbPacketReceived(uint8_t *packet, int len) { UsbCommand* c = (UsbCommand *)packet; volatile uint32_t *p; - if(len != sizeof(UsbCommand)) Fatal(); + if ( len != sizeof(UsbCommand)) Fatal(); uint32_t arg0 = (uint32_t)c->arg[0]; @@ -199,7 +199,7 @@ static void flash_mode(int externally_entered) { for(;;) { WDT_HIT(); - if (usb_poll()) { + if ( usb_poll_validate_length()) { rx_len = usb_read(rx, sizeof(UsbCommand)); if (rx_len) UsbPacketReceived(rx, rx_len);