From a908edaf0dae7c7b53f0c83f6ae008f006450438 Mon Sep 17 00:00:00 2001 From: LEdoianX Date: Thu, 14 Apr 2016 13:34:32 +0200 Subject: [PATCH] Fix the bug, hopefully --- main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main.c b/main.c index cf66351..7400237 100644 --- a/main.c +++ b/main.c @@ -51,7 +51,9 @@ int main (void) { } 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? + wait(DELAY); } return 0;