From 98e30d3251b80448f99232d49a221263f9d1bf64 Mon Sep 17 00:00:00 2001 From: Petteri Aimonen Date: Wed, 14 Sep 2022 20:14:50 +0300 Subject: [PATCH] RP2040: Fix bug with bootloader getting stuck without SD card. The bootloader code was overriding mbed main(), causing millis() not to work, which broke timeouts. --- src/ZuluSCSI_main.cpp | 10 ++++++++++ src/build_bootloader.py | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/ZuluSCSI_main.cpp b/src/ZuluSCSI_main.cpp index e32ef1fe..5f2d32cf 100644 --- a/src/ZuluSCSI_main.cpp +++ b/src/ZuluSCSI_main.cpp @@ -5,10 +5,20 @@ extern "C" int bootloader_main(void); +#ifdef USE_ARDUINO +extern "C" void setup(void) +{ + bootloader_main(); +} +extern "C" void loop(void) +{ +} +#else int main(void) { return bootloader_main(); } +#endif #else diff --git a/src/build_bootloader.py b/src/build_bootloader.py index 5a97dce2..2f8d757e 100644 --- a/src/build_bootloader.py +++ b/src/build_bootloader.py @@ -19,7 +19,7 @@ for nodelist in env["PIOBUILDFILES"]: for node in nodelist: filename = str(node.rfile()) - if 'ZuluSCSI_main.o' not in filename: + if 'ZuluSCSI_main' not in filename: dep_objs.append(node) # print("Bootloader dependencies: ", type(dep_objs), str([str(f.rfile()) for f in dep_objs]))