summaryrefslogtreecommitdiff
path: root/fw
diff options
context:
space:
mode:
authorjaseg <git@jaseg.net>2020-10-14 13:06:13 +0200
committerjaseg <git@jaseg.net>2020-10-14 13:06:13 +0200
commitac4cbca273e8bbde5b2f58df29e1fb6321fc2ee7 (patch)
tree421717b5c5a73a7dff09ce6d35a92a6ba9b5c683 /fw
parent226fef1618dd9a37c050bb79a24c77396cd14c46 (diff)
downloadusb-remote-ac4cbca273e8bbde5b2f58df29e1fb6321fc2ee7.tar.gz
usb-remote-ac4cbca273e8bbde5b2f58df29e1fb6321fc2ee7.tar.bz2
usb-remote-ac4cbca273e8bbde5b2f58df29e1fb6321fc2ee7.zip
Fix driver circuitsHEADmaster
Diffstat (limited to 'fw')
-rw-r--r--fw/main.c14
1 files changed, 9 insertions, 5 deletions
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<<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");
}
}