It Works!!!!!

Such commit message
master
LEdoianX 9 years ago
parent 0a737f57f3
commit 96d82e1cd8

@ -33,7 +33,7 @@ inline void wait (int ticks) { // This works in libopenocm3 examples
int main (void) { int main (void) {
setup(); setup();
gpio_unset(GPIOC, GPIO8 | GPIO9); gpio_clear(GPIOC, GPIO8 | GPIO9);
while (gpio_get(GPIOA, GPIO0) == 0); while (gpio_get(GPIOA, GPIO0) == 0);
// Array of what leds should be on // Array of what leds should be on
@ -52,7 +52,7 @@ int main (void) {
state = (direction == FORWARD ? (state + 1)%4 : (/*state+4-1*/ state+3)%4 ); state = (direction == FORWARD ? (state + 1)%4 : (/*state+4-1*/ state+3)%4 );
gpio_set(GPIOC, states[state]); //FIXME: This doesn't work, as it does not write 0s to unmentioned pins!! gpio_set(GPIOC, states[state]); //FIXME: This doesn't work, as it does not write 0s to unmentioned pins!!
gpio_unset(GPIOC, (GPIO8 | GPIO9) ^ states[state]); // Does this fix that? gpio_clear(GPIOC, (GPIO8 | GPIO9) ^ states[state]); // Does this fix that?
wait(DELAY); wait(DELAY);
} }

Loading…
Cancel
Save