Interrupt worked on 1.1.1 but SOS's on 1.2.1

I recently updated one of my photon devices to 1.2.1 and noticed that an interrupt that reacted based on change of a button click gives an SOS now. I was wondering if there was any change between 1.1.1 and 1.2.1 that might’ve caused this to start happening? I tried looking at the chagelog but other than some mentions of ISR, I’m not too sure I’ll find anything there. They’re a bit too technical for me unfortunately and I dont understand the majority of what they mean.

Might be related to this i think https://github.com/particle-iot/device-os/pull/1761
The SOS code is a heap error (14 blinks).

Yup, that’s the cause and (also impacts some libraries - see last “comment” in the PR comment thread)

Maybe if you post your code (or at least the ISR) we might see which instruction may be triggering the issue.

1 Like

Thanks for directing me in the right direction. I took out a digitalwrite that was happening in the interrupt. I’m guessing thats not the best practice.

digitalWrite() should not be a problem inside an ISR.
However, when speed plays a role (and using interrupts for pin control usually means that) then you could use digitalWriteFast() or even pinSetFast() and pinResetFast() to save some time.

1 Like