From 7c5b9b2c6bf57aea4332177e7fb0eb2d490f4f6e Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Wed, 16 Feb 2022 17:52:11 -0800 Subject: [PATCH] altos/micropeak-v2.0: Add casts to reduce -Wconversion warnings No bugs identified Signed-off-by: Keith Packard --- src/micropeak-v2.0/ao_micro.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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) { -- 2.30.2