1
0
Fork 0

Merge pull request #3414 from espruino/revert-3411-revert-3384-fix/exstats-steps

Re-add "exstats: fix steps being negative"
master
Gordon Williams 2024-05-13 09:50:21 +01:00 committed by GitHub
commit d67f24ba8a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 6 additions and 3 deletions

View File

@ -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

View File

@ -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",

View File

@ -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
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

View File

@ -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",

View File

@ -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