You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • I wonder what happens if an application is terminated or replaced, while a sensor is powered on.

    It's fine. If an app was using something and you change app, the sensor is powered off.

    Espruino waits about 1 second after the new app has loaded, and then turns off anything that's not used by the new app. The reasoning is especially for stuff like GPS that can take a while to 'warm up' it's good to leave it running between apps if we can so it's ready to use as soon as possible.

    Any kind of atExit() callback, in order to clean up things properly before terminating?

    Yep, E.on('kill',...) - but no need to turn off the sensor (in fact because of the above, it may be a bad thing to do)

About

Avatar for Gordon @Gordon started