improve exit logik by debouncing both: press and release of JUMPER
authorStephan Baerwolf <stephan.baerwolf@tu-ilmenau.de>
Tue, 31 Jul 2012 12:06:21 +0000 (14:06 +0200)
committerStephan Baerwolf <stephan.baerwolf@tu-ilmenau.de>
Tue, 31 Jul 2012 13:12:37 +0000 (13:12 +0000)
Signed-off-by: Stephan Baerwolf <stephan.baerwolf@tu-ilmenau.de>
firmware/main.c

index 1b70c71..a029169 100644 (file)
@@ -374,13 +374,13 @@ int __attribute__((noreturn)) main(void)
                 }
             }
 #endif
-       if (stayinloader > 0x04) {
+       if (stayinloader > 0x10) {
          if (!bootLoaderCondition()) {
-           stayinloader-=0x04;
+           stayinloader-=0x10;
          } 
        } else {
          if (bootLoaderCondition()) {
-           stayinloader &= 0x01;
+           if (stayinloader > 1) stayinloader-=2;
          }
        }