neu-rah / PCINT

Yet another Arduino PCINT library
9 stars 9 forks source link

Can't use hardware interrupt pins #3

Open Jacotheron opened 6 years ago

Jacotheron commented 6 years ago

I am now using the Arduino Menu with a click encoder, and using this library (as is required by the Arduino Menu library), I am unable to use this on pins that have hardware interrupt (it simply does not do anything, while moving it to different pins works as intended - I want to use these pins for something else).

Can we perhaps modify the code to detect if the pin actually have hardware/dedicated interrupts and use that, falling back to the PCINT interrupts?

The reason is simple, on the Adafruit Feather M0, I have individual interrupts on every single pin exposed (no need to determine which one was used, as each can have its own interrupt handler).

neu-rah commented 6 years ago

hi! on non-AVR's: PCINT uses the normal interrupt (on every pin) only presenting the same interface, however if messing with normal interrupts then it is an issue.. it might be ok on non avr's, have you used it on the m0?

i will check pcint on interrupt pins on avr, thanks for reporting it.

there are encoder alternatives on ArduinoMenu: encoder - uses pcint's clickEncoder - uses a timer (and provides accel)