summaryrefslogtreecommitdiff
path: root/fw
diff options
context:
space:
mode:
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");
}
}