Skip to content

Commit

Permalink
boards/nucleo-common: fix on-board LED macro for nucleo-f302 case
Browse files Browse the repository at this point in the history
  • Loading branch information
aabadie committed Aug 23, 2017
1 parent 768459d commit 24a12da
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions boards/nucleo-common/include/board_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
/** @} */

/**
Expand Down

0 comments on commit 24a12da

Please sign in to comment.