I wish to adjust the timeout of an UART port I instantiated. I can't find anything in the reference:
https://docs.micropython.org/en/latest/ ... .UART.html
I can't just assign value to UART.timeout. That is not a member variable. So is there any way to make changes to the timeout? Thanks.
Adjusting timeout of UART after creating the object?
Re: Adjusting timeout of UART after creating the object?
Why do you need to do this / what is the requirement? any reason you can't just re-init it?
Re: Adjusting timeout of UART after creating the object?
Thanks. I could just call machine.UART() again? There's no indication it would work or what would happen if it gets called again.
So I did some experimentation with calling it and sending and receiving data and with gc.
It seems to work fine as long as I call gc.collect() to release memory from the previous callse to machine.UART().
So I did some experimentation with calling it and sending and receiving data and with gc.
It seems to work fine as long as I call gc.collect() to release memory from the previous callse to machine.UART().
Re: Adjusting timeout of UART after creating the object?
Your last comment:
Do you have to do this just with machine.UART() or is calling gc.collect() required before making a new call to other methods?It seems to work fine as long as I call gc.collect() to release memory from the previous callse to machine.UART().
Re: Adjusting timeout of UART after creating the object?
You can call uart.deinit() just before recreating it as well