Hello Everyone!!
Where can I find the definitions for internal class functions (eg : uart.readinto) in the repo??
Thanks in advance!!
Definitions for internal functions
Re: Definitions for internal functions
Search for places in *.c files where 'readinto' gets registered in a locals_dict , and look for the matching file for the port you are interested in (it's possible not all ports use the exact same implementation so this matters). You'll find matches like
Now go to the definition of mp_stream_readinto_obj in micropython/py/stream.c to see what function that is mapped to, it's stream_readinto. Which in turn calls mp_stream_read_exactly, which in trun calls mp_stream_rw and so on, which eventually leads back into machine_uart.c to call the actual harware I/O functionality.
Code: Select all
micropython/ports/esp32/machine_uart.c:
334: { MP_ROM_QSTR(MP_QSTR_readinto), MP_ROM_PTR(&mp_stream_readinto_obj) },
Re: Definitions for internal functions
Thanks for the reference
I will give it a try and let you know
Cheers!!
I will give it a try and let you know
Cheers!!
lnsri22