MaPaLo76
|
d114a58de6
|
fix(phase5): LaserTracker neu - Session/Burst-Logik korrigiert
- BurstState-Maschine: INACTIVE -> GRATIS -> NET_COUNTING
- _sessionNetSec (RAM): Netto-Sekunden der Betriebssitzung, reset beim Start
- _totalMinutesBase (NVS via settings.saveTotalMinutes): persistierte Gesamtzeit
- Gratis-Countdown startet bei JEDEM Laser-AN-Ereignis neu
- Netto-Zeit wird erst nach Ablauf der Gratiszeit gezaehlt
- getSessionMinutes(): sessionNetSec / 60 (ganzzahlig, hart)
- getCountdownRemaining(): nur 0 wenn INACTIVE oder NET_COUNTING
- Display Module 1-3: Session-Minuten (nicht Gesamtzeit)
- Display Module 5-7: Countdown waehrend GRATIS, sonst Idle
- settings.saveTotalMinutes() statt direkter Preferences-Calls
- main.cpp + test_laser_tracker.cpp auf neue API umgestellt
|
2026-02-22 18:48:35 +01:00 |
|
MaPaLo76
|
3827342c0c
|
feat(laser): implement LaserTracker with debounce, gratis time and NVS save
- Add include/laser_tracker.h: LaserTracker class declaration
- Software debounce (LASER_DEBOUNCE_MS = 50ms from config.h)
- Polarity-aware GPIO read (LOW_ACTIVE / HIGH_ACTIVE from settings)
- Session lifecycle: onSessionStart / onSessionEnd
- Gratis time countdown, net seconds accumulation
- Getters: isActive, getTotalMinutes, getSessionSeconds,
getCountdownRemaining, getLastSessionSeconds, resetTotal
- Add src/laser_tracker.cpp: full implementation
- readRaw() applies signal polarity
- loop() handles debounce state machine and edge detection
- onSessionEnd() saves updated totalMinutes to NVS
- getTotalMinutes() returns live value (base + current net session)
- Add test_sketches/test_laser_tracker.cpp: interactive test sketch
- Button on GPIO 4 simulates laser signal
- BOOT button (GPIO 0, 3s hold) resets total
- Display: modules 1-3 = total minutes, modules 5-7 = countdown/net
- Add test-laser-tracker env to platformio.ini
- Update src/main.cpp: integrate laserTracker.begin/loop + live display
- Update Implementation-Plan.md: mark Phase 5 tasks 5.1-5.6 complete
|
2026-02-22 14:30:14 +01:00 |
|