From d3ff29c1893323a3749e0c7f45a5d1541430929b Mon Sep 17 00:00:00 2001 From: gdisirio Date: Fri, 7 Mar 2008 15:24:00 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@219 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/AVR-ATmega128-GCC/main.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'demos/AVR-ATmega128-GCC/main.c') diff --git a/demos/AVR-ATmega128-GCC/main.c b/demos/AVR-ATmega128-GCC/main.c index 29a19701b..53fe21b2d 100644 --- a/demos/AVR-ATmega128-GCC/main.c +++ b/demos/AVR-ATmega128-GCC/main.c @@ -24,6 +24,7 @@ #include #include "board.h" +#include "lcd.h" void hwinit(void); @@ -31,7 +32,8 @@ static WorkingArea(waThread1, 32); static msg_t Thread1(void *arg) { while (TRUE) { - PORTA ^= PORTA_RELAY; + if (!(PINA & PORTA_BUTTON2)) + PORTA ^= PORTA_RELAY; chThdSleep(1000); } return 0; @@ -40,7 +42,7 @@ static msg_t Thread1(void *arg) { static void TimerHandler(eventid_t id) { msg_t TestThread(void *p); - if (!(PORTA & PORTA_BUTTON1)) + if (!(PINA & PORTA_BUTTON1)) TestThread(&SER2); } @@ -59,6 +61,15 @@ int main(int argc, char **argv) { */ chSysInit(); + /* + * This initialization requires the OS already active because it uses delay + * APIs inside. + */ + lcdInit(); + lcdCmd(LCD_CLEAR); + lcdPuts(LCD_LINE1, " ChibiOS/RT "); + lcdPuts(LCD_LINE2, " Hello World! "); + /* * Event Timer initialization. */ -- cgit v1.2.3