From 3397b1527efc2d4110141b63e948d6668c52b840 Mon Sep 17 00:00:00 2001 From: George Hotz Date: Wed, 4 Sep 2019 16:05:50 -0700 Subject: [PATCH] only allow bootloader entry on debug builds --- board/main.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/board/main.c b/board/main.c index 567795d6259e00..dcf6e668bd1b9b 100644 --- a/board/main.c +++ b/board/main.c @@ -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");