From a4358d67bec747e74b375a1149a9a73edfa04fbf Mon Sep 17 00:00:00 2001 From: Michael Ossmann Date: Tue, 9 May 2023 11:50:40 -0400 Subject: [PATCH] firmware: disable internal PROGRAM pull-up There is an external pull-up starting in Cynthion r0.6. The internal pull-up could cause problems starting in Cynthion r0.7. --- firmware/src/boards/luna_d11/usb_switch.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/firmware/src/boards/luna_d11/usb_switch.c b/firmware/src/boards/luna_d11/usb_switch.c index 771f4fc..845e14b 100644 --- a/firmware/src/boards/luna_d11/usb_switch.c +++ b/firmware/src/boards/luna_d11/usb_switch.c @@ -43,6 +43,11 @@ void take_over_usb(void) */ void switch_control_task(void) { +#if ((_BOARD_REVISION_MAJOR_ == 0) && (_BOARD_REVISION_MINOR_ < 6)) + gpio_set_pin_pull_mode(PROGRAM_BUTTON, GPIO_PULL_UP); +#else + gpio_set_pin_pull_mode(PROGRAM_BUTTON, GPIO_PULL_OFF); +#endif gpio_set_pin_direction(PROGRAM_BUTTON, GPIO_DIRECTION_IN); gpio_set_pin_direction(FPGA_INT, GPIO_DIRECTION_IN); if ((gpio_get_pin_level(PROGRAM_BUTTON) == false) || (gpio_get_pin_level(FPGA_INT) == true)) {