summaryrefslogtreecommitdiffstats
path: root/watch-library/hardware/watch/watch.c
diff options
context:
space:
mode:
Diffstat (limited to 'watch-library/hardware/watch/watch.c')
-rw-r--r--watch-library/hardware/watch/watch.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/watch-library/hardware/watch/watch.c b/watch-library/hardware/watch/watch.c
index b3dc4e8d..7bda9257 100644
--- a/watch-library/hardware/watch/watch.c
+++ b/watch-library/hardware/watch/watch.c
@@ -45,3 +45,9 @@ bool watch_is_buzzer_or_led_enabled(void){
bool watch_is_usb_enabled(void) {
return USB->DEVICE.CTRLA.bit.ENABLE;
}
+
+void watch_reset_to_bootloader(void) {
+ volatile uint32_t *dbl_tap_ptr = ((volatile uint32_t *)(HSRAM_ADDR + HSRAM_SIZE - 4));
+ *dbl_tap_ptr = 0xf01669ef; // from the UF2 bootloaer: uf2.h line 255
+ NVIC_SystemReset();
+}