projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altos: Trigger sample complete when all data are ready
[fw/altos]
/
src
/
stm
/
ao_timer.c
diff --git
a/src/stm/ao_timer.c
b/src/stm/ao_timer.c
index adec7aad950f617fc3effe7055db3749167ebaa5..78228e65b72d10ad43df98e47694fc92c4b374bf 100644
(file)
--- a/
src/stm/ao_timer.c
+++ b/
src/stm/ao_timer.c
@@
-37,9
+37,9
@@
ao_delay(uint16_t ticks)
ao_sleep(&ao_forever);
}
ao_sleep(&ao_forever);
}
-#if
HAS_ADC
-volatile __data uint8_t ao_
adc
_interval = 1;
-volatile __data uint8_t ao_
adc
_count;
+#if
AO_DATA_ALL
+volatile __data uint8_t ao_
data
_interval = 1;
+volatile __data uint8_t ao_
data
_count;
#endif
void
#endif
void
@@
-51,10
+51,13
@@
void stm_tim6_isr(void)
if (stm_tim6.sr & (1 << STM_TIM67_SR_UIF)) {
stm_tim6.sr = 0;
++ao_tick_count;
if (stm_tim6.sr & (1 << STM_TIM67_SR_UIF)) {
stm_tim6.sr = 0;
++ao_tick_count;
-#if
HAS_ADC
- if (++ao_
adc_count == ao_adc
_interval) {
- ao_
adc
_count = 0;
+#if
AO_DATA_ALL
+ if (++ao_
data_count == ao_data
_interval) {
+ ao_
data
_count = 0;
ao_adc_poll();
ao_adc_poll();
+#if (AO_DATA_ALL & ~(AO_DATA_ADC))
+ ao_wakeup((void *) &ao_data_count);
+#endif
}
#endif
}
}
#endif
}
@@
-64,8
+67,8
@@
void stm_tim6_isr(void)
void
ao_timer_set_adc_interval(uint8_t interval) __critical
{
void
ao_timer_set_adc_interval(uint8_t interval) __critical
{
- ao_
adc
_interval = interval;
- ao_
adc
_count = 0;
+ ao_
data
_interval = interval;
+ ao_
data
_count = 0;
}
#endif
}
#endif