Explicitly cast FetchNextCommandByte to u32 to ensure correct handling
authorPaul R <exp@users.noreply.github.com>
Mon, 22 Mar 2021 12:19:25 +0000 (12:19 +0000)
committerPaul R <exp@users.noreply.github.com>
Mon, 22 Mar 2021 12:19:25 +0000 (12:19 +0000)
commit3cc3335a60798721c98b780082e7b2edfe9864c5
treec5cdfcd4f25552c1fe8f1882ede47c4dd176876e
parent6c9c7d589014127f4b2bd75e5dd796e6f0a69676
Explicitly cast FetchNextCommandByte to u32 to ensure correct handling

Without the explicit cast, avr-gcc generates incorrect asm which sets
only the lower bytes of the u32, leading the upper bytes to be set to
0xFFFF when the input value has MSB set. This results in flashing past
32k bytes failing. Explicit casting corrects this behaviour in testing.
Bootloaders/CDC/BootloaderCDC.c