1
0
Fork 0

settings/boot update - **Rotation** allows you to rotate (or mirror) what's displayed on the screen, eg. for left-handed wearers (needs 2v16 or 2v15 cutting edge firmware to work reliably)

master
Gordon Williams 2022-10-21 15:01:35 +01:00
parent 5773ce30e5
commit d49728fa63
7 changed files with 21 additions and 2 deletions

View File

@ -53,3 +53,5 @@
0.47: Add polyfill for setUI with an object as an argument (fix regression for 2v12 devices after Layout module changed)
0.48: Workaround for BTHRM issues on Bangle.js 1 (write .boot files in chunks)
0.49: Store first found clock as a setting to speed up further boots
0.50: Allow setting of screen rotation
Remove support for 2v11 and earlier firmware

View File

@ -92,6 +92,7 @@ if (s.options) boot+=`Bangle.setOptions(${E.toJS(s.options)});\n`;
if (s.brightness && s.brightness!=1) boot+=`Bangle.setLCDBrightness(${s.brightness});\n`;
if (s.passkey!==undefined && s.passkey.length==6) boot+=`NRF.setSecurity({passkey:${E.toJS(s.passkey.toString())}, mitm:1, display:1});\n`;
if (s.whitelist) boot+=`NRF.on('connect', function(addr) { if (!(require('Storage').readJSON('setting.json',1)||{}).whitelist.includes(addr)) NRF.disconnect(); });\n`;
if (s.rotate) boot+=`g.setRotation(${s.rotate&3},${s.rotate>>2});\n` // screen rotation
// Pre-2v10 firmwares without a theme/setUI
delete g.theme; // deleting stops us getting confused by our own decl. builtins can't be deleted
if (!g.theme) {

View File

@ -1,7 +1,7 @@
{
"id": "boot",
"name": "Bootloader",
"version": "0.49",
"version": "0.50",
"description": "This is needed by Bangle.js to automatically load the clock, menu, widgets and settings",
"icon": "bootloader.png",
"type": "bootloader",

View File

@ -55,3 +55,4 @@
0.48: Allow reading custom themes from files
0.49: Now reloads settings properly after 'Calibrate Battery'
0.50: Add Bangle.js 2 touchscreen calibration - for 2v16 or 2v15 cutting edge builds
0.51: Add option for left-handed users

View File

@ -29,6 +29,7 @@ This is Bangle.js's settings menu
* **LCD Brightness** set how bright the LCD is. Due to hardware limitations in the LCD backlight, you may notice flicker if the LCD is not at 100% brightness.
* **LCD Timeout** how long should the LCD stay on for if no activity is detected. 0=stay on forever
* **Rotation** allows you to rotate (or mirror) what's displayed on the screen, eg. for left-handed wearers (needs 2v16 or 2v15 cutting edge firmware to work reliably)
* **Wake on X** should the given activity wake up the Bangle.js LCD?
* On Bangle.js 2 when locked the touchscreen is turned off to save power. Because of this,
`Wake on Touch` actually uses the accelerometer, and you need to actually tap the display to wake Bangle.js.

View File

@ -1,7 +1,7 @@
{
"id": "setting",
"name": "Settings",
"version": "0.50",
"version": "0.51",
"description": "A menu for setting up Bangle.js",
"icon": "settings.png",
"tags": "tool,system",

View File

@ -383,6 +383,8 @@ function showLCDMenu() {
// converts Espruino internal unit to g
function internalToG(u) { return u / 8192; }
var rotNames = [/*LANG*/"No",/*LANG*/"Rotate CW",/*LANG*/"Left Handed",/*LANG*/"Rotate CCW",/*LANG*/"Mirror"];
const lcdMenu = {
'': { 'title': 'LCD' },
'< Back': ()=>showSystemMenu(),
@ -408,6 +410,18 @@ function showLCDMenu() {
Bangle.setLCDTimeout(settings.timeout);
}
},
/*LANG*/'Rotate': {
value: 0|settings.rotate,
min: 0,
max: rotNames.length-1,
format: v=> rotNames[v],
onchange: v => {
settings.rotate = 0 | v;
updateSettings();
g.setRotation(settings.rotate&3,settings.rotate>>2).clear();
Bangle.drawWidgets();
}
},
/*LANG*/'Wake on BTN1': {
value: settings.options.wakeOnBTN1,
format: boolFormat,