From b7bf9c3d8e41c9a8411b8a52080d54582c037657 Mon Sep 17 00:00:00 2001 From: haukepetersen Date: Tue, 16 Jun 2015 00:01:31 +0200 Subject: [PATCH] boards/pca10000: some cleanup - fixed some doxygen style issues - fixed some newline issues - compacted the board initialization code --- boards/pca10000/board.c | 37 ++++++--------------------------- boards/pca10000/include/board.h | 25 +++++++++++----------- 2 files changed, 18 insertions(+), 44 deletions(-) diff --git a/boards/pca10000/board.c b/boards/pca10000/board.c index 8bfaa47e6f2a..62875d180fed 100644 --- a/boards/pca10000/board.c +++ b/boards/pca10000/board.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014 Freie Universität Berlin + * Copyright (C) 2014-2015 Freie Universität Berlin * * This file is subject to the terms and conditions of the GNU Lesser General * Public License v2.1. See the file LICENSE in the top level directory for more @@ -11,7 +11,7 @@ * @{ * * @file - * @brief Board specific implementations for the nRF51822 evaluation board pca10000 + * @brief Board initialization code for the Nordic PCA10000 board * * @author Christian Kühling * @author Timo Ziegler @@ -19,39 +19,14 @@ * @} */ -#include -#include "board.h" #include "cpu.h" -#include "periph/uart.h" - -extern void SystemInit(void); - -void leds_init(void); +#include "board.h" void board_init(void) { - /* initialize the boards LEDs */ - leds_init(); - - /* initialize the CPU */ - cpu_init(); -} - -/** - * @brief Initialize the boards on-board RGB LED - * - * The LED initialization is hard-coded in this function. - * - * The LED channels are connected to the following pins: - * - RED: 21 - * - GREEN: 22 - * - BLUE: 23 - */ -void leds_init(void) -{ - /* set LED pins to function as output */ + /* initialize the boards LEDs: set pins to output and turn LEDs off */ NRF_GPIO->DIRSET = (LED_RED_PIN | LED_GREEN_PIN | LED_BLUE_PIN); - - /* turn all LEDs off (low active) */ NRF_GPIO->OUTSET = (LED_RED_PIN | LED_GREEN_PIN | LED_BLUE_PIN); + /* trigger the CPU initialization code */ + cpu_init(); } diff --git a/boards/pca10000/include/board.h b/boards/pca10000/include/board.h index b46178eb70d8..e1f841d7d2bd 100644 --- a/boards/pca10000/include/board.h +++ b/boards/pca10000/include/board.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2014 Freie Universität Berlin + * Copyright (C) 2014-2015 Freie Universität Berlin * * This file is subject to the terms and conditions of the GNU Lesser General * Public License v2.1. See the file LICENSE in the top level directory for more @@ -7,20 +7,20 @@ */ /** - * @defgroup boards_pca10000 PCA10000 (nRF51822 Development Kit) + * @defgroup boards_pca10000 Nordic PCA10000 * @ingroup boards - * @brief Board specific files for the nRF51822 board pca10000. + * @brief Board specific files for the Nordic PCA100000 * @{ * * @file - * @brief Board specific definitions for the nRF51822 evaluation board pca10000. + * @brief Board configuration for the Nordic PCA10000 board * * @author Christian Kühling * @author Timo Ziegler */ -#ifndef BOARD_H_ -#define BOARD_H_ +#ifndef BOARD_H +#define BOARD_H #include "cpu.h" @@ -29,17 +29,17 @@ extern "C" { #endif /** - * Define the nominal CPU core clock in this board + * @brief Define the nominal CPU core clock in this board */ #define F_CPU (16000000UL) /** - * @brief Assign the hardware timer + * @brief Assign the hardware timer */ #define HW_TIMER TIMER_0 /** - * @name Define the boards stdio + * @name Define the boards stdio * @{ */ #define STDIO UART_0 @@ -48,7 +48,7 @@ extern "C" { /** @} */ /** - * @name LED pin definitions + * @name LED pin definitions * @{ */ #define ONBOARD_LED 1 @@ -72,9 +72,8 @@ extern "C" { #define LED_BLUE_TOGGLE (NRF_GPIO->OUT ^= LED_BLUE_PIN) /** @} */ - /** - * @brief Initialize board specific hardware, including clock, LEDs and std-IO + * @brief Initialize the board, including triggering the CPU initialization */ void board_init(void); @@ -82,5 +81,5 @@ void board_init(void); } #endif -#endif /* BOARD_H_ */ +#endif /** BOARD_H */ /** @} */