X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fdrivers%2Fao_ms5607.c;h=7db7022fda4f0965641f11001c739fe373aab989;hb=9eeba439ce8c9dc1def8528f96b6a67c6578d656;hp=f79c315a2a683df13c01636dc979625fb4e64fbd;hpb=d01c10eff4b70af13347969a7cece8730cf1a3f1;p=fw%2Faltos diff --git a/src/drivers/ao_ms5607.c b/src/drivers/ao_ms5607.c index f79c315a..7db7022f 100644 --- a/src/drivers/ao_ms5607.c +++ b/src/drivers/ao_ms5607.c @@ -195,6 +195,7 @@ ao_ms5607_convert(struct ao_ms5607_sample *sample, struct ao_ms5607_value *value } struct ao_ms5607_sample ao_ms5607_current; +uint8_t ao_ms5607_valid; static void ao_ms5607(void) @@ -206,6 +207,7 @@ ao_ms5607(void) ao_ms5607_sample(&ao_ms5607_next); ao_arch_critical( ao_ms5607_current = ao_ms5607_next; + ao_ms5607_valid = 1; ); ao_delay(0); } @@ -244,6 +246,7 @@ void ao_ms5607_init(void) { ms5607_configured = 0; + ao_ms5607_valid = 0; ao_cmd_register(&ao_ms5607_cmds[0]); ao_spi_init_cs(AO_MS5607_CS_GPIO, (1 << AO_MS5607_CS));