X-Git-Url: http://git.linex4red.de/pub/lufa.git/blobdiff_plain/06f53eed83b4ad639698aeb9bcc1a3702e2ac7c4..6da32f7dc0eea65f4ea5d0d1641b42436d1c61ed:/Bootloaders/CDC/BootloaderCDC.c?ds=inline diff --git a/Bootloaders/CDC/BootloaderCDC.c b/Bootloaders/CDC/BootloaderCDC.c index d386aff74..6a0740a40 100644 --- a/Bootloaders/CDC/BootloaderCDC.c +++ b/Bootloaders/CDC/BootloaderCDC.c @@ -1,13 +1,13 @@ /* LUFA Library - Copyright (C) Dean Camera, 2017. + Copyright (C) Dean Camera, 2021. dean [at] fourwalledcubicle [dot] com www.lufa-lib.org */ /* - Copyright 2017 Dean Camera (dean [at] fourwalledcubicle [dot] com) + Copyright 2021 Dean Camera (dean [at] fourwalledcubicle [dot] com) Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted @@ -97,7 +97,7 @@ void Application_Jump_Check(void) JTAG_ENABLE(); #else /* Check if the device's BOOTRST fuse is set */ - if (BootloaderAPI_ReadFuse(GET_HIGH_FUSE_BITS) & FUSE_BOOTRST) + if (!(BootloaderAPI_ReadFuse(GET_HIGH_FUSE_BITS) & ~FUSE_BOOTRST)) { /* If the reset source was not an external reset or the key is correct, clear it and jump to the application */ if (!(MCUSR & (1 << EXTRF)) || (MagicBootKey == MAGIC_BOOT_KEY)) @@ -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');