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:
@@ -28,15 +28,10 @@ bool FileManager::addMelody(JsonVariant doc) {
|
||||
const char* url = doc["download_url"];
|
||||
const char* melodyUid = doc["melodys_uid"];
|
||||
|
||||
// Check if this is a built-in melody - skip download if it exists
|
||||
if (BuiltInMelodies::isBuiltInMelody(melodyUid)) {
|
||||
const BuiltInMelodies::MelodyInfo* builtinMelody = BuiltInMelodies::findMelodyByUID(melodyUid);
|
||||
if (builtinMelody != nullptr) {
|
||||
LOG_INFO(TAG, "Melody '%s' is a built-in melody, skipping download", melodyUid);
|
||||
return true; // Success - no download needed
|
||||
}
|
||||
// If starts with builtin_ but not found, log warning and try download anyway
|
||||
LOG_WARNING(TAG, "Melody '%s' has builtin_ prefix but not found in library, attempting download", melodyUid);
|
||||
// Check built-in library by PID — skip download if found
|
||||
if (BuiltInMelodies::findMelodyByPID(melodyUid) != nullptr) {
|
||||
LOG_INFO(TAG, "Melody '%s' is a built-in, skipping download", melodyUid);
|
||||
return true;
|
||||
}
|
||||
|
||||
// Download the melody file to /melodies directory
|
||||
|
||||
Reference in New Issue
Block a user