Skip to content

Commit

Permalink
Adds a hook for the bootloader loop. (#665)
Browse files Browse the repository at this point in the history
This hook can be used by applications needing to do periodic processing
on the main thread after they called bootloader_entry().
  • Loading branch information
balazsracz authored Oct 13, 2022
1 parent a8d1910 commit 99b2063
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/openlcb/Bootloader.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -1041,9 +1041,13 @@ bool bootloader_init() {
/// Called repeatedly in an infinite loop to run the bootloader.
///
/// @return true if the board has to be rebooted, false if the bootloader
/// should keep running (i.e. to call again).
/// should keep running (i.e., to call again).
bool bootloader_loop()
{
#ifdef BOOTLOADER_LOOP_HOOK
BOOTLOADER_LOOP_HOOK();
#endif

{
#ifdef __linux__
AtomicHolder h(&g_bootloader_lock);
Expand Down

0 comments on commit 99b2063

Please sign in to comment.