From 9d359d8a3b3eb87a58764ac2c696bc10037c480f Mon Sep 17 00:00:00 2001 From: gdisirio Date: Fri, 21 Aug 2009 11:31:50 +0000 Subject: [PATCH] git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1101 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/ARM7-AT91SAM7X-WEB-GCC/Makefile | 12 +++++++----- demos/ARM7-AT91SAM7X-WEB-GCC/board.c | 6 +++--- demos/ARM7-AT91SAM7X-WEB-GCC/main.c | 11 ++++++++--- 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/demos/ARM7-AT91SAM7X-WEB-GCC/Makefile b/demos/ARM7-AT91SAM7X-WEB-GCC/Makefile index 0e881c364..1484fefb2 100644 --- a/demos/ARM7-AT91SAM7X-WEB-GCC/Makefile +++ b/demos/ARM7-AT91SAM7X-WEB-GCC/Makefile @@ -63,11 +63,12 @@ CSRC = ${PORTSRC} \ ${TESTSRC} \ ${USRC} \ ../../os/io/pal.c \ - ../../os/ports/GCC/ARM7/AT91SAM7X/pal_lld.c \ - ../../os/ports/GCC/ARM7/AT91SAM7X/sam7x_serial.c \ - ../../os/ports/GCC/ARM7/AT91SAM7X/sam7x_emac.c \ + ../../os/io/serial.c \ + ../../os/io/platforms/AT91SAM7X/pal_lld.c \ + ../../os/io/platforms/AT91SAM7X/serial_lld.c \ + ../../os/io/platforms/AT91SAM7X/sam7x_emac.c \ + ../../os/io/platforms/AT91SAM7X/at91lib/aic.c \ ../../os/various/evtimer.c \ - at91lib/aic.c \ web/webthread.c \ board.c main.c @@ -101,8 +102,9 @@ ASMSRC = $(PORTASM) \ INCDIR = $(PORTINC) $(KERNINC) $(TESTINC) \ ../../os/io \ - ../../os/ports/GCC/ARM7/AT91SAM7X \ + ../../os/io/platforms/AT91SAM7X \ ../../os/various \ + ../../os/ports/GCC/ARM7/AT91SAM7X \ ./web ../../ext/uip-1.0/uip ../../ext/uip-1.0/apps/webserver # diff --git a/demos/ARM7-AT91SAM7X-WEB-GCC/board.c b/demos/ARM7-AT91SAM7X-WEB-GCC/board.c index 4557d3c91..51efb3c6d 100644 --- a/demos/ARM7-AT91SAM7X-WEB-GCC/board.c +++ b/demos/ARM7-AT91SAM7X-WEB-GCC/board.c @@ -19,12 +19,12 @@ #include #include +#include +#include #include "board.h" #include "at91lib/aic.h" -#include -#include /* * FIQ Handler weak symbol defined in vectors.s. @@ -170,7 +170,7 @@ void hwinit1(void) { /* * Serial driver initialization, RTS/CTS pins enabled for USART0 only. */ - serial_init(AT91C_AIC_PRIOR_HIGHEST - 2, AT91C_AIC_PRIOR_HIGHEST - 2); + sdInit(); AT91C_BASE_PIOA->PIO_PDR = AT91C_PA3_RTS0 | AT91C_PA4_CTS0; AT91C_BASE_PIOA->PIO_ASR = AT91C_PIO_PA3 | AT91C_PIO_PA4; AT91C_BASE_PIOA->PIO_PPUDR = AT91C_PIO_PA3 | AT91C_PIO_PA4; diff --git a/demos/ARM7-AT91SAM7X-WEB-GCC/main.c b/demos/ARM7-AT91SAM7X-WEB-GCC/main.c index 0eafb2260..e18d83d71 100644 --- a/demos/ARM7-AT91SAM7X-WEB-GCC/main.c +++ b/demos/ARM7-AT91SAM7X-WEB-GCC/main.c @@ -20,10 +20,10 @@ #include #include #include +#include +#include #include "board.h" -#include -#include #include "web/webthread.h" @@ -47,6 +47,11 @@ static msg_t Thread1(void *arg) { */ int main(int argc, char **argv) { + /* + * Activates the communication port 1 using the driver default configuration. + */ + sdStart(&COM1, NULL); + /* * Creates the blinker and web server threads. */ @@ -59,7 +64,7 @@ int main(int argc, char **argv) { while (TRUE) { chThdSleepMilliseconds(500); if (!palReadPad(IOPORT_B, PIOB_SW1)) - chFDDWrite(&COM1, (uint8_t *)"Hello World!\r\n", 14); + sdWrite(&COM1, (uint8_t *)"Hello World!\r\n", 14); if (!palReadPad(IOPORT_B, PIOB_SW2)) TestThread(&COM1); }