introduce new feature: BOOTLOADER_IGNOREPROGBUTTON
[pub/USBaspLoader.git] / firmware / main.c
index d08ed23..038368c 100644 (file)
@@ -783,6 +783,21 @@ int __attribute__((__noreturn__)) main(void)
 #endif
             usbPoll();
 #if BOOTLOADER_CAN_EXIT
 #endif
             usbPoll();
 #if BOOTLOADER_CAN_EXIT
+#if BOOTLOADER_IGNOREPROGBUTTON
+  /* 
+   * remove the high nibble as it would be subtracted due to:
+   * "(!bootLoaderConditionSimple())"
+   */ 
+#if USE_EXCESSIVE_ASSEMBLER
+asm  volatile  (
+  "andi                %[sil],         0x0f\n\t"
+  : [sil]        "+d" (stayinloader)
+  :
+);
+#else
+  stayinloader &= 0x0f;
+#endif
+#else
 #if USE_EXCESSIVE_ASSEMBLER
 asm  volatile  (
   "cpi         %[sil],         0x10\n\t"
 #if USE_EXCESSIVE_ASSEMBLER
 asm  volatile  (
   "cpi         %[sil],         0x10\n\t"
@@ -814,6 +829,7 @@ asm  volatile  (
        }
 #endif
 #endif
        }
 #endif
 #endif
+#endif
 
 #if BOOTLOADER_CAN_EXIT
         }while (stayinloader); /* main event loop, if BOOTLOADER_CAN_EXIT*/
 
 #if BOOTLOADER_CAN_EXIT
         }while (stayinloader); /* main event loop, if BOOTLOADER_CAN_EXIT*/