Fix reset to bootloader command.

* Set RTC magic only for boards that need it.
This commit is contained in:
iabdalkader 2021-05-13 21:34:08 +02:00
parent 1c4a5dd96a
commit dbc467f928
2 changed files with 5 additions and 9 deletions

@ -1 +1 @@
Subproject commit fb2cbcd6ce2d4e6d9e89ecf93ad74b0ce89b34b4
Subproject commit 93cc3d48ae8eaed1f64957f82c96473c2510ca09

View File

@ -14,9 +14,6 @@
#include "py/gc.h"
#include "py/mphal.h"
#include "py/obj.h"
#include "py/lexer.h"
#include "py/parse.h"
#include "py/compile.h"
#include "py/runtime.h"
#include "pendsv.h"
@ -375,12 +372,11 @@ void usbdbg_control(void *buffer, uint8_t request, uint32_t length)
break;
case USBDBG_SYS_RESET_TO_BL:{
#if defined(RTC_BASE)
RTC_HandleTypeDef RTCHandle;
RTCHandle.Instance = RTC;
HAL_RTCEx_BKUPWrite(&RTCHandle, RTC_BKP_DR0, 0xDF59);
#endif
#if defined(MICROPY_RESET_TO_BOOTLOADER)
MICROPY_RESET_TO_BOOTLOADER();
#else
NVIC_SystemReset();
#endif
break;
}