altos: Allow ms5607 driver to either set ao_sensor_errors or panic
[fw/altos] / src / drivers / ao_ms5607.c
index 495fbe02c0c015262b635870c704c660f85cc82f..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 */