From 35e79ca1bfe294324e860504d5ba56f174c0d77c Mon Sep 17 00:00:00 2001 From: Bart Van Der Meerssche Date: Tue, 15 Feb 2011 22:52:46 +0100 Subject: [PATCH] [avr] double-check the ACO to protect against spikes on the sensing circuit --- mote/v2/avr/main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mote/v2/avr/main.c b/mote/v2/avr/main.c index 38ffe2d..a5254f9 100644 --- a/mote/v2/avr/main.c +++ b/mote/v2/avr/main.c @@ -241,6 +241,9 @@ ISR(TIMER1_COMPA_vect) ISR(ANALOG_COMP_vect) { + if (!(ACSR & (1 << ACO))) + return; + disable_led(); event.brown_out++;