clean up location of some private functions
This commit is contained in:
@@ -25,7 +25,7 @@
|
||||
#include "watch.h"
|
||||
|
||||
// receives interrupts from MCLK, OSC32KCTRL, OSCCTRL, PAC, PM, SUPC and TAL, whatever that is.
|
||||
void SYSTEM_Handler(void) {
|
||||
void irq_handler_system(void) {
|
||||
if (SUPC->INTFLAG.bit.BOD33DET) {
|
||||
// Our system voltage has dipped below 2.6V!
|
||||
// Set the voltage regulator to work at low system voltage before we hit 2.5 V
|
||||
@@ -37,13 +37,3 @@ void SYSTEM_Handler(void) {
|
||||
SUPC->INTFLAG.reg &= ~SUPC_INTFLAG_BOD33DET;
|
||||
}
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
@@ -414,3 +414,9 @@ uint16_t const* tud_descriptor_string_cb(uint8_t index, uint16_t langid)
|
||||
|
||||
return _desc_str;
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user