Interrupt on SAMD21 / definition

Hi,

I try to attach an interrupt on a samd21 controller with
attachInterrupt(25, ISR, FALLING);
but the interrupt doesn't get triggered. Is my definition in the variant.cpp correct and should it be supposed to work?

variant.cpp

// 25
  // --------------------
  { PORTB,  3, PIO_DIGITAL, (PIN_ATTR_DIGITAL), No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_6 }, //EXTERNAL_INT_NONE

Hey timtailors,

Would it be possible for you to post your full code?

Thanks, Zeb

Hi Zeb,

that's my full sketch

#define PIN_STATUS 25//PB03 pin48

int testvar;
int testvar_tmp;


void setup() {
    pinMode(PIN_STATUS, INPUT_PULLUP);
    attachInterrupt(PIN_STATUS, ISR_STATUS, FALLING);
    Serial0.begin(115200);
    Serial0.println(__FILE__);
}

void loop() {

  if (testvar!=testvar_tmp) {
    testvar_tmp=testvar;
    Serial0.println(testvar);
    }
}

void ISR_STATUS() {
    testvar++;
}

EDIT:

got it.. i needed to change the definition to EXTERNAL_INT_3
Is this not freely changable?

 { PORTB,  3, PIO_DIGITAL, (PIN_ATTR_DIGITAL), No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_3 },

Is this not freely changable?

It is NOT changeable. Any pin can cause an interrupt, but each pin causes a PARTICULAR interrupt.
See part 7 of the datasheet ("I/O Multiplexing and Considerations")
(also, it doesn't work if your try to enable interrupts on two pins that use the same interrupt)