From beddceb8d4906f8ad3913332c5a28d98b6c417c0 Mon Sep 17 00:00:00 2001 From: Hauke Petersen Date: Fri, 11 Mar 2016 18:04:27 +0100 Subject: [PATCH] boards/udoo: unified LED defines --- boards/udoo/board.c | 4 ++-- boards/udoo/include/board.h | 26 +++++++------------------- 2 files changed, 9 insertions(+), 21 deletions(-) diff --git a/boards/udoo/board.c b/boards/udoo/board.c index 8a3a15aafa..87eb99b9bf 100644 --- a/boards/udoo/board.c +++ b/boards/udoo/board.c @@ -24,8 +24,8 @@ void board_init(void) { + /* initialize the on-board Amber "L" LED @ pin PB27 */ + gpio_init(LED0_PIN, GPIO_DIR_OUT, GPIO_NOPULL); /* initialize the CPU */ cpu_init(); - /* initialize the on-board Amber "L" LED @ pin PB27 */ - gpio_init(LED_PIN, GPIO_DIR_OUT, GPIO_NOPULL); } diff --git a/boards/udoo/include/board.h b/boards/udoo/include/board.h index 6c1fed79ce..c3aa1a88a6 100644 --- a/boards/udoo/include/board.h +++ b/boards/udoo/include/board.h @@ -29,29 +29,17 @@ extern "C" { #endif /** - * @name LED pin definitions + * @brief LED pin definitions and handlers * @{ */ +#define LED0_PIN GPIO_PIN(PB, 27) + #define LED_PORT PIOB -#define LED_BIT PIO_PB27 -#define LED_PIN GPIO_PIN(PB, 27) -/** @} */ +#define LED0_MASK PIO_PB27 -/** - * @name Macros for controlling the on-board LEDs. - * @{ - */ -#define LED_ON (LED_PORT->PIO_SODR = LED_BIT) -#define LED_OFF (LED_PORT->PIO_CODR = LED_BIT) -#define LED_TOGGLE (LED_PORT->PIO_ODSR ^= LED_BIT) - -/* for compatability to other boards */ -#define LED_GREEN_ON LED_ON -#define LED_GREEN_OFF LED_OFF -#define LED_GREEN_TOGGLE LED_TOGGLE -#define LED_RED_ON /* not available */ -#define LED_RED_OFF /* not available */ -#define LED_RED_TOGGLE /* not available */ +#define LED_ON (LED_PORT->PIO_SODR = LED0_MASK) +#define LED_OFF (LED_PORT->PIO_CODR = LED0_MASK) +#define LED_TOGGLE (LED_PORT->PIO_ODSR ^= LED0_MASK) /** @} */ /**