disable hot-plugging on SWCLK

This commit is contained in:
joeycastillo 2023-02-01 16:21:48 -06:00
parent 646643da15
commit 60e431d3d7
2 changed files with 8 additions and 0 deletions

View File

@ -30,6 +30,11 @@ void _watch_init(void) {
// disable the LED pin (it may have been enabled by the bootloader) // disable the LED pin (it may have been enabled by the bootloader)
watch_disable_digital_output(GPIO(GPIO_PORTA, 20)); 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 // RAM should be back-biased in STANDBY
PM->STDBYCFG.bit.BBIASHS = 1; PM->STDBYCFG.bit.BBIASHS = 1;

View File

@ -30,6 +30,9 @@
#include "driver_init.h" #include "driver_init.h"
#include "pins.h" #include "pins.h"
#define SWCLK GPIO(GPIO_PORTA, 30)
#define SWDIO GPIO(GPIO_PORTA, 31)
#ifdef __EMSCRIPTEN__ #ifdef __EMSCRIPTEN__
#include "watch_main_loop.h" #include "watch_main_loop.h"
#endif // __EMSCRIPTEN__ #endif // __EMSCRIPTEN__