Platform is WiPy port on custom CC3200 board.
Code: Select all
>>> uart # this object is created in boot.py for terminal duplication
UART(0, baudrate=115200, bits=8, parity=None, stop=1)
>>> uart2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name not defined
>>> uart2 = machine.UART(1, baudrate=9600, bits=8, parity=None, stop=1, pins=('GP3', 'GP4'))
>>> uart2
UART(1, baudrate=9600, bits=8, parity=None, stop=1)
>>> def irq_fun():
... received = uart2.read()
... print("Received: ",received)
...
...
...
>>> uart2IRQ = uart2.irq(trigger = UART.RX_ANY, priority = 1, handler = irq_fun, wake=machine.IDLE)
>>>
>>> Uncaught exception in callback handler
TypeError:
>>>
When I try to call irq_fun() directly from REPL it works - these bytes are sent from Nextion HMI display by touch of a button once:
Code: Select all
>>> irq_fun()
Received: b'e\x00\x05\x01\xff\xff\xff'