Skip to content

Commit

Permalink
pbio/main: Use REPL for autostart.
Browse files Browse the repository at this point in the history
This is the most convenient for testing on builds without full pbsys.
  • Loading branch information
laurensvalk committed Oct 15, 2024
1 parent bb2cd8b commit e24e126
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/pbio/sys/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ int main(int argc, char **argv) {
pbio_init();
pbsys_init();

#if PBSYS_CONFIG_USER_PROGRAM_AUTO_START
pbsys_main_program_request_start(0);
#endif

// Keep loading and running user programs until shutdown is requested.
while (!pbsys_status_test(PBIO_PYBRICKS_STATUS_SHUTDOWN_REQUEST)) {

#if PBSYS_CONFIG_USER_PROGRAM_AUTO_START
pbsys_main_program_request_start(PBIO_PYBRICKS_USER_PROGRAM_ID_REPL);
#endif

// REVISIT: this can be long waiting, so we could do a more efficient
// wait (i.e. __WFI() on embedded system)
while (pbio_do_one_event()) {
Expand Down

0 comments on commit e24e126

Please sign in to comment.