zero attachInterrupt()

Hi @mantoui

thanks for the report, your analysis is correct, it was indeed a bug in variant and in the Core.

I've slighlty modified your test so it uses only the pins from 0 to 13 (that have no overlapping interrupts number):

const int LAST_PIN = 13;

volatile int tick;

void ding() {
  tick++;
}

void setup() {
  int i;
  for (i = 0; i <= LAST_PIN; i++) {
    pinMode(i, INPUT_PULLUP);
    attachInterrupt(i, ding, FALLING);
  }
  Serial.begin(9600);
}

void loop() {
  while (!tick);
  for (int i = 0; i <= LAST_PIN; i++)
    if (!digitalRead(i))
      Serial.print(i);
  Serial.print("  ");
  Serial.println(tick);
  tick = 0;
}

and now I can see that the pins interrupt works as expected (except pin 4 that is NMI so it's not available as external pin interrupt).

The fix is already merged upstream, it will be available with the next release of SAMD core (1.6.2).

If you want to try it now you can use the "hourly build": GitHub - arduino/ArduinoCore-samd: Arduino Core for SAMD21 CPU