From 807b1f336fce171170f7c9f5183e5472fbb0a9e1 Mon Sep 17 00:00:00 2001 From: BlackMark Date: Sun, 12 Apr 2020 15:32:31 +0200 Subject: [PATCH] Finish bootloader by adding jump to user code --- stk500v2/main.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/stk500v2/main.cpp b/stk500v2/main.cpp index ce48f13..8f18e5c 100644 --- a/stk500v2/main.cpp +++ b/stk500v2/main.cpp @@ -586,8 +586,6 @@ int main() } if (timeout == 0) { - timeout = TIMEOUT; - if (chipEraseFlag == ChipEraseState::PERFORM) { performChipErase(); chipEraseFlag = ChipEraseState::NONE; @@ -595,6 +593,10 @@ int main() performChipErase(finishEraseAddress); chipEraseFlag = ChipEraseState::NONE; } + + typedef void (*jump_fn)() __attribute__((naked, noreturn)); + constexpr jump_fn boot = 0x0000; + boot(); } }