Followup to es int patch

2.0.x
Scott Lahteine 5 years ago
parent 35cd545106
commit d80ef43c19

@ -94,7 +94,7 @@ void endstop_ISR() { endstops.update(); }
// Install Pin change interrupt for a pin. Can be called multiple times. // Install Pin change interrupt for a pin. Can be called multiple times.
void pciSetup(const int8_t pin) { void pciSetup(const int8_t pin) {
if (digitalPinToPCMSK(pin) != nullptr) { if (digitalPinHasPCICR(pin)) {
SBI(*digitalPinToPCMSK(pin), digitalPinToPCMSKbit(pin)); // enable pin SBI(*digitalPinToPCMSK(pin), digitalPinToPCMSKbit(pin)); // enable pin
SBI(PCIFR, digitalPinToPCICRbit(pin)); // clear any outstanding interrupt SBI(PCIFR, digitalPinToPCICRbit(pin)); // clear any outstanding interrupt
SBI(PCICR, digitalPinToPCICRbit(pin)); // enable interrupt for the group SBI(PCICR, digitalPinToPCICRbit(pin)); // enable interrupt for the group

Loading…
Cancel
Save