diff options
author | jaseg <git@jaseg.net> | 2020-10-14 13:06:13 +0200 |
---|---|---|
committer | jaseg <git@jaseg.net> | 2020-10-14 13:06:13 +0200 |
commit | ac4cbca273e8bbde5b2f58df29e1fb6321fc2ee7 (patch) | |
tree | 421717b5c5a73a7dff09ce6d35a92a6ba9b5c683 /fw | |
parent | 226fef1618dd9a37c050bb79a24c77396cd14c46 (diff) | |
download | usb-remote-master.tar.gz usb-remote-master.tar.bz2 usb-remote-master.zip |
Diffstat (limited to 'fw')
-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"); } } |