From: Martin Mares Date: Fri, 14 Jul 2023 17:31:18 +0000 (+0200) Subject: test-sinclair: Use internal pull-ups for optocoupler output X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=3e51c4c231136d971dd6a0458a027b13d70dc712;p=home-hw.git test-sinclair: Use internal pull-ups for optocoupler output --- 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);