Updates from code review

master
David Volovskiy 2025-03-07 05:28:15 -05:00
parent 13092d5c74
commit f431258eaf
2 changed files with 6 additions and 3 deletions

View File

@ -19,6 +19,7 @@ let pal2; // palette for 50-100%
const infoLine = (3*h/4) - 6; const infoLine = (3*h/4) - 6;
const infoWidth = 56; const infoWidth = 56;
const infoHeight = 11; const infoHeight = 11;
const sec_update = 3000; // This ms between updates when the ring is in Seconds mode
var drawingSteps = false; var drawingSteps = false;
function log_debug(o) { function log_debug(o) {
@ -686,9 +687,9 @@ function buzzer(n) {
// timeout used to update every minute // timeout used to update every minute
var drawTimeout; var drawTimeout;
// schedule a draw for the next minute or every 5 seconds // schedule a draw for the next minute or every sec_update ms
function queueDraw() { function queueDraw() {
let delay = (settings.ring == 'Seconds') ? (3000 - (Date.now() % 3000)) : (60000 - (Date.now() % 60000)); let delay = settings.ring == 'Seconds' ? sec_update - (Date.now() % sec_update) : 60000 - (Date.now() % 60000);
if (drawTimeout) clearTimeout(drawTimeout); if (drawTimeout) clearTimeout(drawTimeout);
drawTimeout = setTimeout(function() { drawTimeout = setTimeout(function() {
drawTimeout = undefined; drawTimeout = undefined;

View File

@ -77,7 +77,9 @@
s.ring = ring_options[v]; s.ring = ring_options[v];
save(); save();
if (prev != s.ring && (prev === 'Steps' || s.ring === 'Steps')) { if (prev != s.ring && (prev === 'Steps' || s.ring === 'Steps')) {
setTimeout(showMainMenu, 0); // Reference https://github.com/orgs/espruino/discussions/7697 // redisplay the menu with/without ring setting
// Reference https://github.com/orgs/espruino/discussions/7697
setTimeout(showMainMenu, 0);
} }
}, },
} }