diff --git a/Bootloaders/CDC/BootloaderCDC.c b/Bootloaders/CDC/BootloaderCDC.c index bcb5c85cfb010e8a89a0a6b16f714bd40d728a49..00755a54c3bcb39192eeb03a6a8cb57435e29280 100644 --- a/Bootloaders/CDC/BootloaderCDC.c +++ b/Bootloaders/CDC/BootloaderCDC.c @@ -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)) diff --git a/Bootloaders/DFU/BootloaderDFU.c b/Bootloaders/DFU/BootloaderDFU.c index cafbd572b54f8d3dd29c8f8b33ebac4837638411..3167c89727f7ea25d32d6810d75b986600a51239 100644 --- a/Bootloaders/DFU/BootloaderDFU.c +++ b/Bootloaders/DFU/BootloaderDFU.c @@ -133,7 +133,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)) diff --git a/Bootloaders/MassStorage/BootloaderMassStorage.c b/Bootloaders/MassStorage/BootloaderMassStorage.c index 81a8dc424176f0ce47295e9c77d88db171a3230b..ca3fd289787e5a851f16985a1bfe2ccf5961ece7 100644 --- a/Bootloaders/MassStorage/BootloaderMassStorage.c +++ b/Bootloaders/MassStorage/BootloaderMassStorage.c @@ -114,7 +114,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)) diff --git a/Bootloaders/Printer/BootloaderPrinter.c b/Bootloaders/Printer/BootloaderPrinter.c index da41621724a8bca8fb64031e2648ee45f94f30b3..629cc07b40346ef754f80bbb7909fd7f36d0e11a 100644 --- a/Bootloaders/Printer/BootloaderPrinter.c +++ b/Bootloaders/Printer/BootloaderPrinter.c @@ -146,7 +146,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)) diff --git a/LUFA/DoxygenPages/ChangeLog.txt b/LUFA/DoxygenPages/ChangeLog.txt index 54744066e3b4cf5a3d5f87630105216baedd5a88..719ae22092b5ecce98729196ecc1ce45096bd71c 100644 --- a/LUFA/DoxygenPages/ChangeLog.txt +++ b/LUFA/DoxygenPages/ChangeLog.txt @@ -21,6 +21,7 @@ * - Library Applications: * - Fixed bootloaders not disabling global interrupts during erase and write operations (thanks to Zoltan) * - Fixed bootloaders accepting flash writes to the bootloader region (thanks to NicoHood) + * - Fixed bootloaders incorrectly checking the BOOTRST fuse on start (thanks to Braden Kell) * * \section Sec_ChangeLog170418 Version 170418 * <b>New:</b>