git.droids-corp.org
/
protos
/
rc_servos.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix interrupt locking
[protos/rc_servos.git]
/
main.c
diff --git
a/main.c
b/main.c
index
e434690
..
923a8ea
100644
(file)
--- a/
main.c
+++ b/
main.c
@@
-173,16
+173,16
@@
static void poll_input_capture(void)
if ((TIFR1 & _BV(ICF1)) == 0)
return;
if ((TIFR1 & _BV(ICF1)) == 0)
return;
- sei();
- icp = ICR1;
cli();
cli();
+ icp = ICR1;
+ sei();
rising = TCCR1B & _BV(ICES1);
/* change the edge type */
TCCR1B ^= _BV(ICES1);
rising = TCCR1B & _BV(ICES1);
/* change the edge type */
TCCR1B ^= _BV(ICES1);
- /* clear the flag */
+ /* clear the flag
by writing a one
*/
TIFR1 = TIFR1 | _BV(ICF1);
diff = icp - icp_prev;
TIFR1 = TIFR1 | _BV(ICF1);
diff = icp - icp_prev;