diff options
author | Keith Packard <keithp@keithp.com> | 2019-07-15 13:26:30 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2019-07-15 13:26:30 -0700 |
commit | 245a49a85dd7b6a7cb9ec36ad02f6bb66e42f4e2 (patch) | |
tree | 1b1950bc3c3272b237961cdeba3dd3d3b5c18961 /src/kernel/ao_data.h | |
parent | 98f7c1c116aab672a29db1f81213cabe2d72ae16 (diff) |
altos: Allow ms5607 driver to either set ao_sensor_errors or panic
Products that want to remain usable (over USB) after a sensor failure
don't want to panic when the ms5607 fails, but products with limited
ROM space don't want to have extra code to check for the sensor
failure and panic. Change the MS5607 driver to allow either option,
and then make the micropeak based devices use it.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/kernel/ao_data.h')
-rw-r--r-- | src/kernel/ao_data.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/kernel/ao_data.h b/src/kernel/ao_data.h index f52e17e2..5a340c3f 100644 --- a/src/kernel/ao_data.h +++ b/src/kernel/ao_data.h @@ -76,6 +76,16 @@ #define AO_DATA_MAX6691 0 #endif +#ifndef HAS_SENSOR_ERRORS +#if HAS_IMU || HAS_MMA655X || HAS_MS5607 || HAS_MS5611 +#define HAS_SENSOR_ERRORS 1 +#endif +#endif + +#if HAS_SENSOR_ERRORS +extern uint8_t ao_sensor_errors; +#endif + #ifdef AO_DATA_RING #define AO_DATA_ALL (AO_DATA_ADC|AO_DATA_MS5607|AO_DATA_MPU6000|AO_DATA_HMC5883|AO_DATA_MMA655X|AO_DATA_MPU9250|AO_DATA_ADXL375) |