Add extra bar indicator for near-complete progress
Draws a small additional bar segment when progress reaches 95% or higher, positioned at x+14 within the progress bar cavity. The extra bar is capped at 3 pixels wide to fit within the available space.
This commit is contained in:
+3
-9
@@ -300,13 +300,6 @@ void HalGPIO::verifyPowerButtonWakeup(uint16_t requiredDurationMs, bool shortPre
|
|||||||
// Fast path - no duration check needed
|
// Fast path - no duration check needed
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// TODO: Intermittent edge case remains: a single tap followed by another single tap
|
|
||||||
// can still power on the device. Tighten wake debounce/state handling here.
|
|
||||||
|
|
||||||
// Calibrate: subtract boot time already elapsed, assuming button held since boot
|
|
||||||
const uint16_t calibration = millis();
|
|
||||||
const uint16_t calibratedDuration = (calibration < requiredDurationMs) ? (requiredDurationMs - calibration) : 1;
|
|
||||||
|
|
||||||
const auto start = millis();
|
const auto start = millis();
|
||||||
inputMgr.update();
|
inputMgr.update();
|
||||||
// inputMgr.isPressed() may take up to ~500ms to return correct state
|
// inputMgr.isPressed() may take up to ~500ms to return correct state
|
||||||
@@ -315,11 +308,12 @@ void HalGPIO::verifyPowerButtonWakeup(uint16_t requiredDurationMs, bool shortPre
|
|||||||
inputMgr.update();
|
inputMgr.update();
|
||||||
}
|
}
|
||||||
if (inputMgr.isPressed(BTN_POWER)) {
|
if (inputMgr.isPressed(BTN_POWER)) {
|
||||||
|
const auto holdStart = millis();
|
||||||
do {
|
do {
|
||||||
delay(10);
|
delay(10);
|
||||||
inputMgr.update();
|
inputMgr.update();
|
||||||
} while (inputMgr.isPressed(BTN_POWER) && inputMgr.getPowerButtonHeldTime() < calibratedDuration);
|
} while (inputMgr.isPressed(BTN_POWER) && millis() - holdStart < requiredDurationMs);
|
||||||
if (inputMgr.getPowerButtonHeldTime() < calibratedDuration) {
|
if (millis() - holdStart < requiredDurationMs) {
|
||||||
startDeepSleep();
|
startDeepSleep();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <BoardConfig.h>
|
||||||
#include <HalClock.h>
|
#include <HalClock.h>
|
||||||
#include <HalGPIO.h>
|
#include <HalGPIO.h>
|
||||||
#include <HalTiltSensor.h>
|
#include <HalTiltSensor.h>
|
||||||
@@ -268,6 +269,13 @@ inline std::vector<SettingInfo> getSettingsList(const SdCardFontRegistry* regist
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (BoardConfig::hasTouch()) {
|
||||||
|
v.erase(std::remove_if(v.begin(), v.end(),
|
||||||
|
[](const SettingInfo& s) {
|
||||||
|
return s.nameId == StrId::STR_FRONT_BTN_FOLLOW_ORIENTATION;
|
||||||
|
}),
|
||||||
|
v.end());
|
||||||
|
}
|
||||||
|
|
||||||
// Only show tilt page turn setting when the QMI8658 IMU is present (X3)
|
// Only show tilt page turn setting when the QMI8658 IMU is present (X3)
|
||||||
if (halTiltSensor.isAvailable()) {
|
if (halTiltSensor.isAvailable()) {
|
||||||
|
|||||||
@@ -101,6 +101,11 @@ void LyraTheme::fillBatteryIcon(const GfxRenderer& renderer, Rect rect, uint16_t
|
|||||||
if (percentage > 70) {
|
if (percentage > 70) {
|
||||||
renderer.fillRect(rect.x + 10, rect.y + 2, 3, rect.height - 4);
|
renderer.fillRect(rect.x + 10, rect.y + 2, 3, rect.height - 4);
|
||||||
}
|
}
|
||||||
|
const int extraBarX = rect.x + 14;
|
||||||
|
const int cavityRight = rect.x + 2 + (rect.width - 5);
|
||||||
|
if (percentage >= 95 && extraBarX < cavityRight) {
|
||||||
|
renderer.fillRect(extraBarX, rect.y + 2, std::min(3, cavityRight - extraBarX), rect.height - 4);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user