From dbc467f9284913237c8bbc8591ca444264596566 Mon Sep 17 00:00:00 2001 From: iabdalkader Date: Thu, 13 May 2021 21:34:08 +0200 Subject: [PATCH] Fix reset to bootloader command. * Set RTC magic only for boards that need it. --- src/micropython | 2 +- src/omv/common/usbdbg.c | 12 ++++-------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/micropython b/src/micropython index fb2cbcd6c..93cc3d48a 160000 --- a/src/micropython +++ b/src/micropython @@ -1 +1 @@ -Subproject commit fb2cbcd6ce2d4e6d9e89ecf93ad74b0ce89b34b4 +Subproject commit 93cc3d48ae8eaed1f64957f82c96473c2510ca09 diff --git a/src/omv/common/usbdbg.c b/src/omv/common/usbdbg.c index fc56657b4..e68148b0d 100644 --- a/src/omv/common/usbdbg.c +++ b/src/omv/common/usbdbg.c @@ -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; }