summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorhathach <[email protected]>2026-03-06 10:59:32 +0700
committerhathach <[email protected]>2026-03-06 11:26:00 +0700
commit94baf394686f92d9edaf109dcae30fa7b531fefc (patch)
tree6d4ca5a131c2a5c73f6649c292c1349d16648535 /hw
parent61e4b9ce3fba2fea731396c56eee1c7b5a2f5338 (diff)
fix warnings
Diffstat (limited to 'hw')
-rw-r--r--hw/bsp/stm32f1/family.c4
-rw-r--r--hw/bsp/stm32l0/family.c3
-rw-r--r--hw/bsp/stm32wba/family.c5
3 files changed, 8 insertions, 4 deletions
diff --git a/hw/bsp/stm32f1/family.c b/hw/bsp/stm32f1/family.c
index fae61ca9e..78a425453 100644
--- a/hw/bsp/stm32f1/family.c
+++ b/hw/bsp/stm32f1/family.c
@@ -148,12 +148,12 @@ void board_init(void) {
#ifdef USB_CONNECT_PIN
void dcd_disconnect(uint8_t rhport) {
(void)rhport;
- HAL_GPIO_WritePin(USB_CONNECT_PORT, USB_CONNECT_PIN, 1-USB_CONNECT_STATE);
+ HAL_GPIO_WritePin(USB_CONNECT_PORT, USB_CONNECT_PIN, (GPIO_PinState)(1 - USB_CONNECT_STATE));
}
void dcd_connect(uint8_t rhport) {
(void)rhport;
- HAL_GPIO_WritePin(USB_CONNECT_PORT, USB_CONNECT_PIN, USB_CONNECT_STATE);
+ HAL_GPIO_WritePin(USB_CONNECT_PORT, USB_CONNECT_PIN, (GPIO_PinState)USB_CONNECT_STATE);
}
#endif
diff --git a/hw/bsp/stm32l0/family.c b/hw/bsp/stm32l0/family.c
index 192f014f4..7fd076dbd 100644
--- a/hw/bsp/stm32l0/family.c
+++ b/hw/bsp/stm32l0/family.c
@@ -123,7 +123,8 @@ void board_init(void) {
//--------------------------------------------------------------------+
void board_led_write(bool state) {
- HAL_GPIO_WritePin(LED_PORT, LED_PIN, state ? LED_STATE_ON : (1 - LED_STATE_ON));
+ GPIO_PinState pin_state = (GPIO_PinState)(state ? LED_STATE_ON : (1 - LED_STATE_ON));
+ HAL_GPIO_WritePin(LED_PORT, LED_PIN, pin_state);
}
uint32_t board_button_read(void) {
diff --git a/hw/bsp/stm32wba/family.c b/hw/bsp/stm32wba/family.c
index e058a80a1..878355b48 100644
--- a/hw/bsp/stm32wba/family.c
+++ b/hw/bsp/stm32wba/family.c
@@ -175,7 +175,10 @@ void board_init(void) {
#endif // USB_OTG_HS
}
-void board_led_write(bool state) { HAL_GPIO_WritePin(LED_PORT, LED_PIN, state ? LED_STATE_ON : (1 - LED_STATE_ON)); }
+void board_led_write(bool state) {
+ GPIO_PinState pin_state = (GPIO_PinState)(state ? LED_STATE_ON : (1 - LED_STATE_ON));
+ HAL_GPIO_WritePin(LED_PORT, LED_PIN, pin_state);
+}
uint32_t board_button_read(void) { return HAL_GPIO_ReadPin(BUTTON_PORT, BUTTON_PIN) == BUTTON_STATE_ACTIVE; }