From 24a12da2af54259e84e0ab4458dee8328f8f48d3 Mon Sep 17 00:00:00 2001 From: Alexandre Abadie Date: Mon, 21 Aug 2017 14:55:01 +0200 Subject: [PATCH] boards/nucleo-common: fix on-board LED macro for nucleo-f302 case --- boards/nucleo-common/include/board_common.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/boards/nucleo-common/include/board_common.h b/boards/nucleo-common/include/board_common.h index 5d7c732b0a..e374982467 100644 --- a/boards/nucleo-common/include/board_common.h +++ b/boards/nucleo-common/include/board_common.h @@ -41,16 +41,18 @@ extern "C" { * @{ */ #ifdef CPU_MODEL_STM32F302R8 +#define LED0_PORT GPIOB #define LED0_PIN GPIO_PIN(PORT_B, 13) #define LED0_MASK (1 << 13) #else +#define LED0_PORT GPIOA #define LED0_PIN GPIO_PIN(PORT_A, 5) #define LED0_MASK (1 << 5) #endif -#define LED0_ON (GPIOA->BSRR = LED0_MASK) -#define LED0_OFF (GPIOA->BSRR = (LED0_MASK << 16)) -#define LED0_TOGGLE (GPIOA->ODR ^= LED0_MASK) +#define LED0_ON (LED0_PORT->BSRR = LED0_MASK) +#define LED0_OFF (LED0_PORT->BSRR = (LED0_MASK << 16)) +#define LED0_TOGGLE (LED0_PORT->ODR ^= LED0_MASK) /** @} */ /**