aboutsummaryrefslogtreecommitdiffstats
path: root/demos/AVR-AT90CANx-GCC/main.c
diff options
context:
space:
mode:
authorbarthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-12-08 20:17:13 +0000
committerbarthess <barthess@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-12-08 20:17:13 +0000
commit4ca9e4ad312453e11c17746aaa01b4fb637eb83a (patch)
treeb8ad2a8049314384e30f414b146ee4a875fbc953 /demos/AVR-AT90CANx-GCC/main.c
parent8a3ce5e27333e4dc6bd8047c440b84f3060d7d0e (diff)
parent8196de6aef7616f7df96d757dddc9cfa9eb661dc (diff)
downloadChibiOS-4ca9e4ad312453e11c17746aaa01b4fb637eb83a.tar.gz
ChibiOS-4ca9e4ad312453e11c17746aaa01b4fb637eb83a.tar.bz2
ChibiOS-4ca9e4ad312453e11c17746aaa01b4fb637eb83a.zip
RTC for F4x branch.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/rtc_dev@3585 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'demos/AVR-AT90CANx-GCC/main.c')
-rw-r--r--demos/AVR-AT90CANx-GCC/main.c32
1 files changed, 8 insertions, 24 deletions
diff --git a/demos/AVR-AT90CANx-GCC/main.c b/demos/AVR-AT90CANx-GCC/main.c
index d039c6cf6..50d43a7f9 100644
--- a/demos/AVR-AT90CANx-GCC/main.c
+++ b/demos/AVR-AT90CANx-GCC/main.c
@@ -20,34 +20,22 @@
#include "ch.h"
#include "hal.h"
-#include "evtimer.h"
+#include "test.h"
static WORKING_AREA(waThread1, 32);
static msg_t Thread1(void *arg) {
while (TRUE) {
- PORTE ^= PORTE_LED;
- chThdSleepMilliseconds(500);
+ palTogglePad(IOPORT5, PORTE_LED);
+ chThdSleepMilliseconds(500);
}
return 0;
}
-static void TimerHandler(eventid_t id) {
- msg_t TestThread(void *p);
-
- if (!(PORTE & PORTE_BUTTON))
- TestThread(&SD2);
-}
-
/*
* Application entry point.
*/
int main(void) {
- static EvTimer evt;
- static evhandler_t handlers[1] = {
- TimerHandler
- };
- static EventListener el0;
/*
* System initializations.
@@ -65,19 +53,15 @@ int main(void) {
sdStart(&SD2, NULL);
/*
- * Event Timer initialization.
- */
- 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. */
-
- /*
* Starts the LED blinker thread.
*/
chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL);
- while(TRUE)
- chEvtDispatch(handlers, chEvtWaitOne(ALL_EVENTS));
+ while(TRUE) {
+ if (!palReadPad(IOPORT5, PORTE_BUTTON))
+ TestThread(&SD2);
+ chThdSleepMilliseconds(500);
+ }
return 0;
}