From ac4cbca273e8bbde5b2f58df29e1fb6321fc2ee7 Mon Sep 17 00:00:00 2001 From: jaseg Date: Wed, 14 Oct 2020 13:06:13 +0200 Subject: Fix driver circuits --- fw/main.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'fw') diff --git a/fw/main.c b/fw/main.c index 360728e..ca4525b 100644 --- a/fw/main.c +++ b/fw/main.c @@ -56,14 +56,18 @@ int main(void) { (1<OTYPER |= (1<<1) | (1<<2) | (1<<3) | (1<<4) | (1<<9); + + int idx = 0; while (1) { GPIOA->ODR ^= (1<<9); - GPIOA->ODR = 2<ODR &= ~(0xf<<1); + GPIOA->ODR |= 1<<(idx+1); idx += 1; - if (idx > 4) - idx = 1; - for (size_t j=0; j<1000000; j++) { + if (idx > 3) + idx = 0; + + for (size_t j=0; j<100000; j++) { asm volatile ("nop"); } } -- cgit