From 8c7258893c81742bf8cb515da49ce9d71490cf59 Mon Sep 17 00:00:00 2001 From: Jason Wen Date: Fri, 13 Dec 2024 15:54:58 -0500 Subject: [PATCH] GPIO: - Explicitly casts constants to `uint32_t` --- board/drivers/gpio.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/board/drivers/gpio.h b/board/drivers/gpio.h index 0b8fc091b1..4f0202ad06 100644 --- a/board/drivers/gpio.h +++ b/board/drivers/gpio.h @@ -58,7 +58,7 @@ void set_gpio_alternate(GPIO_TypeDef *GPIO, unsigned int pin, unsigned int mode) void set_gpio_pullup(GPIO_TypeDef *GPIO, unsigned int pin, unsigned int mode) { ENTER_CRITICAL(); uint32_t tmp = GPIO->PUPDR; - tmp &= ~(3U << (pin * 2U)); + tmp &= ~((uint32_t)3U << ((uint32_t)(pin * 2U))); tmp |= (mode << (pin * 2U)); register_set(&(GPIO->PUPDR), tmp, 0xFFFFFFFFU); EXIT_CRITICAL();