git.droids-corp.org
/
protos
/
rc_servos.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5dec358
)
fix interrupt locking
author
Olivier Matz
<zer0@droids-corp.org>
Tue, 8 Oct 2013 20:39:39 +0000
(22:39 +0200)
committer
Olivier Matz
<zer0@droids-corp.org>
Tue, 8 Oct 2013 20:39:39 +0000
(22:39 +0200)
cli/sei were reversed
main.c
patch
|
blob
|
history
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;
- sei();
- icp = ICR1;
cli();
+ icp = ICR1;
+ sei();
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;