summaryrefslogtreecommitdiff
path: root/bootloader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'bootloader.cpp')
-rw-r--r--bootloader.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/bootloader.cpp b/bootloader.cpp
index 46ce294..ab99e6b 100644
--- a/bootloader.cpp
+++ b/bootloader.cpp
@@ -10,7 +10,7 @@
Pin button = GPIOA[3];
Pin led = GPIOA[4];
-static uint32_t& reset_reason = *(uint32_t*)0x10000000;
+uint32_t reset_reason __attribute__((section(".bootinfo")));
static const uint32_t* firmware_vtors = (uint32_t*)0x8002000;
static bool do_reset;
@@ -245,10 +245,10 @@ USB_strings usb_strings(usb);
bool normal_boot() {
// Check if this was a reset-to-bootloader.
- //if(reset_reason == 0xb007) {
- // reset_reason = 0;
- // return false;
- //}
+ if(reset_reason == 0xb007) {
+ reset_reason = 0;
+ return false;
+ }
// Check that reset vector is a valid flash address.
uint32_t reset_vector = firmware_vtors[1];