eclipse / mraa

Linux Library for low speed IO Communication in C with bindings for C++, Python, Node.js & Java. Supports generic io platforms, as well as Intel Edison, Intel Joule, Raspberry Pi and many more.
http://mraa.io
MIT License
1.36k stars 613 forks source link

Python mraa fails setup interrupt #1067

Closed lpnaunau closed 3 years ago

lpnaunau commented 3 years ago

Hi,

I'm trying to setup an interrupt using the following provided in example via an IoT2040 using Python 3.8.2

`try:

initialise GPIO

x = mraa.Gpio(pin)

print("Starting ISR for pin " + repr(pin))

# set direction and edge types for interrupt
x.dir(mraa.DIR_IN)
x.isr(mraa.EDGE_BOTH, isr_routine, x)

# wait until ENTER is pressed
var = raw_input("Press ENTER to stop")
x.isrExit()

except ValueError as e: print(e) ` Unfortunately, I'm having the following error: image

Any idea ?

Thanks !

lpnaunau commented 3 years ago

After more tests I found out the issue was coming from my side I forgot the following line:

x.isrExit()