There has to be a neat way to do this, or else the alarm clock would not work either. I remember there was some talk of this before, was it so that there are some special libs you need to link your code against to make it not to go to sleep when the device goes to low power mode?