I am using imp.onidle to go to deep sleep but want to trigger it after imp.wakeup fires. is this behavior possible?
here is my code:
`
const SLEEP_TIME=5.0;
// update non volatile table with iteration count
if ((“nv” in getroottable()) && (“iteration” in nv)) {
nv.iteration++;
} else {
nv <- {iteration = 1};
}
function foo()
{
server.log(“done waiting”);
}
imp.wakeup(3, foo)
// Register with the server
imp.configure(“deepSleepTest”, [], []);
server.log("Execution run " + nv.iteration);
hardware.pin1.configure(DIGITAL_IN_WAKEUP); // configure wake-up pin
// Enter deep sleep
imp.onidle(function() { server.sleepfor(SLEEP_TIME); } );
`
i never see the done waiting message.