summaryrefslogtreecommitdiff
path: root/src-avr/ao_task.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2011-05-20 23:47:55 -0700
committerKeith Packard <keithp@keithp.com>2011-05-21 02:07:43 -0700
commit557522e447448023d7869c0fa15ed8337db7e1b8 (patch)
treec45649e979e4852fef7e65ac5bcc52c01157e688 /src-avr/ao_task.c
parentf7e552a0f4b1382a076b0f3ffc50ef068bfa141f (diff)
src-avr: Add ADC routines to telescience
Note that SLEEP mode must be disabled or extra ADC interrupts occur, which messes up saving ADC values to the right channel. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src-avr/ao_task.c')
-rw-r--r--src-avr/ao_task.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src-avr/ao_task.c b/src-avr/ao_task.c
index 51467133..aa3f85c7 100644
--- a/src-avr/ao_task.c
+++ b/src-avr/ao_task.c
@@ -26,6 +26,8 @@ __xdata struct ao_task *__data ao_cur_task;
#ifdef AVR
+uint8_t ao_cpu_sleep_disable;
+
#define PUSH8(stack, val) (*((stack)--) = (val))
static void
@@ -200,7 +202,8 @@ ao_yield(void) __naked
/* Enter lower power mode when there isn't anything to do */
if (ao_next_task_index == ao_cur_task_index)
#ifdef AVR
- sleep_cpu();
+ if (!ao_cpu_sleep_disable)
+ sleep_cpu();
#else
PCON = PCON_IDLE;
#endif