flipperzero-firmware/firmware/targets/f4/api-hal/api-hal-boot.c
coreglitch c1c069e95f
F2 F3 deprecate (#267)
* move f3-1 to f4, remove f3
* remove f2
* remove firmware F3 for pipeline
* remove patch for F4 makefile
* fix fw makefile
* migrate bootloader to f4
2020-12-14 19:36:07 +03:00

13 lines
415 B
C

#include <api-hal-boot.h>
#include <stm32wbxx_ll_rtc.h>
#define BOOT_REQUEST_NONE 0x00000000
#define BOOT_REQUEST_DFU 0xDF00B000
void api_hal_boot_set_mode(ApiHalBootMode mode) {
if (mode == ApiHalBootModeNormal) {
LL_RTC_BAK_SetRegister(RTC, LL_RTC_BKP_DR0, BOOT_REQUEST_NONE);
} else if (mode == ApiHalBootModeDFU) {
LL_RTC_BAK_SetRegister(RTC, LL_RTC_BKP_DR0, BOOT_REQUEST_DFU);
}
}