Fix bootloaders incorrectly checking the BOOTRST fuse on start (thanks to Braden...
[pub/USBasp.git] / Bootloaders / CDC / BootloaderCDC.c
index bcb5c85..00755a5 100644 (file)
@@ -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))