From 3230b94973c7c6b8afdf8396c1ac40d3d8daebb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20Monda?= Date: Tue, 17 Oct 2017 00:58:23 +0200 Subject: [PATCH] Make the left half call NVIC_SystemReset() upon receiving SlaveCommand_JumpToBootloader instead of jumping to the ROM address of the bootloader. This way the bootloader timeouts. Remove bootloader.c because it only contained JumpToBootloader() which is now unused. --- left/src/slave_protocol_handler.c | 2 +- shared/bootloader.c | 12 ------------ 2 files changed, 1 insertion(+), 13 deletions(-) delete mode 100644 shared/bootloader.c diff --git a/left/src/slave_protocol_handler.c b/left/src/slave_protocol_handler.c index 9e836e7..a517264 100644 --- a/left/src/slave_protocol_handler.c +++ b/left/src/slave_protocol_handler.c @@ -43,7 +43,7 @@ void SlaveRxHandler(void) uint8_t commandId = RxMessage.data[0]; switch (commandId) { case SlaveCommand_JumpToBootloader: - JumpToBootloader(); + NVIC_SystemReset(); break; case SlaveCommand_SetTestLed: TxMessage.length = 0; diff --git a/shared/bootloader.c b/shared/bootloader.c deleted file mode 100644 index 98832f7..0000000 --- a/shared/bootloader.c +++ /dev/null @@ -1,12 +0,0 @@ -#include "bootloader.h" - -void JumpToBootloader(void) { - 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; - - runBootloader(NULL); -}