diff options
author | Keith Packard <keithp@keithp.com> | 2017-04-27 23:51:21 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2017-04-27 23:51:21 -0700 |
commit | 2245d9e3178404a49a6787656319fa13f0cc1a51 (patch) | |
tree | 876c7c0dd805186e967522cac22a1a3628c3ae62 /src | |
parent | 6813f48fe02ecc5902f386234535ea76af71a764 (diff) |
altos/ms5607: Allow applications to not use the normal data ring and thread
MicroPeak V2 has tasks, but doesn't want to use another thread just
for the MS5607.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/drivers/ao_ms5607.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/drivers/ao_ms5607.c b/src/drivers/ao_ms5607.c index 261df67f..0afdf012 100644 --- a/src/drivers/ao_ms5607.c +++ b/src/drivers/ao_ms5607.c @@ -191,9 +191,13 @@ ao_ms5607_sample(__xdata struct ao_ms5607_sample *sample) #include "ao_ms5607_convert.c" #endif -#if HAS_TASK +#ifndef HAS_MS5607_TASK +#define HAS_MS5607_TASK HAS_TASK +#endif + __xdata struct ao_ms5607_sample ao_ms5607_current; +#if HAS_MS5607_TASK static void ao_ms5607(void) { @@ -209,7 +213,9 @@ ao_ms5607(void) } __xdata struct ao_task ao_ms5607_task; +#endif +#if HAS_TASK void ao_ms5607_info(void) { @@ -248,6 +254,8 @@ ao_ms5607_init(void) #if HAS_TASK ao_cmd_register(&ao_ms5607_cmds[0]); +#endif +#if HAS_MS5607_TASK ao_add_task(&ao_ms5607_task, ao_ms5607, "ms5607"); #endif |