From e24e126d3d20a3238361366c4f98d894d0e155d7 Mon Sep 17 00:00:00 2001 From: Laurens Valk Date: Tue, 8 Oct 2024 12:32:12 +0200 Subject: [PATCH] pbio/main: Use REPL for autostart. This is the most convenient for testing on builds without full pbsys. --- lib/pbio/sys/main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/pbio/sys/main.c b/lib/pbio/sys/main.c index b03d506c2..09283e87b 100644 --- a/lib/pbio/sys/main.c +++ b/lib/pbio/sys/main.c @@ -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()) {