summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2020-03-25 00:10:32 +1100
committerDamien George <damien.p.george@gmail.com>2020-03-25 00:10:32 +1100
commit40255aff232fe726cf43f52961be9eb2839540b0 (patch)
treecda68d257005ee61210d1c198a78815f3cce677c
parent9dd470b76819eaea36d8d6940e3b91e30ba076fb (diff)
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.
-rw-r--r--ports/stm32/mboot/main.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/ports/stm32/mboot/main.c b/ports/stm32/mboot/main.c
index caaf39468..da4463e1c 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 {