projects
/
gps-watch.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2b618b4
)
common: Implement jump_to_application().
author
Tilman Sauerbeck
<tilman@code-monkey.de>
Sun, 7 Jul 2019 07:49:05 +0000
(09:49 +0200)
committer
Tilman Sauerbeck
<tilman@code-monkey.de>
Sun, 5 Jan 2020 19:38:11 +0000
(20:38 +0100)
src/common/startup.c
patch
|
blob
|
history
diff --git
a/src/common/startup.c
b/src/common/startup.c
index daa8906c38f1c36fa7f8127095772bf2cc168791..0a5507ac9a0524264d062447b3d9047693fc2501 100644
(file)
--- a/
src/common/startup.c
+++ b/
src/common/startup.c
@@
-150,3
+150,17
@@
Dummy_Handler (void)
for (;;) {
}
}
+
+void
+jump_to_application (volatile uint32_t *address)
+{
+ volatile uint32_t *vtor = (uint32_t *) 0xe000ed08;
+ *vtor = (uint32_t) address;
+
+ asm volatile ("" ::: "memory");
+ asm volatile ("msr msp, %0" :: "r" (*(address + 0)) : "sp");
+ asm volatile ("bx %0" :: "r" (*(address + 1)));
+
+ for (;;) {
+ }
+}