X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fdrivers%2Fao_ms5607.c;h=1ebba3e9c6f99ccfb0fd7a7bbebd42b1e7da2c58;hb=88e279b15b3d2357f142e58d20d73c24bf2561eb;hp=e2327bf4113bbe985ba2e49180171088e16ead3c;hpb=983c36782527078ce667feb9eccd1ed0b97fbc29;p=fw%2Faltos diff --git a/src/drivers/ao_ms5607.c b/src/drivers/ao_ms5607.c index e2327bf4..1ebba3e9 100644 --- a/src/drivers/ao_ms5607.c +++ b/src/drivers/ao_ms5607.c @@ -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_ERROR(AO_DATA_MS5607); +#else ao_panic(AO_PANIC_SELF_TEST_MS5607); +#endif + } #if __BYTE_ORDER == __LITTLE_ENDIAN /* Byte swap */ @@ -240,6 +246,9 @@ struct ao_task ao_ms5607_task; void ao_ms5607_info(void) { +#if !HAS_MS5607_TASK + ao_ms5607_setup(); +#endif printf ("ms5607 reserved: %u\n", ao_ms5607_prom.reserved); printf ("ms5607 sens: %u\n", ao_ms5607_prom.sens); printf ("ms5607 off: %u\n", ao_ms5607_prom.off); @@ -255,6 +264,9 @@ ao_ms5607_dump(void) { struct ao_ms5607_value value; +#if !HAS_MS5607_TASK + ao_ms5607_sample(&ao_ms5607_current); +#endif ao_ms5607_convert(&ao_ms5607_current, &value); printf ("Pressure: %8lu %8ld\n", ao_ms5607_current.pres, value.pres); printf ("Temperature: %8lu %8ld\n", ao_ms5607_current.temp, value.temp);