Commit fc5c06b 1 parent d1135e4 commit fc5c06b Copy full SHA for fc5c06b
File tree 2 files changed +18
-0
lines changed
2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change 46
46
#undef BOARD_ID
47
47
#define BOARD_ID "STM32F103-blue-pill-v0"
48
48
49
+ //#define DOUBLE_TAP
50
+
49
51
#endif
Original file line number Diff line number Diff line change @@ -198,6 +198,11 @@ bool target_get_force_app(void) {
198
198
}
199
199
200
200
bool target_get_force_bootloader (void ) {
201
+ /* Enable GPIO clocks */
202
+ rcc_periph_clock_enable (RCC_GPIOA );
203
+ rcc_periph_clock_enable (RCC_GPIOB );
204
+ rcc_periph_clock_enable (RCC_GPIOC );
205
+
201
206
bool force = true;
202
207
/* Check the RTC backup register */
203
208
uint32_t cmd = backup_read (BKP0 );
@@ -212,8 +217,19 @@ bool target_get_force_bootloader(void) {
212
217
return false;
213
218
}
214
219
220
+ #ifdef DOUBLE_TAP
221
+ target_set_led (1 );
222
+ // wait for second press on reset
223
+ backup_write (BKP0 , CMD_BOOT );
224
+ for (int i = 0 ; i < 3500000 ; ++ i )
225
+ asm("nop" );
226
+ backup_write (BKP0 , 0 );
227
+ target_set_led (0 );
228
+ force = false;
229
+ #else
215
230
// a reset now should go into app
216
231
backup_write (BKP0 , CMD_APP );
232
+ #endif
217
233
218
234
#if HAVE_BUTTON
219
235
/* Check if the user button is held down */
You can’t perform that action at this time.
0 commit comments