123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- #include "bootloader.h"
- #include "samd51j18a.h"
- #include "md_bootloader.h"
- void bootloader_jump(void) {
- #ifdef KEYBOARD_massdrop_ctrl
-
- uint8_t ver_ram_method[] = "v2.18Jun 22 2018 17:28:08";
- uint8_t *ver_check = ver_ram_method;
- uint8_t *ver_rom = (uint8_t *)0x21A0;
- while (*ver_check && *ver_rom == *ver_check) {
- ver_check++;
- ver_rom++;
- }
- if (!*ver_check) {
- *MAGIC_ADDR = BOOTLOADER_MAGIC;
- NVIC_SystemReset();
- while (1) {
- }
- }
- #endif
- WDT->CTRLA.bit.ENABLE = 0;
- while (WDT->SYNCBUSY.bit.ENABLE) {
- }
- while (WDT->CTRLA.bit.ENABLE) {
- }
- WDT->CONFIG.bit.WINDOW = 0;
- WDT->CONFIG.bit.PER = 0;
- WDT->EWCTRL.bit.EWOFFSET = 0;
- WDT->CTRLA.bit.ENABLE = 1;
- while (WDT->SYNCBUSY.bit.ENABLE) {
- }
- while (!WDT->CTRLA.bit.ENABLE) {
- }
- while (1) {
- }
- }
|