Merge pull request #170 from exp/master
authorDean Camera <dean@fourwalledcubicle.com>
Tue, 23 Mar 2021 10:23:13 +0000 (10:23 +0000)
committerGitHub <noreply@github.com>
Tue, 23 Mar 2021 10:23:13 +0000 (10:23 +0000)
BootloaderCDC: Fix flashing binaries over 32K failing due to missing explicitly cast.

Bootloaders/CDC/BootloaderCDC.c

index 2c8748a..6a0740a 100644 (file)
@@ -475,8 +475,8 @@ static void CDC_Task(void)
        else if (Command == AVR109_COMMAND_SetCurrentAddress)
        {
                /* Set the current address to that given by the host (translate 16-bit word address to byte address) */
-               CurrAddress   = (FetchNextCommandByte() << 9);
-               CurrAddress  |= (FetchNextCommandByte() << 1);
+               CurrAddress   = ((uint32_t)FetchNextCommandByte() << 9);
+               CurrAddress  |= ((uint32_t)FetchNextCommandByte() << 1);
 
                /* Send confirmation byte back to the host */
                WriteNextResponseByte('\r');