Skip to content

Commit

Permalink
RP2040: Fix bug with bootloader getting stuck without SD card.
Browse files Browse the repository at this point in the history
The bootloader code was overriding mbed main(), causing millis()
not to work, which broke timeouts.
  • Loading branch information
PetteriAimonen committed Sep 14, 2022
1 parent 21ad9f9 commit 98e30d3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions src/ZuluSCSI_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/build_bootloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]))

Expand Down

0 comments on commit 98e30d3

Please sign in to comment.