feat: multi-board HAL guards, RFRemote subsystem, Player/OTA improvements
Multi-board variant support: - variants/vesper.hpp: enable HAS_RF=1, define RF_RX_PIN=22 - variants/agnus.hpp: enable HAS_RF=1, RF_RX_PIN=22, correct HAS_RTC=0 - main.cpp, Player, HealthMonitor, OTAManager, ConfigManager: wrap all RTC/SD/RF-dependent code in #if HAS_RTC / HAS_SD_CARD / HAS_RF guards so Agnus builds cleanly without those peripherals RFRemote subsystem (new): - src/RFRemote/: RF receiver driver (GPIO RF_RX_PIN) + command handler - Registered with HealthMonitor and CommunicationRouter when HAS_RF=1 Player improvements: - uid -> pid rename throughout (Player, BuiltInMelodies, api-reference) - loadMelodyInRAM() now returns bool - playerControlTaskFn task added — defers stop/pause/resume out of timer callback (Tmr Svc) to avoid stack overflows - setDependencies() accepts nullptr FileManager for SD-less boards OTAManager: - Consume download_url from server metadata response instead of constructing firmware path locally - HTTP redirect following enabled (setFollowRedirects) - HAS_RTC guards on TimeKeeper references platformio.ini: - Add rc-switch library for RF remote support - Remove BOARD_TYPE/BOARD_NAME/BOARD_VERSION flags (moved to variant headers) - MQTT_SECRET placeholders only — no secrets in source Docs: - docs/architecture/codebase-refactor-plan.md: new migration strategy doc - docs/reference/api-reference.md: updated for pid, note_assignments, download_url - Remove stale docs: ota-telemetry-api.md, platformio-commands.md, firmware-variants.md Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -27,12 +27,16 @@
|
||||
#include <time.h>
|
||||
#include "../FileManager/FileManager.hpp"
|
||||
#include "../Telemetry/Telemetry.hpp"
|
||||
#if HAS_RTC
|
||||
#include "../TimeKeeper/TimeKeeper.hpp"
|
||||
#endif
|
||||
#include "../Version.hpp"
|
||||
|
||||
class ConfigManager; // Forward declaration
|
||||
class Player; // Forward declaration for idle check
|
||||
#if HAS_RTC
|
||||
class Timekeeper; // Forward declaration for freeze mode
|
||||
#endif
|
||||
class Telemetry; // Forward declaration for freeze mode
|
||||
|
||||
class OTAManager {
|
||||
@@ -72,7 +76,9 @@ public:
|
||||
void begin();
|
||||
void setFileManager(FileManager* fm);
|
||||
void setPlayer(Player* player); // Set player reference for idle check
|
||||
#if HAS_RTC
|
||||
void setTimeKeeper(Timekeeper* tk); // Set timekeeper reference for freeze mode
|
||||
#endif
|
||||
void setTelemetry(Telemetry* telemetry); // Set telemetry reference for freeze mode
|
||||
|
||||
void checkForUpdates();
|
||||
@@ -112,7 +118,9 @@ private:
|
||||
ConfigManager& _configManager;
|
||||
FileManager* _fileManager;
|
||||
Player* _player; // Player reference for idle check
|
||||
#if HAS_RTC
|
||||
Timekeeper* _timeKeeper; // TimeKeeper reference for freeze mode
|
||||
#endif
|
||||
Telemetry* _telemetry; // Telemetry reference for freeze mode
|
||||
Status _status;
|
||||
ErrorCode _lastError;
|
||||
@@ -121,6 +129,7 @@ private:
|
||||
size_t _expectedFileSize; // NEW: Expected firmware file size
|
||||
bool _updateAvailable;
|
||||
String _availableChecksum;
|
||||
String _availableDownloadPath; // Relative path from backend (e.g. /api/firmware/.../firmware.bin)
|
||||
String _updateChannel;
|
||||
bool _isMandatory;
|
||||
bool _isEmergency;
|
||||
|
||||
Reference in New Issue
Block a user