From 621dd9fcec7727eda1d4244d6dbd5ba998a18c2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Monda?= Date: Fri, 21 Apr 2017 09:52:51 +0200 Subject: [PATCH] Add JumpToBootloader() --- left/src/main.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/left/src/main.c b/left/src/main.c index 7233af1..3558079 100644 --- a/left/src/main.c +++ b/left/src/main.c @@ -42,6 +42,16 @@ key_matrix_t keyMatrix = { #endif }; +void JumpToBootloader() { + uint32_t runBootloaderAddress; + void (*runBootloader)(void * arg); + // Read the function address from the ROM API tree. + runBootloaderAddress = **(uint32_t **)(0x1c00001c); + runBootloader = (void (*)(void * arg))runBootloaderAddress; + // Start the bootloader. + runBootloader(NULL); +} + int main(void) { InitClock();