X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=examples%2Fat91sam7s%2Fat91sam7s.c;h=17293a4448bd35091ce4a4d471a74ffa6118b813;hb=9ff4e7d506adcf5c3cf8ef603279bd540c2e792b;hp=89aedcb52324f120a87c11e83b54d2acc33c1672;hpb=d53e47551d9ba397baf1d708f25e9568dfd79595;p=bertos.git diff --git a/examples/at91sam7s/at91sam7s.c b/examples/at91sam7s/at91sam7s.c index 89aedcb5..17293a44 100644 --- a/examples/at91sam7s/at91sam7s.c +++ b/examples/at91sam7s/at91sam7s.c @@ -45,26 +45,41 @@ #include #include #include +#include #include Timer leds_timer; Serial ser_fd; +int roll = 0; static void leds_toggle(void) { uint8_t a = (~PIOA_ODSR & 0x0f); - if (a) + if (roll == 1) { + if(a == 4) + roll = 2; + PIOA_SODR = a; PIOA_CODR = a << 1; + + } + else if (roll == 2) + { + if(a == 2) + roll = 1; + + PIOA_SODR = a; + PIOA_CODR = a >> 1; } else { PIOA_SODR = 0x0f; /* turn first led on */ PIOA_CODR = 0x00000001; + roll = 1; } /* Wait for interval time */