From: batt Date: Wed, 7 Nov 2007 18:01:18 +0000 (+0000) Subject: Enable proc, time and serial test. X-Git-Tag: 1.0.0~259 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=cd59ebe8d754b03a717ac4274f748aff7e21f3e4;p=bertos.git Enable proc, time and serial test. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@983 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/app/at91sam7s/at91sam7s.c b/app/at91sam7s/at91sam7s.c index 371c7dc6..586693fe 100644 --- a/app/at91sam7s/at91sam7s.c +++ b/app/at91sam7s/at91sam7s.c @@ -71,11 +71,12 @@ static void leds_toggle(void) int main(void) { + char msg[]="BeRTOS, be fast be beatiful be realtime"; kdbg_init(); sysirq_init(); timer_init(); -// proc_init(); + proc_init(); ASSERT(!IRQ_ENABLED()); @@ -85,10 +86,6 @@ int main(void) ser_setbaudrate(host_port, 115200); ser_setparity(host_port, SER_PARITY_NONE); - /* Open the main communication port */ - Serial *host_port1 = ser_open(1); - ser_setbaudrate(host_port1, 115200); - ser_setparity(host_port1, SER_PARITY_NONE); IRQ_ENABLE; ASSERT(IRQ_ENABLED()); @@ -107,36 +104,15 @@ int main(void) /* turn first led on */ PIOA_CODR = 0x00000001; + timer_set_event_softint(&leds_timer, (Hook)leds_toggle, 0); + timer_setDelay(&leds_timer, ms_to_ticks(100)); + timer_add(&leds_timer); -// timer_set_event_softint(&leds_timer, (Hook)leds_toggle, 0); -// timer_setDelay(&leds_timer, ms_to_ticks(100)); -// timer_add(&leds_timer); - - int a=0; // Main loop for(;;) { -// proc_test(); - - a = ser_getchar(host_port1); - - if(a == 49) - PIOA_CODR = 0x0000000F; - if(a == 50) - { - PIOA_SODR = 0x0000000A; - ser_printf(host_port, "%c", a); - } - - if(a == 51) - PIOA_CODR = 0x0000000F; - if(a == 52) - { - PIOA_SODR = 0x00000005; - ser_printf(host_port1, "%c", a); - } - + proc_test(); + ser_printf(host_port, "From serial 0: %s\n", msg); } - return 0; }