projects
/
bertos.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add return value check on commands.
[bertos.git]
/
examples
/
at91sam7s
/
at91sam7s.c
diff --git
a/examples/at91sam7s/at91sam7s.c
b/examples/at91sam7s/at91sam7s.c
index 89aedcb52324f120a87c11e83b54d2acc33c1672..f0c14a29fdcf17ba23dbec2c5d59a9fb98481198 100644
(file)
--- a/
examples/at91sam7s/at91sam7s.c
+++ b/
examples/at91sam7s/at91sam7s.c
@@
-50,21
+50,35
@@
Timer leds_timer;
Serial ser_fd;
Timer leds_timer;
Serial ser_fd;
+int roll = 0;
static void leds_toggle(void)
{
uint8_t a = (~PIOA_ODSR & 0x0f);
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;
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;
}
else
{
PIOA_SODR = 0x0f;
/* turn first led on */
PIOA_CODR = 0x00000001;
+ roll = 1;
}
/* Wait for interval time */
}
/* Wait for interval time */