aboutsummaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2009-12-20 13:15:00 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2009-12-20 13:15:00 +0000
commitd8db6bd8dc1496db7f50e480b81793a990f0b1df (patch)
tree35f7a5b831aec0b63dec367ed77da7fa1a265bf2 /demos
parentaf494b355e7354e2cc3034a0465100876f9c136f (diff)
downloadChibiOS-d8db6bd8dc1496db7f50e480b81793a990f0b1df.tar.gz
ChibiOS-d8db6bd8dc1496db7f50e480b81793a990f0b1df.tar.bz2
ChibiOS-d8db6bd8dc1496db7f50e480b81793a990f0b1df.zip
Added sounds to the FatFS demo.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1447 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'demos')
-rw-r--r--demos/ARM7-LPC214x-FatFS-GCC/main.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/demos/ARM7-LPC214x-FatFS-GCC/main.c b/demos/ARM7-LPC214x-FatFS-GCC/main.c
index 8da531413..70d1605bf 100644
--- a/demos/ARM7-LPC214x-FatFS-GCC/main.c
+++ b/demos/ARM7-LPC214x-FatFS-GCC/main.c
@@ -24,6 +24,7 @@
#include "hal.h"
#include "test.h"
#include "evtimer.h"
+#include "buzzer.h"
#include "ff.h"
@@ -172,6 +173,7 @@ static void TimerHandler(eventid_t id) {
Thread *tp = chThdCreateStatic(waTestThread, sizeof(waTestThread),
NORMALPRIO, TestThread, &SD1);
chThdWait(tp);
+ buzzPlay(500, MS2ST(100));
}
}
@@ -182,6 +184,8 @@ static void InsertHandler(eventid_t id) {
FRESULT err;
(void)id;
+ buzzPlayWait(1000, MS2ST(100));
+ buzzPlayWait(2000, MS2ST(100));
iprintf("MMC: inserted\r\n");
/*
* On insertion MMC initialization and FS mount.
@@ -201,6 +205,7 @@ static void InsertHandler(eventid_t id) {
}
fs_ready = TRUE;
iprintf("ok\r\n");
+ buzzPlay(440, MS2ST(200));
}
/*
@@ -211,6 +216,8 @@ static void RemoveHandler(eventid_t id) {
(void)id;
iprintf("MMC: removed\r\n");
fs_ready = FALSE;
+ buzzPlayWait(2000, MS2ST(100));
+ buzzPlayWait(1000, MS2ST(100));
}
/*
@@ -235,6 +242,11 @@ int main(int argc, char **argv) {
sdStart(&SD1, NULL);
/*
+ * Buzzer driver initialization.
+ */
+ buzzInit();
+
+ /*
* Initializes the MMC driver to work with SPI2.
*/
mmcObjectInit(&MMCD1, &SPID1,