logo

qmk_firmware

custom branch of QMK firmware git clone https://anongit.hacktivis.me/git/qmk_firmware.git

uf2boot.c (527B)


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