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>
r++;
}
- if (!ao_ms5607_prom_valid((uint8_t *) prom))
+
+ if (!ao_ms5607_prom_valid((uint8_t *) prom)) {
+#if HAS_SENSOR_ERRORS
+ ao_sensor_errors = 1;
+#else
ao_panic(AO_PANIC_SELF_TEST_MS5607);
+#endif
+ }
#if __BYTE_ORDER == __LITTLE_ENDIAN
/* Byte swap */
#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)
extern uint16_t ao_launch_tick;
extern uint16_t ao_motor_number;
-#if HAS_IMU || HAS_MMA655X
-#define HAS_SENSOR_ERRORS 1
-#endif
-
-#if HAS_SENSOR_ERRORS
-extern uint8_t ao_sensor_errors;
-#endif
-
extern uint16_t ao_launch_time;
extern uint8_t ao_flight_force_idle;
#define HAS_SERIAL_1 0
#define HAS_TASK 0
#define HAS_MS5607 1
+#define HAS_SENSOR_ERRORS 0
#define HAS_MS5611 0
#define HAS_EEPROM 0
#define HAS_BEEP 0
#define IS_FLASH_LOADER 0
#define HAS_MS5607 1
+#define HAS_SENSOR_ERRORS 0
#define HAS_MS5611 0
#define HAS_MS5607_TASK 0
#define HAS_EEPROM 1
#define HAS_TASK 0
#define HAS_MS5607 1
#define HAS_MS5611 0
+#define HAS_SENSOR_ERRORS 0
#define HAS_EEPROM 0
#define HAS_BEEP 0
#define AVR_CLOCK 250000UL
#define HAS_SERIAL_1 0
#define HAS_TASK 0
#define HAS_MS5607 1
+#define HAS_SENSOR_ERRORS 0
#define HAS_MS5611 0
#define HAS_EEPROM 0
#define HAS_BEEP 0