summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bootloader.cpp10
m---------laks0
2 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];
diff --git a/laks b/laks
-Subproject 037ba6e1e22e8577d7823f0abe22c331934a4d0
+Subproject 4796432e8d165b5358af9675f2ca15a61bafee6