From 643106ff5d6225ae01ab937f386675911379da6f Mon Sep 17 00:00:00 2001 From: lenvm Date: Tue, 17 Oct 2023 22:24:48 +0200 Subject: [PATCH] platforms/blackpill-f4: invert state of SET_IDLE_STATE, as PC13 needs to be pulled low to turn LED on --- src/platforms/common/blackpill-f4/blackpill-f4.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/platforms/common/blackpill-f4/blackpill-f4.h b/src/platforms/common/blackpill-f4/blackpill-f4.h index 763341c4c65..649b6d83a63 100644 --- a/src/platforms/common/blackpill-f4/blackpill-f4.h +++ b/src/platforms/common/blackpill-f4/blackpill-f4.h @@ -230,9 +230,13 @@ { \ running_status = (state); \ } -#define SET_IDLE_STATE(state) \ - { \ - gpio_set_val(LED_PORT, LED_IDLE_RUN, state); \ +/* + * The state of LED_IDLE_RUN is inverted, as the led used for + * LED_IDLE_RUN (PC13) needs to be pulled low to turn the led on. + */ +#define SET_IDLE_STATE(state) \ + { \ + gpio_set_val(LED_PORT, LED_IDLE_RUN, !state); \ } #define SET_ERROR_STATE(state) \ { \