Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple Event Sensors not working #1557

Closed
DougTheHandyman opened this issue Feb 18, 2019 · 1 comment · Fixed by #1649
Closed

Multiple Event Sensors not working #1557

DougTheHandyman opened this issue Feb 18, 2019 · 1 comment · Fixed by #1649

Comments

@DougTheHandyman
Copy link

I have defined multiple Event Sensors, following the method illustrated in sensor.ino for replicating a DHT Sensor. What I'm seeing in the startup log and on the web interface, is that the sensors get defined. However, only the last one defined actually works. This was on Arduino core 2.4.2 and Espurna 1.13.3

Raised this on gitter and @mcspr identified probable bug in that the definition
"static unsigned char _interrupt_gpio = GPIO_NONE;" at line 148 in EventSensor.h
will be common to all defined Event Sensors and suggested moving that definition further down the code to be in wider scope.

that worked for me

@mcspr
Copy link
Collaborator

mcspr commented Feb 20, 2019

Note that was merely a suggestion of minimal-viable-fix :)

Looking at the Core code, I think there is no need to track GPIO at all. Interrupt handler can only reference one function, it will use the last one attached. Need to check with live board though, if it does something bad instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants