diff --git a/boards/cc2538dk/board.c b/boards/cc2538dk/board.c index 0c054f2898b7..f0761d75e298 100644 --- a/boards/cc2538dk/board.c +++ b/boards/cc2538dk/board.c @@ -29,17 +29,6 @@ static void led_init_helper(int gpio_num) { IOC_PXX_OVER[gpio_num] = IOC_OVERRIDE_OE; } -/** - * @brief Initialize the SmartRF06's on-board LEDs - */ -void led_init(void) -{ - led_init_helper(LED_RED_GPIO); - led_init_helper(LED_GREEN_GPIO); - led_init_helper(LED_YELLOW_GPIO); - led_init_helper(LED_ORANGE_GPIO); -} - /** * @brief Initialize the SmartRF06 board */ @@ -49,7 +38,10 @@ void board_init(void) cpu_init(); /* initialize the boards LEDs */ - led_init(); + led_init_helper(LED0_GPIO); + led_init_helper(LED1_GPIO); + led_init_helper(LED2_GPIO); + led_init_helper(LED3_GPIO); } /** @} */ diff --git a/boards/cc2538dk/include/board.h b/boards/cc2538dk/include/board.h index 5743f9f00ce7..ebb06487671f 100644 --- a/boards/cc2538dk/include/board.h +++ b/boards/cc2538dk/include/board.h @@ -28,34 +28,34 @@ extern "C" { #endif /** - * @name Macros for controlling the on-board LEDs. + * @brief LED pin definitions and handlers * @{ */ -#define LED_RED_GPIO GPIO_PC0 /**< Red LED GPIO pin */ -#define LED_YELLOW_GPIO GPIO_PC1 /**< Yellow LED GPIO pin */ -#define LED_GREEN_GPIO GPIO_PC2 /**< Green LED GPIO pin */ -#define LED_ORANGE_GPIO GPIO_PC3 /**< Orange LED GPIO pin */ - -#define LED_RED_ON cc2538_gpio_set(LED_GREEN_GPIO) -#define LED_RED_OFF cc2538_gpio_clear(LED_GREEN_GPIO) -#define LED_RED_TOGGLE cc2538_gpio_toggle(LED_GREEN_GPIO) - -#define LED_YELLOW_ON cc2538_gpio_set(LED_YELLOW_GPIO) -#define LED_YELLOW_OFF cc2538_gpio_clear(LED_YELLOW_GPIO) -#define LED_YELLOW_TOGGLE cc2538_gpio_toggle(LED_YELLOW_GPIO) - -#define LED_GREEN_ON cc2538_gpio_set(LED_GREEN_GPIO) -#define LED_GREEN_OFF cc2538_gpio_clear(LED_GREEN_GPIO) -#define LED_GREEN_TOGGLE cc2538_gpio_toggle(LED_GREEN_GPIO) - -#define LED_ORANGE_ON cc2538_gpio_set(LED_ORANGE_GPIO) -#define LED_ORANGE_OFF cc2538_gpio_clear(LED_ORANGE_GPIO) -#define LED_ORANGE_TOGGLE cc2538_gpio_toggle(LED_ORANGE_GPIO) - -/* Default to red if the color is not specified: */ -#define LED_ON LED_RED_ON -#define LED_OFF LED_RED_OFF -#define LED_TOGGLE LED_RED_TOGGLE +#define LED0_PIN GPIO_PIN(2, 0) +#define LED1_PIN GPIO_PIN(2, 1) +#define LED2_PIN GPIO_PIN(2, 2) +#define LED3_PIN GPIO_PIN(2, 3) + +#define LED0_GPIO GPIO_PC0 /**< red LED */ +#define LED1_GPIO GPIO_PC1 /**< yellow LED */ +#define LED2_GPIO GPIO_PC2 /**< green LED */ +#define LED3_GPIO GPIO_PC3 /**< orange LED */ + +#define LED0_ON cc2538_gpio_set(LED0_GPIO) +#define LED0_OFF cc2538_gpio_clear(LED0_GPIO) +#define LED0_TOGGLE cc2538_gpio_toggle(LED0_GPIO) + +#define LED1_ON cc2538_gpio_set(LED1_GPIO) +#define LED1_OFF cc2538_gpio_clear(LED1_GPIO) +#define LED1_TOGGLE cc2538_gpio_toggle(LED1_GPIO) + +#define LED2_ON cc2538_gpio_set(LED2_GPIO) +#define LED2_OFF cc2538_gpio_clear(LED2_GPIO) +#define LED2_TOGGLE cc2538_gpio_toggle(LED2_GPIO) + +#define LED3_ON cc2538_gpio_set(LED3_GPIO) +#define LED3_OFF cc2538_gpio_clear(LED3_GPIO) +#define LED3_TOGGLE cc2538_gpio_toggle(LED3_GPIO) /** @} */ /**