From 979da150361becdb50625d056915f81099710122 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 4 Jul 2009 14:05:29 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1055 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/ARM7-LPC214x-GCC-minimal/Makefile | 1 + demos/ARM7-LPC214x-GCC-minimal/board.c | 28 ++++++++++++++++++++-------- demos/ARM7-LPC214x-GCC-minimal/board.h | 2 ++ 3 files changed, 23 insertions(+), 8 deletions(-) (limited to 'demos/ARM7-LPC214x-GCC-minimal') diff --git a/demos/ARM7-LPC214x-GCC-minimal/Makefile b/demos/ARM7-LPC214x-GCC-minimal/Makefile index 2ea142e81..a00eb9c65 100644 --- a/demos/ARM7-LPC214x-GCC-minimal/Makefile +++ b/demos/ARM7-LPC214x-GCC-minimal/Makefile @@ -50,6 +50,7 @@ include ../../src/kernel.mk # setting. CSRC = ../../ports/ARM7/chcore.c \ ../../ports/ARM7-LPC214x/vic.c \ + ../../ports/ARM7-LPC214x/pal_lld.c \ ${KERNSRC} \ board.c main.c diff --git a/demos/ARM7-LPC214x-GCC-minimal/board.c b/demos/ARM7-LPC214x-GCC-minimal/board.c index 2e56028cc..980626ab5 100644 --- a/demos/ARM7-LPC214x-GCC-minimal/board.c +++ b/demos/ARM7-LPC214x-GCC-minimal/board.c @@ -58,6 +58,18 @@ static CH_IRQ_HANDLER(T0IrqHandler) { CH_IRQ_EPILOGUE(); } +/* + * Digital I/O ports static configuration as defined in @p board.h. + */ +static const LPC214xFIOConfig config = +{ + VAL_PINSEL0, + VAL_PINSEL1, + VAL_PINSEL2, + {VAL_FIO0PIN, VAL_FIO0DIR}, + {VAL_FIO1PIN, VAL_FIO1DIR} +}; + /* * Early initialization code. * This initialization is performed just after reset before BSS and DATA @@ -101,14 +113,14 @@ void hwinit0(void) { /* * I/O pins configuration. */ - PINSEL0 = VAL_PINSEL0; - PINSEL1 = VAL_PINSEL1; - PINSEL2 = VAL_PINSEL2; - palInit(); - pal_lld_lpc214x_set_direction(IOPORT_A, VAL_FIO0DIR); - palWritePort(IOPORT_A, 0xFFFFFFFF); - pal_lld_lpc214x_set_direction(IOPORT_B, VAL_FIO1DIR); - palWritePort(IOPORT_B, 0xFFFFFFFF); +// PINSEL0 = VAL_PINSEL0; +// PINSEL1 = VAL_PINSEL1; +// PINSEL2 = VAL_PINSEL2; + palInit(&config); +// pal_lld_lpc214x_set_direction(IOPORT_A, VAL_FIO0DIR); +// palWritePort(IOPORT_A, 0xFFFFFFFF); +// pal_lld_lpc214x_set_direction(IOPORT_B, VAL_FIO1DIR); +// palWritePort(IOPORT_B, 0xFFFFFFFF); } /* diff --git a/demos/ARM7-LPC214x-GCC-minimal/board.h b/demos/ARM7-LPC214x-GCC-minimal/board.h index fee4baa61..ab4aa76f6 100644 --- a/demos/ARM7-LPC214x-GCC-minimal/board.h +++ b/demos/ARM7-LPC214x-GCC-minimal/board.h @@ -64,6 +64,8 @@ #define VAL_PINSEL2 0x00000004 #define VAL_FIO0DIR 0xB0703C00 #define VAL_FIO1DIR 0x00000000 +#define VAL_FIO0PIN 0x00000000 +#define VAL_FIO1PIN 0x00000000 #define PA_LED1 10 #define PA_LED2 11 -- cgit v1.2.3