From 60e431d3d7e19357ef86e19326d6b52166bdb55f Mon Sep 17 00:00:00 2001 From: joeycastillo Date: Wed, 1 Feb 2023 16:21:48 -0600 Subject: disable hot-plugging on SWCLK --- watch-library/hardware/watch/watch_private.c | 5 +++++ watch-library/shared/watch/watch.h | 3 +++ 2 files changed, 8 insertions(+) diff --git a/watch-library/hardware/watch/watch_private.c b/watch-library/hardware/watch/watch_private.c index cd607b8e..d6da4404 100644 --- a/watch-library/hardware/watch/watch_private.c +++ b/watch-library/hardware/watch/watch_private.c @@ -30,6 +30,11 @@ void _watch_init(void) { // disable the LED pin (it may have been enabled by the bootloader) watch_disable_digital_output(GPIO(GPIO_PORTA, 20)); + // disable debugger hot-plugging + gpio_set_pin_function(SWCLK, GPIO_PIN_FUNCTION_OFF); + gpio_set_pin_direction(SWCLK, GPIO_DIRECTION_OFF); + gpio_set_pin_pull_mode(SWCLK, GPIO_PULL_OFF); + // RAM should be back-biased in STANDBY PM->STDBYCFG.bit.BBIASHS = 1; diff --git a/watch-library/shared/watch/watch.h b/watch-library/shared/watch/watch.h index 790f9a16..4ded68d5 100644 --- a/watch-library/shared/watch/watch.h +++ b/watch-library/shared/watch/watch.h @@ -30,6 +30,9 @@ #include "driver_init.h" #include "pins.h" +#define SWCLK GPIO(GPIO_PORTA, 30) +#define SWDIO GPIO(GPIO_PORTA, 31) + #ifdef __EMSCRIPTEN__ #include "watch_main_loop.h" #endif // __EMSCRIPTEN__ -- cgit v1.2.3