CHG: appmain now calls cmd_recieve as it should

CHG: flasher -  removed unneeded parameter to function
CHG: flasher - increased limit to fpga-files that can be loaded
FIX: main client,  wrong windows define fixed.
CHG: device side - recieve usb command does not always get 544 bytes.  usb packages can be incomplete.
CHG: usb_cdc.c also got piwi's changes.
CHG: uart_posix.c removed a debug value
CHG: uart_win32.c clean up.
This commit is contained in:
iceman1001 2017-10-17 20:58:17 +02:00
commit 16028f7d33
9 changed files with 279 additions and 252 deletions

View file

@ -1161,20 +1161,12 @@ void __attribute__((noreturn)) AppMain(void) {
#endif
byte_t rx[sizeof(UsbCommand)];
size_t rx_len = 0;
for(;;) {
// Check if there is a usb packet available
if ( usb_poll_validate_length() ) {
// Try to retrieve the available command frame
rx_len = usb_read(rx, sizeof(UsbCommand));
// Check if the transfer was complete
if (rx_len == sizeof(UsbCommand))
UsbPacketReceived(rx, rx_len);
}
if ( cmd_receive( (UsbCommand*)rx ) )
UsbPacketReceived(rx, sizeof(UsbCommand) );
WDT_HIT();