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