mirror of https://github.com/espruino/BangleApps
Disable GPS time log messages, add (default=1) setting to hide log messages
parent
f3efada354
commit
9a76d6d800
|
@ -2,7 +2,7 @@
|
|||
{ "id": "boot",
|
||||
"name": "Bootloader",
|
||||
"icon": "bootloader.png",
|
||||
"version":"0.05",
|
||||
"version":"0.06",
|
||||
"description": "This is needed by Bangle.js to automatically load the clock, menu, widgets and settings",
|
||||
"tags": "tool,system",
|
||||
"storage": [
|
||||
|
@ -81,7 +81,7 @@
|
|||
{ "id": "setting",
|
||||
"name": "Settings",
|
||||
"icon": "settings.png",
|
||||
"version":"0.03",
|
||||
"version":"0.04",
|
||||
"description": "A menu for setting up Bangle.js",
|
||||
"tags": "tool,system",
|
||||
"storage": [
|
||||
|
|
|
@ -2,3 +2,4 @@
|
|||
0.03: Fix issue switching clockfaces via menu
|
||||
0.04: Add alarm functionality
|
||||
0.05: Add Welcome screen on boot
|
||||
0.06: Disable GPS time log messages, add (default=1) setting to hide log messages
|
||||
|
|
|
@ -8,8 +8,14 @@ if (s.ble!==false) {
|
|||
NRF.setServices({}, {uart:true, hid:Bangle.HID});
|
||||
}
|
||||
}
|
||||
// If not programmable, force terminal onto screen
|
||||
if (s.dev===false) Terminal.setConsole(true);
|
||||
if (s.blerepl===false) { // If not programmable, force terminal off Bluetooth
|
||||
if (s.log) Terminal.setConsole(true); // if showing debug, force REPL onto terminal
|
||||
else if (E.setConsole) E.setConsole(null,{force:true}); // on new (2v05+) firmware we have E.setConsole which allows a 'null' console
|
||||
else LoopbackA.setConsole(true); // for old builds, doing this will use some data as LoopbackB stores some of the chars
|
||||
} else {
|
||||
if (s.log) Terminal.setConsole(); // if showing debug, put REPL on terminal (until connection)
|
||||
else Bluetooth.setConsole(true); // else if no debug, force REPL to Bluetooth
|
||||
}
|
||||
// we just reset, so BLE should be on
|
||||
if (s.ble===false) NRF.sleep();
|
||||
// Set time, vibrate, beep, etc
|
||||
|
@ -45,17 +51,17 @@ function checkAlarm() {
|
|||
}
|
||||
// check to see if our clock is wrong - if it is use GPS time
|
||||
if ((new Date()).getFullYear()==1970) {
|
||||
console.log("Searching for GPS time");
|
||||
//console.log("Searching for GPS time");
|
||||
Bangle.on('GPS',function cb(g) {
|
||||
Bangle.setGPSPower(0);
|
||||
Bangle.removeListener("GPS",cb);
|
||||
if (!g.time || (g.time.getFullYear()<2000) ||
|
||||
(g.time.getFullYear()==2250)) {
|
||||
console.log("GPS receiver's time not set");
|
||||
//console.log("GPS receiver's time not set");
|
||||
return;
|
||||
}
|
||||
setTime(g.time.getTime()/1000);
|
||||
console.log("GPS time",g.time.toString());
|
||||
//console.log("GPS time",g.time.toString());
|
||||
checkAlarm();
|
||||
});
|
||||
Bangle.setGPSPower(1);
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
0.02: Add support for 30-minute timezones.
|
||||
0.03: Add support for Welcome app
|
||||
0.04: Add setting to disable log messages
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
ble: true, // Bluetooth enabled by default
|
||||
dev: true, // Is REPL on Bluetooth - can Espruino IDE be used?
|
||||
blerepl: true, // Is REPL on Bluetooth - can Espruino IDE be used?
|
||||
log: false, // Do log messages appear on screen?
|
||||
timeout: 10, // Default LCD timeout in seconds
|
||||
vibrate: true, // Vibration enabled by default. App must support
|
||||
beep: true, // Beep enabled by default. App must support
|
||||
|
@ -9,4 +10,5 @@
|
|||
clock: null, // a string for the default clock's name
|
||||
"12hour" : false, // 12 or 24 hour clock?
|
||||
distance : "kilometer" // or "mile"
|
||||
// welcomed : undefined/true (whether welcome app should show)
|
||||
}
|
||||
|
|
|
@ -11,19 +11,19 @@ function updateSettings() {
|
|||
|
||||
function resetSettings() {
|
||||
settings = {
|
||||
ble: true,
|
||||
dev: true,
|
||||
timeout: 10,
|
||||
vibrate: true,
|
||||
beep: true,
|
||||
timezone: 0,
|
||||
HID : false,
|
||||
clock: null,
|
||||
"12hour" : false,
|
||||
ble: true, // Bluetooth enabled by default
|
||||
blerepl: true, // Is REPL on Bluetooth - can Espruino IDE be used?
|
||||
log: false, // Do log messages appear on screen?
|
||||
timeout: 10, // Default LCD timeout in seconds
|
||||
vibrate: true, // Vibration enabled by default. App must support
|
||||
beep: true, // Beep enabled by default. App must support
|
||||
timezone: 0, // Set the timezone for the device
|
||||
HID : false, // BLE HID mode, off by default
|
||||
clock: null, // a string for the default clock's name
|
||||
"12hour" : false, // 12 or 24 hour clock?
|
||||
distance : "kilometer" // or "mile"
|
||||
// welcomed : undefined/true (whether welcome app should show)
|
||||
};
|
||||
Bangle.setLCDTimeout(settings.timeout);
|
||||
updateSettings();
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,7 @@ try {
|
|||
} catch (e) {}
|
||||
if (!settings) resetSettings();
|
||||
|
||||
const boolFormat = (v) => v ? "On" : "Off";
|
||||
const boolFormat = v => v ? "On" : "Off";
|
||||
|
||||
function showMainMenu() {
|
||||
const mainmenu = {
|
||||
|
@ -47,10 +47,18 @@ function showMainMenu() {
|
|||
}
|
||||
},
|
||||
'Programmable': {
|
||||
value: settings.dev,
|
||||
value: settings.blerepl,
|
||||
format: boolFormat,
|
||||
onchange: () => {
|
||||
settings.dev = !settings.dev;
|
||||
settings.blerepl = !settings.blerepl;
|
||||
updateSettings();
|
||||
}
|
||||
},
|
||||
'Debug info': {
|
||||
value: settings.log,
|
||||
format: v => v ? "Show" : "Hide",
|
||||
onchange: () => {
|
||||
settings.log = !settings.log;
|
||||
updateSettings();
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue