Interrupts disabled on Core FW 0.5.3 and later?

I just switched from FW 0.5.2 to 0.5.3 on the Core and noticed that my interrupts are not firing anymore.
Code is more or less straight out of the docs:
setup:
pinMode(D3, INPUT_PULLDOWN);
attachInterrupt(D3, IntHandle3, CHANGE);
code:
void IntHandle3()
{ do stuff }

Works fine with 0.5.2 and earlier. With 0.5.3 and 0.6.0-rc2, the interrupt does not fire. The sub never gets called.
If I add an
interrupts();
to the setup routine, it works again.
Did I miss this ‘feature’ in the release notes?
If so, please update the docs that interrupts have to be explicitly enabled.

Thanks,
Arne

I use interrupts i my code and it works fine with attachInterrupt(). What are you doing in the interrupt function?

I build a very simple setup to reproduce the issue.
Device is a Spark Core.
I when I apply a voltage such as VIN to D3, the blue led should light. If I remove the voltage, it goes off.
Here’s the complete code:

void IntHandle3(void);
volatile int IND3 = 0;

void setup() {
        pinMode(D3, INPUT_PULLDOWN);
        pinMode(D7, OUTPUT);
        IND3 = digitalRead(D3);
        digitalWrite(D7, IND3);
        attachInterrupt(D3, IntHandle3, CHANGE);

}

void loop() {

}

void IntHandle3() {
    if (IND3 != digitalRead(D3) )
        {
                IND3 = digitalRead(D3);
                digitalWrite(D7, IND3);
        }
}

It works fine with FW 0.5.2 and does not work with 0.5.3

I’ll have to dig up one of my Cores to check.
@kennethlimcp, have you tested with a Core?


Update:
I can confirm that I see the same thing with my Core.
@BDub, is this known/intended or should I open an GitHub issue?
Done!

And as mentioned, enabling the interrupts manually will make it work with 0.5.3:

void setup() {
		pinMode(D3, INPUT_PULLDOWN);
		pinMode(D7, OUTPUT);
		IND3 = digitalRead(D3);
		digitalWrite(D7, IND3);
		attachInterrupt(D3, IntHandle3, CHANGE);
		interrupts();
}

Yup, opened an issue

3 Likes

I’m glad I found this topic. I ran into the same issue. Now solved with this information. Thanks!

3 Likes

Great to hear!

… so all we need is a fixed firmware :wink:

1 Like

Agreed…

Bumped into this last night! Thanks for posting this!