Entry into critical section

Hi there,
I want to disable interupts in the section that sent messages.

Is the interruptDisable(); command is effective for LowPower Lib interrupts as LowPower.attachInterruptWakeup, or only for the arduino native attachInterrupt() ?

Thanks.

Which controller are you using?
You may be unable to send or receive messages with interrupts disabled.

can you explain the rationale there? many hardware in charge of transmitting data rely on interrupts

what do you want to protect yourself against?

Hi JML,
Unexpected behaviour of the device : Stay sometimes awake and never go back to sleep. I suspect never ending communication with the embeded SigFox module , because the rest of the code is really poor and can't lead to this behaviour.
But, actually, I didn't check the sigfox library to verify this hypothesis. Perhaps your right, and it's a wrong way.

with Sigfox' library you would send a payload as a transaction

  SigFox.beginPacket();
  SigFox.write(xxx);
  int ret = SigFox.endPacket();

if you are worried some sort of interrupt would come and corrupt the way you are building the payload, you could build the payload in a critical section

the ret value should tell you if the packet was sent correctly

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.