altos: Allow ms5607 driver to either set ao_sensor_errors or panic
[fw/altos] / src / drivers / ao_ms5607.c
index 162141115c01c5f7e7f2abbab541bc9b5622b486..febe01117dbc614e11d309327d830d660f8a2e86 100644 (file)
@@ -112,8 +112,14 @@ ao_ms5607_prom_read(struct ao_ms5607_prom *prom)
                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 */
@@ -259,7 +265,6 @@ ao_ms5607_dump(void)
        struct ao_ms5607_value value;
 
 #if !HAS_MS5607_TASK
-       ao_ms5607_info();
        ao_ms5607_sample(&ao_ms5607_current);
 #endif
        ao_ms5607_convert(&ao_ms5607_current, &value);