aboutsummaryrefslogtreecommitdiffstats
path: root/demos/ARM7-LPC214x-GCC
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2008-11-15 10:19:57 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2008-11-15 10:19:57 +0000
commitae97c97b114c0e56d9881d54fbc97a052976b25a (patch)
tree149200cc5cef7053572e983212253874faa3e139 /demos/ARM7-LPC214x-GCC
parentbc3964df2684cd45fde0802597f4cdf1face4a12 (diff)
downloadChibiOS-ae97c97b114c0e56d9881d54fbc97a052976b25a.tar.gz
ChibiOS-ae97c97b114c0e56d9881d54fbc97a052976b25a.tar.bz2
ChibiOS-ae97c97b114c0e56d9881d54fbc97a052976b25a.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@510 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'demos/ARM7-LPC214x-GCC')
-rw-r--r--demos/ARM7-LPC214x-GCC/main.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/demos/ARM7-LPC214x-GCC/main.c b/demos/ARM7-LPC214x-GCC/main.c
index 9b231408f..90dece112 100644
--- a/demos/ARM7-LPC214x-GCC/main.c
+++ b/demos/ARM7-LPC214x-GCC/main.c
@@ -34,13 +34,13 @@ static msg_t Thread1(void *arg) {
while (TRUE) {
IO0CLR = 0x00000800;
- chThdSleep(200);
+ chThdSleepMilliseconds(200);
IO0SET = 0x00000C00;
- chThdSleep(800);
+ chThdSleepMilliseconds(800);
IO0CLR = 0x00000400;
- chThdSleep(200);
+ chThdSleepMilliseconds(200);
IO0SET = 0x00000C00;
- chThdSleep(800);
+ chThdSleepMilliseconds(800);
}
return 0;
}
@@ -53,9 +53,9 @@ static msg_t Thread2(void *arg) {
while (TRUE) {
IO0CLR = 0x80000000;
- chThdSleep(200);
+ chThdSleepMilliseconds(200);
IO0SET = 0x80000000;
- chThdSleep(300);
+ chThdSleepMilliseconds(300);
}
return 0;
}
@@ -71,14 +71,14 @@ static void TimerHandler(eventid_t id) {
Thread *tp = chThdCreateStatic(waTestThread, sizeof(waTestThread),
NORMALPRIO, TestThread, &COM1);
chThdWait(tp);
- PlaySound(500, 100);
+ PlaySound(500, MS2ST(100));
}
else {
if (!(IO0PIN & 0x00008000)) // Button 1
- PlaySound(1000, 100);
+ PlaySound(1000, MS2ST(100));
if (!(IO0PIN & 0x00010000)) { // Button 2
chFDDWrite(&COM1, (uint8_t *)"Hello World!\r\n", 14);
- PlaySound(2000, 100);
+ PlaySound(2000, MS2ST(100));
}
}
}
@@ -91,8 +91,8 @@ static void InsertHandler(eventid_t id) {
static uint8_t rwbuf[512];
MMCCSD data;
- PlaySoundWait(1000, 100);
- PlaySoundWait(2000, 100);
+ PlaySoundWait(1000, MS2ST(100));
+ PlaySoundWait(2000, MS2ST(100));
if (mmcInit())
return;
/* Card ready, do stuff.*/
@@ -100,7 +100,7 @@ static void InsertHandler(eventid_t id) {
return;
if (mmcRead(rwbuf, 0))
return;
- PlaySound(440, 200);
+ PlaySound(440, MS2ST(200));
}
/*
@@ -108,8 +108,8 @@ static void InsertHandler(eventid_t id) {
*/
static void RemoveHandler(eventid_t id) {
- PlaySoundWait(2000, 100);
- PlaySoundWait(1000, 100);
+ PlaySoundWait(2000, MS2ST(100));
+ PlaySoundWait(1000, MS2ST(100));
}
/*
@@ -138,13 +138,13 @@ int main(int argc, char **argv) {
* Normal main() activity, in this demo it serves events generated by
* various sources.
*/
- evtInit(&evt, 500); /* Initializes an event timer object. */
+ evtInit(&evt, MS2ST(500)); /* Initializes an event timer object. */
evtStart(&evt); /* Starts the event timer. */
chEvtRegister(&evt.et_es, &el0, 0); /* Registers on the timer event source. */
mmcStartPolling(); /* Starts the MMC connector polling. */
chEvtRegister(&MMCInsertEventSource, &el1, 1);
chEvtRegister(&MMCRemoveEventSource, &el2, 2);
while (TRUE) /* Just serve events. */
- chEvtWait(ALL_EVENTS, evhndl);
+ chEvtDispatch(evhndl, chEvtWaitOne(ALL_EVENTS));
return 0;
}