From: Fredrik Tolf Date: Fri, 29 Jun 2007 22:37:27 +0000 (+0000) Subject: Bugfix for switch detection. X-Git-Url: http://dolda2000.com/gitweb/?p=kokare.git;a=commitdiff_plain;h=4f42f21300df867e72561cb61cd378b74e49c54d Bugfix for switch detection. Added some debugging for misc. UIs. --- diff --git a/kokare.c b/kokare.c index 5393c8b..61e5213 100644 --- a/kokare.c +++ b/kokare.c @@ -320,6 +320,10 @@ int main(void) tron = !tron; sstate = 0; } + if(tron) + dsp[1] |= SEGP; + else + dsp[1] &= ~SEGP; #endif #if 0 /* @@ -341,6 +345,8 @@ int main(void) } else { display(cur); } + if(PINB & 4) + dsp[1] |= SEGP; #endif } } @@ -374,11 +380,11 @@ ISR(SIG_OVERFLOW1) ISR(SIG_PIN_CHANGE0) { - if((sstate == 0) & ((PINB & 4) == 0)) { + if((sstate == 0) && !(PINB & 4)) { stime = oticks; sstate = 1; } - if((sstate == 1) & ((PINB & 4) == 1)) { + if((sstate == 1) && (PINB & 4)) { stime = oticks - stime; sstate = 2; }