[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.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login