From 058d1967c81597f036d49520a33ceba5c2dce31d Mon Sep 17 00:00:00 2001 From: Hauke Petersen Date: Fri, 11 Mar 2016 18:04:26 +0100 Subject: [PATCH] boards/nucleo-l1: unified LED defines --- boards/nucleo-l1/board.c | 33 ++------------------------------- 1 file changed, 2 insertions(+), 31 deletions(-) diff --git a/boards/nucleo-l1/board.c b/boards/nucleo-l1/board.c index f0cd52b14d..89f78ade69 100644 --- a/boards/nucleo-l1/board.c +++ b/boards/nucleo-l1/board.c @@ -19,9 +19,7 @@ */ #include "board.h" -#include "cpu.h" - -static void leds_init(void); +#include "periph/gpio.h" void board_init(void) { @@ -29,32 +27,5 @@ void board_init(void) cpu_init(); /* initialize the boards LEDs */ - leds_init(); -} - -/** - * @brief Initialize the boards on-board LEDs - * - * The LED initialization is hard-coded in this function. As the LED is soldered - * onto the board it is fixed to its CPU pins. - * - * The green LED is connected to pin PA5 - */ -static void leds_init(void) -{ - /* enable clock for port GPIOE */ - RCC->AHBENR |= RCC_AHBENR_GPIOAEN; - - /* set output speed to 50MHz */ - LED_GREEN_PORT->OSPEEDR |= 0x00000c00; - /* set output type to push-pull */ - LED_GREEN_PORT->OTYPER &= ~(0x00000020); - /* configure pins as general outputs */ - LED_GREEN_PORT->MODER &= ~(0x00000c00); - LED_GREEN_PORT->MODER |= 0x00000400; - /* disable pull resistors */ - LED_GREEN_PORT->PUPDR &= ~(0x00000c00); - - /* turn all LEDs off */ - LED_GREEN_PORT->BRR = 0x00c0; + gpio_init(LED0_PIN, GPIO_DIR_OUT, GPIO_NOPULL); }