altos: Support normalized axes in mpu6000 and mmc5983
[fw/altos] / src / drivers / ao_ms5607.c
index 495fbe02c0c015262b635870c704c660f85cc82f..c5e733a46e6bf4dacca71dd40ba9e581cd745d90 100644 (file)
@@ -25,9 +25,7 @@
 struct ao_ms5607_prom  ao_ms5607_prom;
 static uint8_t         ms5607_configured;
 
-#ifndef AO_MS5607_SPI_SPEED
-#define AO_MS5607_SPI_SPEED    AO_SPI_SPEED_FAST
-#endif
+#define AO_MS5607_SPI_SPEED    ao_spi_speed(20000000)
 
 static void
 ao_ms5607_start(void) {
@@ -112,8 +110,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_ERROR(AO_DATA_MS5607);
+#else
                ao_panic(AO_PANIC_SELF_TEST_MS5607);
+#endif
+       }
 
 #if __BYTE_ORDER == __LITTLE_ENDIAN
        /* Byte swap */