summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjoeycastillo <joeycastillo@utexas.edu>2023-02-01 16:21:48 -0600
committerjoeycastillo <joeycastillo@utexas.edu>2023-02-01 16:21:48 -0600
commit60e431d3d7e19357ef86e19326d6b52166bdb55f (patch)
treee05b9069c9d10b60c68a0b788301ed92e70f17b8
parent646643da159639ee2127aa87740a2865842fd09c (diff)
downloadSensor-Watch-60e431d3d7e19357ef86e19326d6b52166bdb55f.tar.gz
Sensor-Watch-60e431d3d7e19357ef86e19326d6b52166bdb55f.tar.bz2
Sensor-Watch-60e431d3d7e19357ef86e19326d6b52166bdb55f.zip
disable hot-plugging on SWCLK
-rw-r--r--watch-library/hardware/watch/watch_private.c5
-rw-r--r--watch-library/shared/watch/watch.h3
2 files changed, 8 insertions, 0 deletions
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__