chg: validating we got a full usbcommand (512b)

This commit is contained in:
iceman1001 2017-10-11 12:48:04 +02:00
commit 1cca109429
2 changed files with 18 additions and 9 deletions

View file

@ -38,7 +38,7 @@ bool cmd_receive(UsbCommand* cmd) {
if (!usb_poll_validate_length()) return false;
// Try to retrieve the available command frame
size_t rxlen = usb_read((byte_t*)cmd,sizeof(UsbCommand));
size_t rxlen = usb_read((byte_t*)cmd, sizeof(UsbCommand));
// Check if the transfer was complete
if (rxlen != sizeof(UsbCommand)) return false;