Skip to content

Commit

Permalink
only allow bootloader entry on debug builds
Browse files Browse the repository at this point in the history
  • Loading branch information
geohot committed Sep 4, 2019
1 parent d68356b commit 3397b15
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions board/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -282,11 +282,14 @@ int usb_cb_control_msg(USB_Setup_TypeDef *setup, uint8_t *resp, bool hardwired)
// so it's blocked over wifi
switch (setup->b.wValue.w) {
case 0:
if (hardwired) {
puts("-> entering bootloader\n");
enter_bootloader_mode = ENTER_BOOTLOADER_MAGIC;
NVIC_SystemReset();
}
// only allow bootloader entry on debug builds
#ifdef ALLOW_DEBUG
if (hardwired) {
puts("-> entering bootloader\n");
enter_bootloader_mode = ENTER_BOOTLOADER_MAGIC;
NVIC_SystemReset();
}
#endif
break;
case 1:
puts("-> entering softloader\n");
Expand Down

0 comments on commit 3397b15

Please sign in to comment.