diff --git a/apps/sunrise/ChangeLog b/apps/sunrise/ChangeLog index 1f1c7e8df..58e3c9232 100644 --- a/apps/sunrise/ChangeLog +++ b/apps/sunrise/ChangeLog @@ -3,3 +3,4 @@ 0.03: Show day/month, add animations, fix !mylocation and text glitch 0.04: Always show the widgets, swifter animations and lighter sea line 0.05: Fixed hours increasing too early, added missing 23 o'clock, simplified code +0.06: Draw the screen exactly on the minute boundary diff --git a/apps/sunrise/app.js b/apps/sunrise/app.js index 4c52020bb..4d1f444a4 100644 --- a/apps/sunrise/app.js +++ b/apps/sunrise/app.js @@ -358,13 +358,18 @@ function initialAnimation () { initialAnimationFrame(); } +function renderAndQueue() { + setTimeout(renderAndQueue, 60000 - (Date.now() % 60000)); + renderScreen(); +} + function main () { sunRiseX = xfromTime(sunrise.getHours() + sunrise.getMinutes() / 60); sunSetX = xfromTime(sunset.getHours() + sunset.getMinutes() / 60); g.setBgColor(0, 0, 0); g.clear(); - setInterval(renderScreen, 60 * 1000); + renderAndQueue(); initialAnimation(); } diff --git a/apps/sunrise/metadata.json b/apps/sunrise/metadata.json index 8b263e16c..0490a8543 100644 --- a/apps/sunrise/metadata.json +++ b/apps/sunrise/metadata.json @@ -2,7 +2,7 @@ "id": "sunrise", "name": "Sunrise", "shortName": "Sunrise", - "version": "0.05", + "version": "0.06", "type": "clock", "description": "Show sunrise and sunset times", "icon": "app.png",