From ea03c340991bada0af9fec78f7747b7af58fc9d4 Mon Sep 17 00:00:00 2001 From: Gordon Williams Date: Mon, 13 May 2024 09:49:52 +0100 Subject: [PATCH] Revert "Revert "exstats: fix steps being negative"" --- apps/run/ChangeLog | 1 + apps/run/metadata.json | 2 +- apps/runplus/ChangeLog | 3 ++- apps/runplus/metadata.json | 2 +- modules/exstats.js | 1 + 5 files changed, 6 insertions(+), 3 deletions(-) diff --git a/apps/run/ChangeLog b/apps/run/ChangeLog index ba46d9d06..af75a9aee 100644 --- a/apps/run/ChangeLog +++ b/apps/run/ChangeLog @@ -17,3 +17,4 @@ 0.16: Added ability to resume a run that was stopped previously (fix #1907) 0.17: Ensure screen redraws after "Resume run?" menu (#3044) 0.18: Minor code improvements +0.19: Fix step count bug when runs are resumed after a long time diff --git a/apps/run/metadata.json b/apps/run/metadata.json index 3b1c42e0c..99296180d 100644 --- a/apps/run/metadata.json +++ b/apps/run/metadata.json @@ -1,6 +1,6 @@ { "id": "run", "name": "Run", - "version": "0.18", + "version": "0.19", "description": "Displays distance, time, steps, cadence, pace and more for runners.", "icon": "app.png", "tags": "run,running,fitness,outdoors,gps", diff --git a/apps/runplus/ChangeLog b/apps/runplus/ChangeLog index 3c8cd0f74..8e9b7385b 100644 --- a/apps/runplus/ChangeLog +++ b/apps/runplus/ChangeLog @@ -24,4 +24,5 @@ Write to correct settings file, fixing settings not working. 0.21: Rebase on "Run" app ver. 0.16. 0.22: Ensure screen redraws after "Resume run?" menu (#3044) 0.23: Minor code improvements -0.24: Add indicators for lock,gps and pulse to karvonen screen \ No newline at end of file +0.24: Add indicators for lock,gps and pulse to karvonen screen +0.25: Fix step count bug when runs are resumed after a long time diff --git a/apps/runplus/metadata.json b/apps/runplus/metadata.json index 8b3703810..415194f7a 100644 --- a/apps/runplus/metadata.json +++ b/apps/runplus/metadata.json @@ -1,7 +1,7 @@ { "id": "runplus", "name": "Run+", - "version": "0.24", + "version": "0.25", "description": "Displays distance, time, steps, cadence, pace and more for runners. Based on the Run app, but extended with additional screen for heart rate interval training.", "icon": "app.png", "tags": "run,running,fitness,outdoors,gps,karvonen,karvonnen", diff --git a/modules/exstats.js b/modules/exstats.js index 28879ccfe..5cd0374a7 100644 --- a/modules/exstats.js +++ b/modules/exstats.js @@ -102,6 +102,7 @@ var stats = {}; const DATA_FILE = "exstats.json"; // Load the state from a saved file if there was one state = Object.assign(state, require("Storage").readJSON(DATA_FILE,1)||{}); +state.startSteps = Bangle.getStepCount() - (state.lastSteps - state.startSteps); // force step history to a uint8array state.stepHistory = new Uint8Array(state.stepHistory); // when we exit, write the current state