Зафиксировать рабочий BreathMonitor v1 и сервер

This commit is contained in:
AidarKC
2026-10-25 14:14:27 +03:00
parent 370f4ae94e
commit d5a37d3009
43 changed files with 2490 additions and 1522 deletions
@@ -0,0 +1,30 @@
# Manual Monitor LVGL v2
Dedicated LVGL firmware for the Waveshare ESP32-S3-Touch-AMOLED-2.16 manual breath monitor. It is separate from the legacy multi-mode GFX sketch and does not use USB D+/D- as sensor inputs.
## Controls
- `KEY2 / GPIO18`: `INHALE`, active LOW. Hold for about 1.2 seconds to open or close settings; this still accepts the INHALE phase.
- `KEY3 / GPIO0`: `EXHALE`, active LOW. Do not hold it during reset/boot.
- Short EXHALE completes a valid inhale/exhale cycle. Repeated INHALE or EXHALE presses are ignored.
- Hold `KEY3 / EXHALE` for about 1.2 seconds to enter or leave conscious pause. Hold does not create an EXHALE event. Paused time is removed from the phase and cycle timers; reminders and automatic power-off are suspended.
## Functionality
- Full-screen LVGL UI with a non-flickering partial draw buffer and the board's proven built-in LVGL font path.
- AXP2101 battery percentage, drawn battery icon, and charging marker at top right.
- Four numeric monitor cards are label-free; the spaced `HISTORY` row shows the last five completed cycles and their exact average is rendered to tenths of a second.
- Numeric cards use the display's straight built-in GFX digits; when AXP2101 reports an invalid `0%` while battery voltage is at least 3.3 V, the displayed percentage falls back to a voltage-derived estimate.
- Settings for limit, confirmation tick volume, alert volume, and screen timeout (`10 / 30 / 60 sec / Always on`), stored in NVS.
- The screen turns off after its selected idle timeout while monitoring continues. A touch or physical button wakes it.
- After a valid phase, reminders are silent for 30 seconds, quiet every 5 seconds through 60 seconds, loud every 5 seconds through 90 seconds, and loud every 15 seconds until 6:30. Then AXP2101 shuts down the device.
- A short average is evaluated at EXHALE, after the cycle is accepted. Consecutive short averages increase the warning sequence from one beep to five.
## Build or flash
From this folder:
```bash
NO_UPLOAD=1 ./burn.sh
./burn.sh
```