From 3e51c4c231136d971dd6a0458a027b13d70dc712 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Fri, 14 Jul 2023 19:31:18 +0200 Subject: [PATCH] test-sinclair: Use internal pull-ups for optocoupler output --- test-sinclair/main.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/test-sinclair/main.c b/test-sinclair/main.c index 2c542fe..d0194cc 100644 --- a/test-sinclair/main.c +++ b/test-sinclair/main.c @@ -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); -- 2.39.2