Dolda2000 GitWeb
/
kokare.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use only one version of getticks.
[kokare.git]
/
kokare.c
diff --git
a/kokare.c
b/kokare.c
index
64c3754
..
38662bb
100644
(file)
--- a/
kokare.c
+++ b/
kokare.c
@@
-149,7
+149,16
@@
void disphex(unsigned char num)
unsigned long getticks(void)
{
unsigned long getticks(void)
{
- return(TCNT1 + (((unsigned long)oticks) << 16));
+ uint16_t v;
+ unsigned long r;
+
+ cli();
+ v = TCNT1;
+ r = v + (((unsigned long)oticks) << 16);
+ if((TIFR1 & 0x01) && !(v & 0x8000))
+ r += 0x10000;
+ sei();
+ return(r);
}
void ledcycle(void)
}
void ledcycle(void)