Dolda2000 GitWeb
/
kokare.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Bugfix for switch detection.
[kokare.git]
/
kokare.c
diff --git
a/kokare.c
b/kokare.c
index
5393c8b
..
61e5213
100644
(file)
--- a/
kokare.c
+++ b/
kokare.c
@@
-320,6
+320,10
@@
int main(void)
tron = !tron;
sstate = 0;
}
tron = !tron;
sstate = 0;
}
+ if(tron)
+ dsp[1] |= SEGP;
+ else
+ dsp[1] &= ~SEGP;
#endif
#if 0
/*
#endif
#if 0
/*
@@
-341,6
+345,8
@@
int main(void)
} else {
display(cur);
}
} else {
display(cur);
}
+ if(PINB & 4)
+ dsp[1] |= SEGP;
#endif
}
}
#endif
}
}
@@
-374,11
+380,11
@@
ISR(SIG_OVERFLOW1)
ISR(SIG_PIN_CHANGE0)
{
ISR(SIG_PIN_CHANGE0)
{
- if((sstate == 0) &
((PINB & 4) == 0
)) {
+ if((sstate == 0) &
& !(PINB & 4
)) {
stime = oticks;
sstate = 1;
}
stime = oticks;
sstate = 1;
}
- if((sstate == 1) &
((PINB & 4) == 1
)) {
+ if((sstate == 1) &
& (PINB & 4
)) {
stime = oticks - stime;
sstate = 2;
}
stime = oticks - stime;
sstate = 2;
}