aboutsummaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2007-10-03 18:18:58 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2007-10-03 18:18:58 +0000
commitdd18ff8898aaeef5c34012da4f537f057cd0b082 (patch)
tree86bb66a785e3fd1cb31d5bae5e7110d5a40a2274 /demos
parent2310f80695b4051cb63ca14878dfc5e76acb94e6 (diff)
downloadChibiOS-dd18ff8898aaeef5c34012da4f537f057cd0b082.tar.gz
ChibiOS-dd18ff8898aaeef5c34012da4f537f057cd0b082.tar.bz2
ChibiOS-dd18ff8898aaeef5c34012da4f537f057cd0b082.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@31 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'demos')
-rw-r--r--demos/LPC214x-GCC/Makefile2
-rw-r--r--demos/LPC214x-GCC/main.c19
-rw-r--r--demos/LPC214x-GCC/readme.txt3
3 files changed, 16 insertions, 8 deletions
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.