From dd18ff8898aaeef5c34012da4f537f057cd0b082 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Wed, 3 Oct 2007 18:18:58 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@31 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/LPC214x-GCC/Makefile | 2 +- demos/LPC214x-GCC/main.c | 19 +++++++++++++------ demos/LPC214x-GCC/readme.txt | 3 ++- 3 files changed, 16 insertions(+), 8 deletions(-) (limited to 'demos') diff --git a/demos/LPC214x-GCC/Makefile b/demos/LPC214x-GCC/Makefile index 7f75b31b2..8400d8f82 100644 --- a/demos/LPC214x-GCC/Makefile +++ b/demos/LPC214x-GCC/Makefile @@ -63,7 +63,7 @@ UADEFS = # List ARM-mode C source files here ASRC = chcore.c main.c buzzer.c \ - ../../ports/ARM7-LPC214x/GCC/lpc214x_serial.c \ + ../../test/test.c ../../ports/ARM7-LPC214x/GCC/lpc214x_serial.c \ ../../src/chinit.c ../../src/chlists.c ../../src/chdelta.c ../../src/chschd.c \ ../../src/chthreads.c ../../src/chsem.c ../../src/chevents.c ../../src/chmsg.c \ ../../src/chsleep.c ../../src/chqueues.c ../../src/chserial.c diff --git a/demos/LPC214x-GCC/main.c b/demos/LPC214x-GCC/main.c index c925671e9..0183b276b 100644 --- a/demos/LPC214x-GCC/main.c +++ b/demos/LPC214x-GCC/main.c @@ -53,15 +53,22 @@ static t_msg Thread2(void *arg) { return 0; } -static BYTE8 waThread3[UserStackSize(32)]; +static BYTE8 waThread3[UserStackSize(64)]; static t_msg Thread3(void *arg) { - + t_msg TestThread(void *p); + while (TRUE) { - if (!(IO0PIN & 0x00008000)) // Button 1 - PlaySound(1000, 100); - if (!(IO0PIN & 0x00010000)) // Button 2 - chFDDWrite(&COM1, (BYTE8 *)"Hello World!\r\n", 14); + if (!(IO0PIN & 0x00018000)) { + TestThread(&COM1); + PlaySound(500, 100); + } + else { + if (!(IO0PIN & 0x00008000)) // Button 1 + PlaySound(1000, 100); + if (!(IO0PIN & 0x00010000)) // Button 2 + chFDDWrite(&COM1, (BYTE8 *)"Hello World!\r\n", 14); + } chThdSleep(500); } return 0; diff --git a/demos/LPC214x-GCC/readme.txt b/demos/LPC214x-GCC/readme.txt index c39f179d2..f55f5b4c6 100644 --- a/demos/LPC214x-GCC/readme.txt +++ b/demos/LPC214x-GCC/readme.txt @@ -11,7 +11,8 @@ members of the LPC2000 family should be an easy task. The demo blinks the leds on the board by using multiple threads. By pressing the buttons on the board it is possible to activate the buzzer and send a -message over the serial ports. +message over the serial ports. Pressing both buttons activates the test +procedure on the serial port 1. See main.c for details. Buzzer.c contains an interesting device driver example that uses a physical timer for the waveform generation and a virtual timer for the sound duration. -- cgit v1.2.3