Patch es int tests for Arduino 1.8.10

This commit is contained in:
Scott Lahteine
2019-10-30 15:52:02 -05:00
parent c80eda073f
commit 35b1149d96
2 changed files with 28 additions and 46 deletions

View File

@ -2,17 +2,16 @@
// Compile with the same build settings you'd use for Marlin.
#if defined(ARDUINO_AVR_MEGA2560) || defined(ARDUINO_AVR_MEGA)
#undef digitalPinToPCICR
#define digitalPinToPCICR(p) ( ((p) >= 10 && (p) <= 15) || \
((p) >= 50 && (p) <= 53) || \
((p) >= 62 && (p) <= 69) ? &PCICR : nullptr)
#define moreDigitalPinToPCICR(p) digitalPinToPCICR(WITHIN(p, 13, 14) ? 10 : p)
#else
#define moreDigitalPinToPCICR(p) digitalPinToPCICR(p)
#endif
void setup() {
Serial.begin(9600);
Serial.println("PINs causing interrupts are:");
for (int i = 2; i < NUM_DIGITAL_PINS; i++) {
if (digitalPinToPCICR(i) || (int)digitalPinToInterrupt(i) != -1) {
if (moreDigitalPinToPCICR(i) || (int)digitalPinToInterrupt(i) != -1) {
for (int j = 0; j < NUM_ANALOG_INPUTS; j++) {
if (analogInputToDigitalPin(j) == i) {
Serial.print('A');