#include <ao_exti.h>
#include "ao_ms5607.h"
-#if HAS_MS5607
+#if HAS_MS5607 || HAS_MS5611
static struct ao_ms5607_prom ms5607_prom;
static uint8_t ms5607_configured;
printf ("MS5607 PROM CRC error (computed %x actual %x)\n",
crc, (((uint8_t *) prom)[15] & 0xf));
flush();
-// ao_panic(AO_PANIC_SELF_TEST_MS5607);
+ ao_panic(AO_PANIC_SELF_TEST_MS5607);
}
#if __BYTE_ORDER == __LITTLE_ENDIAN
TEMP = 2000 + (((int64_t) dT * ms5607_prom.tempsens) >> 23);
+#if HAS_MS5611
+ OFF = ((int64_t) ms5607_prom.off << 16) + (((int64_t) ms5607_prom.tco * dT) >> 7);
+ SENS = ((int64_t) ms5607_prom.sens << 15) + (((int64_t) ms5607_prom.tcs * dT) >> 8);
+#else
OFF = ((int64_t) ms5607_prom.off << 17) + (((int64_t) ms5607_prom.tco * dT) >> 6);
-
SENS = ((int64_t) ms5607_prom.sens << 16) + (((int64_t) ms5607_prom.tcs * dT) >> 7);
+#endif
if (TEMP < 2000) {
int32_t T2 = ((int64_t) dT * (int64_t) dT) >> 31;
ao_cmd_register(&ao_ms5607_cmds[0]);
ao_spi_init_cs(AO_MS5607_CS_PORT, (1 << AO_MS5607_CS_PIN));
-// ao_add_task(&ao_ms5607_task, ao_ms5607, "ms5607");
+ ao_add_task(&ao_ms5607_task, ao_ms5607, "ms5607");
/* Configure the MISO pin as an interrupt; when the
* conversion is complete, the MS5607 will raise this