From 40255aff232fe726cf43f52961be9eb2839540b0 Mon Sep 17 00:00:00 2001 From: Damien George Date: Wed, 25 Mar 2020 00:10:32 +1100 Subject: [PATCH] stm32/mboot: Remove unnecessary test for led being 1 in led_state. The "led" argument is always a pointer to the GPIO port, or'd with the pin that the LED is on, so testing that it is "1" is unnecessary. The type of "led" is also changed to uint32_t so it can properly hold a 32-bit pointer. --- ports/stm32/mboot/main.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/ports/stm32/mboot/main.c b/ports/stm32/mboot/main.c index caaf394687..da4463e1cc 100644 --- a/ports/stm32/mboot/main.c +++ b/ports/stm32/mboot/main.c @@ -441,10 +441,7 @@ MP_WEAK void led_init(void) { led0_cur_state = LED0_STATE_OFF; } -MP_WEAK void led_state(int led, int val) { - if (led == 1) { - led = LED0; - } +MP_WEAK void led_state(uint32_t led, int val) { if (val) { MICROPY_HW_LED_ON(led); } else {