File tree Expand file tree Collapse file tree 5 files changed +11
-5
lines changed Expand file tree Collapse file tree 5 files changed +11
-5
lines changed Original file line number Diff line number Diff line change 4040// Implementation for MICROPY_EVENT_POLL_HOOK
4141void pb_event_poll_hook (void ) {
4242
43+ while (pbio_os_run_processes_once ()) {
44+ }
45+
4346 mp_handle_pending (true);
4447
45- pbio_os_run_while_idle ();
48+ pbio_os_run_processes_and_wait_for_event ();
4649}
4750
4851// callback for when stop button is pressed in IDE or on hub
Original file line number Diff line number Diff line change @@ -89,9 +89,12 @@ void pb_virtualhub_port_deinit(void) {
8989// Implementation for MICROPY_EVENT_POLL_HOOK
9090void pb_event_poll_hook (void ) {
9191
92+ while (pbio_os_run_processes_once ()) {
93+ }
94+
9295 mp_handle_pending (true);
9396
94- pbio_os_run_while_idle ();
97+ pbio_os_run_processes_and_wait_for_event ();
9598}
9699
97100pbio_os_irq_flags_t pbio_os_hook_disable_irq (void ) {
Original file line number Diff line number Diff line change @@ -269,7 +269,7 @@ struct _pbio_os_process_t {
269269
270270bool pbio_os_run_processes_once (void );
271271
272- void pbio_os_run_while_idle (void );
272+ void pbio_os_run_processes_and_wait_for_event (void );
273273
274274void pbio_os_request_poll (void );
275275
Original file line number Diff line number Diff line change @@ -149,7 +149,7 @@ bool pbio_os_run_processes_once(void) {
149149 * enter a low power mode when possible. It will sleep for at most one
150150 * millisecond.
151151 */
152- void pbio_os_run_while_idle (void ) {
152+ void pbio_os_run_processes_and_wait_for_event (void ) {
153153
154154 // Run the event loop until there is no more pending poll request.
155155 while (pbio_os_run_processes_once ()) {
Original file line number Diff line number Diff line change @@ -95,7 +95,7 @@ int main(int argc, char **argv) {
9595 #endif
9696
9797 // Drives all processes while we wait for user input.
98- pbio_os_run_while_idle ();
98+ pbio_os_run_processes_and_wait_for_event ();
9999
100100 if (!pbsys_main_program_start_requested ()) {
101101 continue ;
You can’t perform that action at this time.
0 commit comments