Skip to content

Commit

Permalink
concrete board implementation
Browse files Browse the repository at this point in the history
Fixes #8
  • Loading branch information
jserv committed Jul 19, 2013
1 parent 96950c0 commit bb3d532
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 18 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ include board/$(BOARD)/build.mk

# Transform the configuration into make variables
includes = \
board/$(BOARD) \
include \
include/platform \
include/platform/$(CHIP) \
$(dirs) $(out)
$(eval BOARD_$(BOARD)=y)

Expand Down
4 changes: 3 additions & 1 deletion Makefile.toolchain
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ CFLAGS_WARN = -Wall
CFLAGS_DEBUG= -g3
CFLAGS_INCLUDE=$(foreach i,$(includes),-I$(i) )
CFLAGS_DEFINE = \
-D __PLATFORM__=$(CHIP) -D __BOARD_HEADER__="$(BOARD).h" \
-D __PLATFORM__=$(CHIP) \
-D __BOARD__=$(BOARD) \
-D'INC_PLAT(x)=<platform/__PLATFORM__/x>' \
-DDEBUG
CPPFLAGS = \
$(CFLAGS_DEFINE) $(CFLAGS_INCLUDE) $(EXTRA_CFLAGS)
Expand Down
6 changes: 3 additions & 3 deletions board/discoveryf4/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
* found in the LICENSE file.
*/

#include "platform/stm32f4/discoveryf4.h"
#include <platform/stm32f4/gpio.h>
#include <platform/stm32f4/usart.h>

/* FIXME: should be generated by build system */
struct usart_dev console_uart = {
.u_num = 4,
.baud = 115200,
.base = UART4_BASE,
.rcc_apbenr = RCC_UART4_APBENR,
.rcc_reset = RCC_APB1RSTR_USART4RST,
.tx = {
.tx = {
.port = GPIOA,
.pin = 0,
.pupd = GPIO_PUPDR_NONE,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
* found in the LICENSE file.
*/

#ifndef PLATFORM_STM32F4_DISCOVERYF4_H_
#define PLATFORM_STM32F4_DISCOVERYF4_H_
#ifndef DISCOVERYF4_BOARD_H_
#define DISCOVERYF4_BOARD_H_

#include <platform/stm32f4/registers.h>
#include <platform/stm32f4/gpio.h>
Expand All @@ -14,4 +14,4 @@

extern struct usart_dev console_uart;

#endif /* PLATFORM_STM32F4_DISCOVERYF4_H_ */
#endif /* DISCOVERYF4_BOARD_H_ */
6 changes: 2 additions & 4 deletions kernel/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@

#include <platform/debug_uart.h>

/* FIXME: move to platform specific */
#define INC_PLAT(x) <platform/__PLATFORM__/x>
#include INC_PLAT(nvic.h)

#include <debug.h>
#include <error.h>

Expand Down Expand Up @@ -48,6 +44,8 @@ void nmi_handler()

extern void (* const g_pfnVectors[])();

#include INC_PLAT(nvic.h)

__ISR_VECTOR
void (* const g_pfnVectors[])() = {
/* Core Level - ARM Cortex-M */
Expand Down
2 changes: 0 additions & 2 deletions kernel/ktimer.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
* found in the LICENSE file.
*/

/* FIXME: move to platform specific */
#define INC_PLAT(x) <platform/__PLATFORM__/x>
#include INC_PLAT(systick.h)

#include <debug.h>
Expand Down
2 changes: 0 additions & 2 deletions kernel/start.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
* __l4_start initializes microcontroller
*/

/* FIXME: move to platform specific */
#define INC_PLAT(x) <platform/__PLATFORM__/x>
#include INC_PLAT(gpio.h)
#include INC_PLAT(rcc.h)

Expand Down
4 changes: 2 additions & 2 deletions platform/debug_uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
#include <lib/fifo.h>
#include <softirq.h>

#define INC_PLAT(x) <platform/__PLATFORM__/x>
#include INC_PLAT(__BOARD_HEADER__)
/* board speficic UART definitions */
#include "board.h"

static struct dbg_uart_t dbg_uart;
static uint8_t dbg_uart_tx_buffer[SEND_BUFSIZE];
Expand Down

0 comments on commit bb3d532

Please sign in to comment.