X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=app%2Fat91sam7s%2Fat91sam7s.c;h=dc52b23c22e5183feee384774e571d06c543c74b;hb=56a07f2d54911b40c6f14e25a342e0a8742a6938;hp=13388a557fa4a6110d14dffa3270623414d32f08;hpb=9fc47ff8814e045ac498acb1bc92946950a6a5f9;p=bertos.git diff --git a/app/at91sam7s/at91sam7s.c b/app/at91sam7s/at91sam7s.c index 13388a55..dc52b23c 100644 --- a/app/at91sam7s/at91sam7s.c +++ b/app/at91sam7s/at91sam7s.c @@ -37,15 +37,14 @@ * \brief AT91SAM7S-EK porting test. */ +#include #include #include +#include +#include #include #include -int iort = 23; -int iort1 = 232; -int iort2 = 233; - Timer leds_timer; static void leds_toggle(void) @@ -72,39 +71,48 @@ 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(); + ASSERT(!IRQ_ENABLED()); + + + + /* Open the main communication port */ + Serial *host_port = ser_open(0); + ser_setbaudrate(host_port, 115200); + ser_setparity(host_port, SER_PARITY_NONE); + + IRQ_ENABLE; + ASSERT(IRQ_ENABLED()); /* Disable all pullups */ PIOA_PUDR = 0xffffffff; /* Set PA0..3 connected to PIOA */ - PIOA_PER = 0x0000000f; + PIOA_PER = 0x0000001f; /* Set PA0..3 as output */ - PIOA_OER = 0x0000000f; + PIOA_OER = 0x0000001f; /* Disable multidrive on all pins */ - PIOA_MDDR = 0x0000000f; + PIOA_MDDR = 0x0000001f; /* Set PA0..3 to 1 to turn off leds */ PIOA_SODR = 0x0000000f; /* 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); // Main loop for(;;) { - kprintf("W la figa!\n"); - iort+= 1; - iort1+= 1; - iort2+= 1; + proc_test(); + ser_printf(host_port, "From serial 0: %s\r\n", msg); } - return 0; } -