feat(t1000-e): gps duty cycle — deska ho neměla vůbec
9c033063 spravil persistenci prefs, jenže na T1000-E nebylo co
persistovat: tahle varianta má vlastní T1000SensorManager a celá duty
mašinérie žila jen v EnvironmentSensorManager, který nepoužívá. Slovo
"duty" se ve variants/t1000-e/ nevyskytovalo ani jednou.
Projevilo se to tiše, protože setSettingValue bral všechno nenulové jako
"zapni": `gps:2` tedy vrátilo OK a rozsvítilo GPS naplno. Ověřeno na
a-card — po nastavení i po rebootu hlásila `gps:1`.
Konstanty GPS_DUTY_* se stěhují do SensorManager.h, aby je viděly obě
implementace místo duplikátu.
Jeden záměrný rozdíl proti environment verzi: off-stavem je tady
sleep_gps(), ne stop_gps(). Sleep drží GPS_VRTC_EN, takže si přijímač
nechá almanach a další okno chytá teplý fix; stop shodí i VRTC a platil
by se studený start každých 30 minut — přesně to, čemu se duty vyhýbá.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pwhe5XoCuuEbBCNLvsJBPL
This commit is contained in:
1 parent
29770f1732
commit
7ffb8d0b8f
4 files changed
+82
-20
No files matched your search
@@ -16,9 +16,18 @@ class T1000SensorManager: public SensorManager {
|
||||
bool gps_active = false;
|
||||
LocationProvider * _nmea;
|
||||
|
||||
// Duty-cycle state, mirroring EnvironmentSensorManager: `gps_duty` is the
|
||||
// MODE, `gps_active` stays the truth about the receiver's power right now.
|
||||
// This board has its own manager, so the state machine cannot simply be
|
||||
// inherited -- see gpsDutyLoop() for the one T1000-specific difference.
|
||||
bool gps_duty = false;
|
||||
uint32_t gps_wake_at = 0; // millis of the next sync attempt
|
||||
uint32_t gps_awake_until = 0; // millis the current attempt gives up at
|
||||
|
||||
void start_gps();
|
||||
void sleep_gps();
|
||||
void stop_gps();
|
||||
void gpsDutyLoop();
|
||||
public:
|
||||
T1000SensorManager(LocationProvider &nmea): _nmea(&nmea) { }
|
||||
bool begin() override;
|
||||
|
||||
Reference in new issue
Block a user