mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-10-09 11:16:39 +00:00
Power: the UI loop sleeps until something is due (never with packets queued); screen off puts the CPU at 80 MHz, the GT911 to sleep (unless a tap wakes the screen) and the LP5814 in standby. GPS off now cuts the L76K's rail and UART on the L2 (L2GpsProvider). The battery divider is powered only for a reading (measured: settles at once); readings within 2 s are reused. The SD mount is retried at most every 5 s. Fixes: WiFi left on after leaving a scan, live tiles' WiFi kept with the screen off on the map, an ADC read every second for the status bar, touch polled on every pass while dark, a scan cutting an update's WiFi, relay count not refreshing in a channel thread, raw @[nick] in room previews. Labels skip unchanged text (no redraw). Helpers: scrollList, dimOverlay, settingRow, flexBox, nvs::get/put, trailFilePath (a second save in the same minute no longer overwrites), unreadTotal. Dead code removed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
43 lines
1.3 KiB
C++
43 lines
1.3 KiB
C++
#pragma once
|
|
|
|
#define RADIOLIB_STATIC_ONLY 1
|
|
#include <RadioLib.h>
|
|
#include <helpers/radiolib/RadioLibWrappers.h>
|
|
#include <helpers/radiolib/CustomSX1262Wrapper.h>
|
|
#include "WioTrackerL2Board.h"
|
|
#include <helpers/AutoDiscoverRTCClock.h>
|
|
#include <helpers/SensorManager.h>
|
|
#include <helpers/sensors/EnvironmentSensorManager.h>
|
|
#include <helpers/sensors/MicroNMEALocationProvider.h>
|
|
#ifdef DISPLAY_CLASS
|
|
#include "WioTrackerL2Display.h"
|
|
#include <helpers/ui/MomentaryButton.h>
|
|
#endif
|
|
|
|
// The L76K's power and reset lines are on the IO expander, out of the NMEA
|
|
// provider's reach: begin() / stop() / reset() drive them here, so GPS off
|
|
// (Settings, duty cycling) really powers the receiver down.
|
|
class L2GpsProvider : public MicroNMEALocationProvider {
|
|
bool _uart_off = false;
|
|
public:
|
|
using MicroNMEALocationProvider::MicroNMEALocationProvider;
|
|
void begin() override;
|
|
void stop() override;
|
|
void reset() override;
|
|
bool isEnabled() override;
|
|
};
|
|
|
|
extern WioTrackerL2Board board;
|
|
extern WRAPPER_CLASS radio_driver;
|
|
extern AutoDiscoverRTCClock rtc_clock;
|
|
extern EnvironmentSensorManager sensors;
|
|
extern L2GpsProvider gps;
|
|
|
|
#ifdef DISPLAY_CLASS
|
|
extern DISPLAY_CLASS display;
|
|
extern MomentaryButton user_btn;
|
|
#endif
|
|
|
|
bool radio_init();
|
|
mesh::LocalIdentity radio_new_identity();
|