]> mj.ucw.cz Git - home-hw.git/commitdiff
test-sinclair: Use internal pull-ups for optocoupler output
authorMartin Mares <mj@ucw.cz>
Fri, 14 Jul 2023 17:31:18 +0000 (19:31 +0200)
committerMartin Mares <mj@ucw.cz>
Fri, 14 Jul 2023 17:31:18 +0000 (19:31 +0200)
test-sinclair/main.c

index 2c542fe0ec0669deee66a9b3eafdcc327b20b39d..d0194cc28838de19f6eb8b8ef3fcd520fa9a3f2f 100644 (file)
@@ -57,10 +57,11 @@ static void gpio_init(void)
        gpio_set_mode(GPIOC, GPIO_MODE_OUTPUT_50_MHZ, GPIO_CNF_OUTPUT_PUSHPULL, GPIO13);
        gpio_clear(GPIOC, GPIO13);
 
-       // PB13 = SCK2
-       // PB15 = MOSI2
-       gpio_set_mode(GPIOB, GPIO_MODE_INPUT, GPIO_CNF_INPUT_FLOAT, GPIO13);
-       gpio_set_mode(GPIOB, GPIO_MODE_INPUT, GPIO_CNF_INPUT_FLOAT, GPIO15);
+       // PB13 = SCK2 (pulled up)
+       // PB15 = MOSI2 (pulled up)
+       gpio_set_mode(GPIOB, GPIO_MODE_INPUT, GPIO_CNF_INPUT_PULL_UPDOWN, GPIO13);
+       gpio_set_mode(GPIOB, GPIO_MODE_INPUT, GPIO_CNF_INPUT_PULL_UPDOWN, GPIO15);
+       gpio_set(GPIOB, GPIO13 | GPIO15);
 
        // PA8 = IR remote control
        gpio_clear(GPIOA, GPIO8);