Callback scheduling #13107
-
Hi, We are working on the psoc6 port. In that, the GPIO interrupt function is presumably blocked by the UART. Because after running the code from thonny/repl , the callback function is only executed after giving an input character from the repl. To solve this I also have added MICROPY_EVENT_POLL_HOOK in the mp_hal_stdin_rx_chr(void) function as below,
Could anyone help me by giving more insights on the mp_sched_schedule() function with any possible solutions? Thanks in Advance!! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Have you look at github.com/peterhinch/micropython-async/tree/master/v3/as_demo/auart.py ? Don't know if that help you... but I think async mode can be a good solution |
Beta Was this translation helpful? Give feedback.
-
The scheduler is handled in See:
|
Beta Was this translation helpful? Give feedback.
The scheduler is handled in
MICROPY_EVENT_POLL_HOOK
so yes it's common practice to call that in any idle loop like waiting for input and sleep functions.See:
micropython/ports/stm32/mphalport.c
Line 38 in 30b0ee3
micropython/ports/esp32/mphalport.c
Line 115 in 30b0ee3