i made some weird one that is working. after calling ISR callback set sleep for 5.1ms (depends on your baudrate,, this one is for 9600), then read the rx with uart.any() > 0, uart.read()danielm wrote: ↑Wed Mar 02, 2016 9:33 pmIt seems that interrupt function is called with UART class parameter, on which I can call function any() ( it does not work with read() ).CODE:
>>> def irq_fun(obj):... print("Type: ", type(obj))... print(obj.any()).........>>> uart2IRQ = uart2.irq(trigger = UART.RX_ANY, priority = 1, handler = irq_fun, wake=machine.IDLE)>>> Type: <class 'UART'>105Type: <class 'UART'>112Type: <class 'UART'>119Type: <class 'UART'>126Type: <class 'UART'>133Type: <class 'UART'>140
this halts the mcu for 5.1ms, but working. im sure that there is better solution.
Statistics: Posted by Alexel — Wed Jan 10, 2024 9:40 pm