You are reading a single comment by @Moray and its replies. Click here to read the full conversation.
  • Relatedly, I still haven't tracked my memory leaks down, so I am using this pattern for those devices (sensors) which only poll occasionally and do not require realtime:

    //simplified example with all the logic in init.
    E.on('init', function () {
        setDeepSleep(0); //only want to sleep after I finish my actions
        setTimeout(load, 600000); //restart every 10 minutes to poll again
        doPolls(function() { //callback function called when complete
            setDeepSleep(1); //now I can go to sleep until time to reboot
        });
    });
    

    Okay, I should find and fix my code leaks, but this is a common and/or reasonable pattern in embedded?

About

Avatar for Moray @Moray started