From 2245d9e3178404a49a6787656319fa13f0cc1a51 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Thu, 27 Apr 2017 23:51:21 -0700 Subject: [PATCH] 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 --- src/drivers/ao_ms5607.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 -- 2.30.2