improve exit logik by debouncing both: press and release of JUMPER
[pub/USBaspLoader.git] / firmware / main.c
index 1b70c71..a029169 100644 (file)
@@ -374,13 +374,13 @@ int __attribute__((noreturn)) main(void)
                 }
             }
 #endif
                 }
             }
 #endif
-       if (stayinloader > 0x04) {
+       if (stayinloader > 0x10) {
          if (!bootLoaderCondition()) {
          if (!bootLoaderCondition()) {
-           stayinloader-=0x04;
+           stayinloader-=0x10;
          } 
        } else {
          if (bootLoaderCondition()) {
          } 
        } else {
          if (bootLoaderCondition()) {
-           stayinloader &= 0x01;
+           if (stayinloader > 1) stayinloader-=2;
          }
        }
 
          }
        }