Bläddra i källkod

Followup to es int patch

Scott Lahteine 5 år sedan
förälder
incheckning
d80ef43c19
1 ändrade filer med 2 tillägg och 2 borttagningar
  1. 2
    2
      Marlin/src/HAL/HAL_AVR/endstop_interrupts.h

+ 2
- 2
Marlin/src/HAL/HAL_AVR/endstop_interrupts.h Visa fil

62
                                    WITHIN(p, 14, 15) ? 1 : \
62
                                    WITHIN(p, 14, 15) ? 1 : \
63
                                    WITHIN(p, 62, 69) ? 2 : \
63
                                    WITHIN(p, 62, 69) ? 2 : \
64
                                    0)
64
                                    0)
65
-  
65
+
66
   #undef  digitalPinToPCMSK
66
   #undef  digitalPinToPCMSK
67
   #define digitalPinToPCMSK(p)    (WITHIN(p, 10, 13) || WITHIN(p, 50, 53) ? (&PCMSK0) : \
67
   #define digitalPinToPCMSK(p)    (WITHIN(p, 10, 13) || WITHIN(p, 50, 53) ? (&PCMSK0) : \
68
                                    WITHIN(p, 14, 15) ? (&PCMSK1) : \
68
                                    WITHIN(p, 14, 15) ? (&PCMSK1) : \
94
 
94
 
95
 // Install Pin change interrupt for a pin. Can be called multiple times.
95
 // Install Pin change interrupt for a pin. Can be called multiple times.
96
 void pciSetup(const int8_t pin) {
96
 void pciSetup(const int8_t pin) {
97
-  if (digitalPinToPCMSK(pin) != nullptr) {
97
+  if (digitalPinHasPCICR(pin)) {
98
     SBI(*digitalPinToPCMSK(pin), digitalPinToPCMSKbit(pin));  // enable pin
98
     SBI(*digitalPinToPCMSK(pin), digitalPinToPCMSKbit(pin));  // enable pin
99
     SBI(PCIFR, digitalPinToPCICRbit(pin)); // clear any outstanding interrupt
99
     SBI(PCIFR, digitalPinToPCICRbit(pin)); // clear any outstanding interrupt
100
     SBI(PCICR, digitalPinToPCICRbit(pin)); // enable interrupt for the group
100
     SBI(PCICR, digitalPinToPCICRbit(pin)); // enable interrupt for the group

Laddar…
Avbryt
Spara