Interrupt with gw.wait?



  • Hi,

    Is it possible to interrupt the wait period when receiving an interrupt?

    I basically want to do this, but it's only available with gw.sleep.
    gw.wait(INTERRUPT,CHANGE, SLEEP_TIME);



  • Agree.

    Not sure if we have the same use case, but in my case I have created a sensor node sketch, where the actual nodes are a mix of battery powered and net powered devices. Due to the size of the buildings I need to use repeaters, so I enable repeater mode for the net powered devices. (#define MY_REPEATER_FEATURE)

    Ideally, this define should take care of everything, but as far as I know, I need to change sleep to wait, and they don't behave the same. Therefore I end up with different behavior.

    The best solution might be if I wait would behave exactly the same as sleep, except that it does not enter sleep mode. And the sleep function could be smart enough to call wait instead of entering sleep when something prevents it from entering sleep mode (like MY_REPEATER_FEATURE), so I can keep the sketch unchanged when enabling repeater mode. (Note that I work on the 1.6b version)


  • Admin

    @frankiboy

    Sounds reasonable. Al''add it to the TODO list.


Log in to reply
 

Suggested Topics

0
Online

11.4k
Users

11.1k
Topics

112.7k
Posts