[SOLVED] latest git-snapshot causes freezes
-
I only used the pin change interrupt in another sketch. I was doubting Serial in sections without isr too! But they are clever. Serial output depends on polling in sections where interrupts are disabled ;-)
-
@cimba007 said:
Serial output depends on polling in sections where interrupts are disabled
Ok, learned something today ;-)
The PR has now been merged to development btw.
@Yveaux While we are at this topic .. any chance to let the user-code know what caused the wakeup during sleep() ??
For example .. if there was a wakeup at all or which of the two interrupt sources was the cause.
Unforunatly the "cause" gets cleaned up at the end of hwSleep:
bool interruptWakeUp() { return _wokeUpByInterrupt != INVALID_INTERRUPT_NUM; }Calling this from user-code will always return 0 as the end of hwSleep does this:
_wokeUpByInterrupt = INVALID_INTERRUPT_NUM;Not clearing the "last interrupt source" would be nice.
-
@Yveaux While we are at this topic .. any chance to let the user-code know what caused the wakeup during sleep() ??
For example .. if there was a wakeup at all or which of the two interrupt sources was the cause.
Unforunatly the "cause" gets cleaned up at the end of hwSleep:
bool interruptWakeUp() { return _wokeUpByInterrupt != INVALID_INTERRUPT_NUM; }Calling this from user-code will always return 0 as the end of hwSleep does this:
_wokeUpByInterrupt = INVALID_INTERRUPT_NUM;Not clearing the "last interrupt source" would be nice.
-
@cimba007 The return value of sleep() indicates the wake-up cause: irq (nr) or timer (=MY_WAKE_UP_BY_TIMER).
See here: https://github.com/mysensors/MySensors/blob/development/core/MyHwATMega328.cpp#L146-L147 -
@cimba007 said:
Serial output depends on polling in sections where interrupts are disabled
Ok, learned something today ;-)
The PR has now been merged to development btw.