From 8e408d9bac5d49ae7ec9bf947b71f2ab6fe41eab Mon Sep 17 00:00:00 2001 From: Jacques Gagnon Date: Tue, 28 Jun 2022 12:28:58 -0400 Subject: [PATCH] [N64] Reduce scope of N64 digital workaround to N64 port 1 only --- main/wired/nsi.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/main/wired/nsi.c b/main/wired/nsi.c index 95fa10c1..519d293e 100644 --- a/main/wired/nsi.c +++ b/main/wired/nsi.c @@ -530,7 +530,14 @@ void nsi_init(void) { RMT.conf_ch[rmt_ch[i][system]].conf1.rx_filter_en = 0; PIN_FUNC_SELECT(GPIO_PIN_MUX_REG_IRAM[gpio_pin[i]], PIN_FUNC_GPIO); - gpio_set_direction_iram(gpio_pin[i], GPIO_MODE_INPUT_OUTPUT); /* Bidirectional open-drain */ + if (wired_adapter.system_id == N64 && i == 0) { + /* Bidirectional push-pull to workaround N64 Digital OSD glitching the line on port 1 */ + gpio_set_direction_iram(gpio_pin[i], GPIO_MODE_INPUT_OUTPUT); + } + else { + /* Bidirectional open-drain */ + gpio_set_direction_iram(gpio_pin[i], GPIO_MODE_INPUT_OUTPUT_OD); + } gpio_matrix_out(gpio_pin[i], RMT_SIG_OUT0_IDX + rmt_ch[i][system], 0, 0); gpio_matrix_in(gpio_pin[i], RMT_SIG_IN0_IDX + rmt_ch[i][system], 0);