diff options
Diffstat (limited to 'fw/main.c')
-rw-r--r-- | fw/main.c | 14 |
1 files changed, 9 insertions, 5 deletions
@@ -56,14 +56,18 @@ int main(void) { (1<<GPIO_MODER_MODER4_Pos)| /* PA4 - Port 4 */ (1<<GPIO_MODER_MODER9_Pos); /* PA9 - LED */ - int idx = 1; + //GPIOA->OTYPER |= (1<<1) | (1<<2) | (1<<3) | (1<<4) | (1<<9); + + int idx = 0; while (1) { GPIOA->ODR ^= (1<<9); - GPIOA->ODR = 2<<idx; + GPIOA->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"); } } |