summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVegard Storheil Eriksen <zyp@jvnv.net>2016-08-24 14:46:34 +0200
committerVegard Storheil Eriksen <zyp@jvnv.net>2016-08-24 14:46:34 +0200
commit7c379452d368bafbbe1fe3cea621295424ced1e1 (patch)
tree82ce691e2d8bb0de3eb2900ad7f18e7ec46608de
parentb9c5a74815d6a5c4912132fb8f9d718fea36747b (diff)
Put reset_reason in .bootinfo.
-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