aboutsummaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
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.