modify USB communications

* use different data types for commands and responses
* use variable length responses
* maintain client/flasher compatibility with old format (e.g. when using old bootloader)
* maintain bootloader compatibility with old format (e.g. when using old or RRG flasher.exe)
* fix length of version string in appmain.c
This commit is contained in:
pwpiwi 2020-01-12 17:29:07 +01:00
commit b8ed9975e5
11 changed files with 133 additions and 64 deletions

View file

@ -45,6 +45,7 @@ extern void usb_enable();
extern bool usb_poll();
extern bool usb_poll_validate_length();
extern bool cmd_receive(UsbCommand* cmd);
extern bool cmd_send(uint32_t cmd, uint32_t arg0, uint32_t arg1, uint32_t arg2, void* data, size_t len);
extern bool cmd_send(uint16_t cmd, uint32_t arg0, uint32_t arg1, uint32_t arg2, void* data, uint16_t datalen); // new variable sized response
extern bool cmd_send_old(uint16_t cmd, uint32_t arg0, uint32_t arg1, uint32_t arg2, void* data, uint16_t datalen); // old fixed size response
#endif // USB_CDC_H__