You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
490 B

  1. // Copyright 2023 QMK
  2. // SPDX-License-Identifier: GPL-2.0-or-later
  3. #include "bootloader.h"
  4. // From mmoskal/uf2-stm32f103's backup.c
  5. #define MAGIC_BOOT 0x544F4F42UL
  6. // defined by linker script
  7. extern uint32_t _board_magic_reg[];
  8. #define MAGIC_REG _board_magic_reg[0]
  9. void bootloader_jump(void) {
  10. MAGIC_REG = MAGIC_BOOT;
  11. NVIC_SystemReset();
  12. }
  13. void mcu_reset(void) {
  14. NVIC_SystemReset();
  15. }
  16. /* not needed, no two-stage reset */
  17. void enter_bootloader_mode_if_requested(void) {}