X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=src%2Fmicropeak-v2.0%2Fao_micro.c;fp=src%2Fmicropeak-v2.0%2Fao_micro.c;h=d634982992d5d4bd114c1c2289f9fbe75e5a2f4b;hp=efab12c315dd5f1cbbd9bfa8e605fc02d3c454bf;hb=7c5b9b2c6bf57aea4332177e7fb0eb2d490f4f6e;hpb=e80a45c1565b14479e3a4cfc968d49b13cef4fe0 diff --git a/src/micropeak-v2.0/ao_micro.c b/src/micropeak-v2.0/ao_micro.c index efab12c3..d6349829 100644 --- a/src/micropeak-v2.0/ao_micro.c +++ b/src/micropeak-v2.0/ao_micro.c @@ -50,14 +50,14 @@ ao_pa_get(void) ao_ms5607_sample(&ao_ms5607_current); ao_ms5607_convert(&ao_ms5607_current, &value); - pa = value.pres; + pa = (uint32_t) value.pres; } static void ao_compute_height(void) { - ground_alt = ao_pa_to_altitude(pa_ground); - max_alt = ao_pa_to_altitude(pa_min); + ground_alt = ao_pa_to_altitude((pres_t) pa_ground); + max_alt = ao_pa_to_altitude((pres_t) pa_min); ao_max_height = max_alt - ground_alt; } @@ -91,7 +91,7 @@ power_down(void) stm_scb.scr |= ((1 << STM_SCB_SCR_SLEEPDEEP) | (1 << STM_SCB_SCR_SLEEPONEXIT)); stm_pwr.cr |= (1 << STM_PWR_CR_PDDS); - stm_pwr.csr &= ~(1 << STM_PWR_CSR_WUF); + stm_pwr.csr &= ~(1UL << STM_PWR_CSR_WUF); ao_arch_wait_interrupt(); } } @@ -144,7 +144,7 @@ flight_mode(void) ao_report_altitude(); ao_pips(); log_micro_dump(); -#if BOOST_DELAY +#ifdef BOOST_DELAY ao_delay(BOOST_DELAY); #endif log_erase(); @@ -212,7 +212,7 @@ main(void) */ uint16_t vref = ao_adc_read_vref(); - uint32_t vdda = 3 * stm_vrefint_cal.vrefint_cal * 1000 / vref; + uint32_t vdda = 3UL * stm_vrefint_cal.vrefint_cal * 1000 / vref; /* Power supply > 3.25V means we're on USB power */ if (vdda > 3250) {