kitchen: added trip counter to stepo, revertd to direct screen writes to avoid mem errors

master
hughbarney 2021-05-10 20:32:02 +01:00
parent 1c7fd13cba
commit 41dde5ff2d
4 changed files with 19 additions and 8 deletions

View File

@ -3085,7 +3085,7 @@
{ "id": "kitchen",
"name": "Kitchen Combo",
"icon": "kitchen.png",
"version":"0.09",
"version":"0.10",
"description": "Combination of the Stepo, Walkersclock, Arrow and Waypointer apps into a multiclock format. 'Everything but the kitchen sink'. Requires firmware v2.08.167 or later",
"tags": "tool,outdoors,gps",
"type":"clock",

View File

@ -7,3 +7,4 @@
0.07: Added error codes if dependancies are missing
0.08: Improved error handling for missing firmware features, added template app.kit.js
0.09: Added heart rate monitor app
0.10: Converted Stepo to use direct screen writes, added a Trip Counter feature to stepo

View File

@ -50,8 +50,10 @@ The following buttons depend on which face is currently in use
- Show step count in the middle of the doughnut gauge
- The gauge show percentage of steps out of a goal of 10000 steps
- When the battery is less than 25% the doughnut turns red
- Use BTN1 to switch to the Trip Counter, use long press to reset Trip Counter
- Use BTN3 to switch to the next app
## GPS
![](screenshot_gps.jpg)
- Use BTN1 long press to switch the GPS on or off
@ -231,6 +233,9 @@ ArrayBuffer for stepo rather than using new everytime you switch back
into the stepo watch face. The problem is that the bangle memory
management / defragmentation is quite slow to run.
v0.10: Revisited having a display buffer for the stepo part of the App.
Now use direct screen writing as it means less memory allocation and
reduces chance of getting a memory error on switching watch faces.
### Error Codes
@ -242,7 +247,6 @@ The following error codes will be displayed if one of the dependancies is not me
### Issues / Future enhancements
* Revisit statically assigning the display buffer for stepo to avoid memory defrag
* GPS time display shows GMT and not BST, needs localising
* Occassional buzzing after 2-3 days of use, seems to disappear after
a reset to the launcher menu. Needs investigation

View File

@ -33,10 +33,10 @@ function nextFace(){
// when you feel the buzzer you know you have done a long press
function longPressCheck() {
Bangle.buzz();
debugObj.log("long PressCheck()");
debug_log("long PressCheck() buzz");
if (pressTimer) {
clearInterval(pressTimer);
debugObj.log("clear pressTimer 2");
debug_log("clear pressTimer 2");
pressTimer = undefined;
}
}
@ -48,10 +48,10 @@ function buttonPressed(btn) {
} else {
firstPress = getTime();
if (pressTimer) {
debugObj.log("clear pressTimer 1");
debug_log("clear pressTimer 1");
clearInterval(pressTimer);
}
debugObj.log("set pressTimer 1");
debug_log("set pressTimer 1");
pressTimer = setInterval(longPressCheck, 1500);
}
}
@ -60,7 +60,7 @@ function buttonPressed(btn) {
function buttonReleased(btn) {
var dur = getTime() - firstPress;
if (pressTimer) {
debugObj.log("clear pressTimer 3");
debug_log("clear pressTimer 3");
clearInterval(pressTimer);
pressTimer = undefined;
}
@ -256,7 +256,7 @@ GPS.prototype.processFix = function(fix) {
this.gpsState = this.GPS_RUNNING;
if (!this.last_fix.fix && !(require("Storage").readJSON("setting.json", 1) || {}).quiet) {
Bangle.buzz(); // buzz on first position
debugObj.log("GPS fix buzz");
debug_log("GPS fix buzz");
}
this.last_fix = fix;
}
@ -758,6 +758,7 @@ Debug Object
******************************************************************************/
/*
function DEBUG() {
this.logfile = require("Storage").open("debug.log","a");
}
@ -769,6 +770,11 @@ DEBUG.prototype.log = function(msg) {
}
debugObj = new DEBUG();
*/
function debug_log(m) {
//debugObj.log(m);
}
/*****************************************************************************