We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5dbff35 commit fc72657Copy full SHA for fc72657
app/main.cpp
@@ -224,9 +224,11 @@ int main(void) {
224
BOOT_LOG_INF("Starting Arduino bootloader");
225
226
int magic = RTCGetBKPRegister(RTC_BKP_DR0);
227
+ int reset = ResetReason::get();
228
+ RTCSetBKPRegister(RTC_BKP_DR8, reset);
229
230
// in case we have been reset let's wait 500 ms to see if user is trying to stay in bootloader
- if (ResetReason::get() == RESET_REASON_PIN_RESET) {
231
+ if (reset == RESET_REASON_PIN_RESET) {
232
// now that we've been reset let's set magic. resetting with this set will
233
// flag we need to stay in bootloader.
234
RTCSetBKPRegister(RTC_BKP_DR0, 0xDF59);
0 commit comments