mirror of https://github.com/espruino/BangleApps
Misc tweaks to reduce RAM usage - not really enough to warrant version change
parent
901adb4328
commit
2f2bd423dd
|
@ -1,13 +1,11 @@
|
||||||
(function(){
|
(function(){
|
||||||
var img_bt = E.toArrayBuffer(atob("CxQBBgDgFgJgR4jZMawfAcA4D4NYybEYIwTAsBwDAA=="));
|
|
||||||
|
|
||||||
function draw() {
|
function draw() {
|
||||||
g.reset();
|
g.reset();
|
||||||
if (NRF.getSecurityStatus().connected)
|
if (NRF.getSecurityStatus().connected)
|
||||||
g.setColor(0,0.5,1);
|
g.setColor(0,0.5,1);
|
||||||
else
|
else
|
||||||
g.setColor(0.3,0.3,0.3);
|
g.setColor(0.3,0.3,0.3);
|
||||||
g.drawImage(img_bt,10+this.x,2+this.y);
|
g.drawImage(atob("CxQBBgDgFgJgR4jZMawfAcA4D4NYybEYIwTAsBwDAA=="),10+this.x,2+this.y);
|
||||||
}
|
}
|
||||||
function changed() {
|
function changed() {
|
||||||
WIDGETS["bluetooth"].draw();
|
WIDGETS["bluetooth"].draw();
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
(function(){
|
(function(){
|
||||||
if (!Bangle.isGPSOn) return; // old firmware
|
if (!Bangle.isGPSOn) return; // old firmware
|
||||||
var img = E.toArrayBuffer(atob("GBiBAAAAAAAAAAAAAA//8B//+BgYGBgYGBgYGBgYGBgYGBgYGB//+B//+BgYGBgYGBgYGBgYGBgYGBgYGB//+A//8AAAAAAAAAAAAA=="));
|
|
||||||
|
|
||||||
function draw() {
|
function draw() {
|
||||||
g.reset();
|
g.reset();
|
||||||
|
@ -9,7 +8,7 @@
|
||||||
} else {
|
} else {
|
||||||
g.setColor(0.3,0.3,0.3); // off = grey
|
g.setColor(0.3,0.3,0.3); // off = grey
|
||||||
}
|
}
|
||||||
g.drawImage(img, 10+this.x, 2+this.y);
|
g.drawImage(atob("GBiBAAAAAAAAAAAAAA//8B//+BgYGBgYGBgYGBgYGBgYGBgYGB//+B//+BgYGBgYGBgYGBgYGBgYGBgYGB//+A//8AAAAAAAAAAAAA=="), 10+this.x, 2+this.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
var timerInterval;
|
var timerInterval;
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
(function(){
|
(function(){
|
||||||
if (!Bangle.isHRMOn) return; // old firmware
|
if (!Bangle.isHRMOn) return; // old firmware
|
||||||
var img = E.toArrayBuffer(atob("FhaBAAAAAAAAAAAAAcDgD8/AYeGDAwMMDAwwADDAAMOABwYAGAwAwBgGADAwAGGAAMwAAeAAAwAAAAAAAAAAAAA="));
|
|
||||||
|
|
||||||
function draw() {
|
function draw() {
|
||||||
g.reset();
|
g.reset();
|
||||||
|
@ -9,7 +8,7 @@
|
||||||
} else {
|
} else {
|
||||||
g.setColor(0.3,0.3,0.3); // off = grey
|
g.setColor(0.3,0.3,0.3); // off = grey
|
||||||
}
|
}
|
||||||
g.drawImage(img, 10+this.x, 2+this.y);
|
g.drawImage(atob("FhaBAAAAAAAAAAAAAcDgD8/AYeGDAwMMDAwwADDAAMOABwYAGAwAwBgGADAwAGGAAMwAAeAAAwAAAAAAAAAAAAA="), 10+this.x, 2+this.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
var timerInterval;
|
var timerInterval;
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
/* jshint esversion: 6 */
|
/* jshint esversion: 6 */
|
||||||
(() => {
|
(() => {
|
||||||
var icon = require("heatshrink").decompress(atob("jEYwIKHgwCBhwCBh4CEggPCkACBmAXDBwVZ+EB+F4gEsjl8EgMP+EChk/gEMh+ehkA+YIBxwxBnF/4HggH/wEAj0AA=="));
|
|
||||||
var color = 0x4A69;
|
var color = 0x4A69;
|
||||||
|
|
||||||
function draw() {
|
function draw() {
|
||||||
g.reset().setColor(color).drawImage(icon, this.x + 1, 0);
|
g.reset().setColor(color).drawImage(require("heatshrink").decompress(atob("jEYwIKHgwCBhwCBh4CEggPCkACBmAXDBwVZ+EB+F4gEsjl8EgMP+EChk/gEMh+ehkA+YIBxwxBnF/4HggH/wEAj0AA==")), this.x + 1, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
WIDGETS["widhwt"] = { area: "tr", width: 26, draw: draw };
|
WIDGETS["widhwt"] = { area: "tr", width: 26, draw: draw };
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
/* jshint esversion: 6 */
|
/* jshint esversion: 6 */
|
||||||
(() => {
|
(() => {
|
||||||
var id = NRF.getAddress().substr().substr(12).split(":");
|
|
||||||
|
|
||||||
// draw your widget at xpos
|
|
||||||
function draw() {
|
function draw() {
|
||||||
|
var id = NRF.getAddress().substr().substr(12).split(":");
|
||||||
g.reset().setColor(0, 0.5, 1).setFont("6x8", 1);
|
g.reset().setColor(0, 0.5, 1).setFont("6x8", 1);
|
||||||
g.drawString(id[0], this.x+2, this.y+4, true);
|
g.drawString(id[0], this.x+2, this.y+4, true);
|
||||||
g.drawString(id[1], this.x+2, this.y+14, true);
|
g.drawString(id[1], this.x+2, this.y+14, true);
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
/* jshint esversion: 6 */
|
/* jshint esversion: 6 */
|
||||||
(() => {
|
(() => {
|
||||||
const CBS = 0x41f, CBC = 0x07E0;
|
const CBS = 0x41f, CBC = 0x07E0;
|
||||||
var batS = require("heatshrink").decompress(atob("j0TwIHEv///kD////EfAYPwuEAgPB4EAg/HCgMfzgDBvwOC/IOC84ONDoUcFgc/AYOAHYRDE"));
|
|
||||||
var xo = 6, xl = 22, yo = 9, h = 17;
|
var xo = 6, xl = 22, yo = 9, h = 17;
|
||||||
|
|
||||||
function draw() {
|
function draw() {
|
||||||
g.reset().setColor(CBS).drawImage(batS, this.x + 1, this.y + 4);
|
g.reset().setColor(CBS).drawImage(require("heatshrink").decompress(atob("j0TwIHEv///kD////EfAYPwuEAgPB4EAg/HCgMfzgDBvwOC/IOC84ONDoUcFgc/AYOAHYRDE")), this.x + 1, this.y + 4);
|
||||||
g.setColor(0).fillRect(this.x + xo, this.y + yo, this.x + xl, this.y + h);
|
g.setColor(0).fillRect(this.x + xo, this.y + yo, this.x + xl, this.y + h);
|
||||||
var cbc = (Bangle.isCharging()) ? CBC : CBS;
|
var cbc = (Bangle.isCharging()) ? CBC : CBS;
|
||||||
g.setColor(cbc).fillRect(this.x + xo, this.y + yo, this.x + (xl - xo) / 100 * E.getBattery() + xo, this.y + h);
|
g.setColor(cbc).fillRect(this.x + xo, this.y + yo, this.x + (xl - xo) / 100 * E.getBattery() + xo, this.y + h);
|
||||||
|
|
|
@ -21,9 +21,8 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function draw(){
|
function draw(){
|
||||||
var img = E.toArrayBuffer(atob("GBgBAAAAAAAAAAAAAAAAAH4AAf+AB4HgDgBwHDw4OH4cMOcMYMMGYMMGMOcMOH4cHDw4DgBwB4HgAf+AAH4AAAAAAAAAAAAAAAAA"));
|
|
||||||
g.setColor(0x07ff);
|
g.setColor(0x07ff);
|
||||||
g.drawImage(img,this.x,this.y);
|
g.drawImage(atob("GBgBAAAAAAAAAAAAAAAAAH4AAf+AB4HgDgBwHDw4OH4cMOcMYMMGYMMGMOcMOH4cHDw4DgBwB4HgAf+AAH4AAAAAAAAAAAAAAAAA"),this.x,this.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
WIDGETS["viz"] ={area:"tl", width:24,draw:draw};
|
WIDGETS["viz"] ={area:"tl", width:24,draw:draw};
|
||||||
|
|
Loading…
Reference in New Issue