-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
mp_sched_schedule's scheduled callbacks don't run on empty REPL lines #3273
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
What platform/port do you use? It's generally up to the port to make this behave correctly and IIRC it works OK on esp8266 and pyboard. If you could give minimal code that reproduces the error that would help. |
It's Zephyr port, and my first attempt to use mp_sched_schedule() at all. There's no immediate way to reproduce the above (it's prototype of BLE module). I'll look into what stmhal/esp8266 do, but from the above I can imagine that probably lexer detects that input string is empty and doesn't call VM. It could at least signal it to process scheduled callbacks in this case, and that would be port-independent. |
They call mp_handle_pending() in their MICROPY_EVENT_POLL_HOOK macro, which is in turn called from the busy-wait loop when waiting for incoming chars for the REPL. With this approach, scheduled callbacks will be called while waiting for a uselect.poll.poll() call, for example. |
Thanks, will look into adding that. |
Squeeze firmwares to fit the new ja translation
This behaviour of |
Ah, this didn't get closed... anyway, with #7177 scheduled events will be run asynchronously at the REPL and during sleeps. |
Now works via d120859 |
Ok, so using mp_sched_schedule() with interactive REPL is problematic - scheduled stuff won't run until REPL executes something. That's understood. However, it would be nice if empty lines entered actually caused them to be executed. Otherwise, it requires really dirty workaround of typing random expressions to get it going, like me typing
1
below:The text was updated successfully, but these errors were encountered: