Added sounds to the FatFS demo.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1447 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
parent
af494b355e
commit
d8db6bd8dc
|
@ -24,6 +24,7 @@
|
||||||
#include "hal.h"
|
#include "hal.h"
|
||||||
#include "test.h"
|
#include "test.h"
|
||||||
#include "evtimer.h"
|
#include "evtimer.h"
|
||||||
|
#include "buzzer.h"
|
||||||
|
|
||||||
#include "ff.h"
|
#include "ff.h"
|
||||||
|
|
||||||
|
@ -172,6 +173,7 @@ static void TimerHandler(eventid_t id) {
|
||||||
Thread *tp = chThdCreateStatic(waTestThread, sizeof(waTestThread),
|
Thread *tp = chThdCreateStatic(waTestThread, sizeof(waTestThread),
|
||||||
NORMALPRIO, TestThread, &SD1);
|
NORMALPRIO, TestThread, &SD1);
|
||||||
chThdWait(tp);
|
chThdWait(tp);
|
||||||
|
buzzPlay(500, MS2ST(100));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -182,6 +184,8 @@ static void InsertHandler(eventid_t id) {
|
||||||
FRESULT err;
|
FRESULT err;
|
||||||
|
|
||||||
(void)id;
|
(void)id;
|
||||||
|
buzzPlayWait(1000, MS2ST(100));
|
||||||
|
buzzPlayWait(2000, MS2ST(100));
|
||||||
iprintf("MMC: inserted\r\n");
|
iprintf("MMC: inserted\r\n");
|
||||||
/*
|
/*
|
||||||
* On insertion MMC initialization and FS mount.
|
* On insertion MMC initialization and FS mount.
|
||||||
|
@ -201,6 +205,7 @@ static void InsertHandler(eventid_t id) {
|
||||||
}
|
}
|
||||||
fs_ready = TRUE;
|
fs_ready = TRUE;
|
||||||
iprintf("ok\r\n");
|
iprintf("ok\r\n");
|
||||||
|
buzzPlay(440, MS2ST(200));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -211,6 +216,8 @@ static void RemoveHandler(eventid_t id) {
|
||||||
(void)id;
|
(void)id;
|
||||||
iprintf("MMC: removed\r\n");
|
iprintf("MMC: removed\r\n");
|
||||||
fs_ready = FALSE;
|
fs_ready = FALSE;
|
||||||
|
buzzPlayWait(2000, MS2ST(100));
|
||||||
|
buzzPlayWait(1000, MS2ST(100));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -234,6 +241,11 @@ int main(int argc, char **argv) {
|
||||||
*/
|
*/
|
||||||
sdStart(&SD1, NULL);
|
sdStart(&SD1, NULL);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Buzzer driver initialization.
|
||||||
|
*/
|
||||||
|
buzzInit();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Initializes the MMC driver to work with SPI2.
|
* Initializes the MMC driver to work with SPI2.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue