All 3 LEDs turning on at once is a sign of an unreported error from the Nordic Bluetooth stack, so it's not specifically anything you're doing.
If it is 1v92 with the problem and it can be reproduced with just the above code I'll definitely take a look at fixing it - however I'm on holiday next week so it won't get done for a while.
In the mean time, it's not using that much power by advertising - and you can always reduce the advertising interval with setAdvertising which will have much the same effect, without the need for explicitly waking and sleeping.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Do you have an up to date firmware like 1v92?
All 3 LEDs turning on at once is a sign of an unreported error from the Nordic Bluetooth stack, so it's not specifically anything you're doing.
If it is 1v92 with the problem and it can be reproduced with just the above code I'll definitely take a look at fixing it - however I'm on holiday next week so it won't get done for a while.
In the mean time, it's not using that much power by advertising - and you can always reduce the advertising interval with
setAdvertising
which will have much the same effect, without the need for explicitly waking and sleeping.