MAJOR update. More like a Backup before things get Crazy

Added Websocket Support
Added Universal Message Handling for both MQTT and WS
Added Timekeeper Class, that handles Physical Clock and Scheduling
Added Bell Assignment Settings, Note to Bell mapping
This commit is contained in:
2025-09-05 19:27:13 +03:00
parent c1fa1d5e57
commit 101f9e7135
20 changed files with 10746 additions and 9766 deletions

35
vesper/dataLogging.hpp Normal file
View File

@@ -0,0 +1,35 @@
#pragma once
extern Player player;
void dataLogging (void * param) {
// Task Setup
uint16_t bellMaxLoad[16] = {60};
// Task Loop
for (;;) {
// Only run if player is playing OR we're still cooling
if (player.isPlaying || coolingActive) {
coolingActive = false; // will be re-enabled if any load > 0
for (uint8_t i = 0; i < 16; i++) {
if (bellLoad[i] > 0) {
bellLoad[i]--;
coolingActive = true; // still has heat left
}
// Optional: check for overload
if (bellLoad[i] > bellMaxLoad[i]) {
Serial.printf("⚠️ Bell %d OVERLOAD! load=%d max=%d\n",
i, bellLoad[i], bellMaxLoad[i]);
player.forceStop();
// You could also block new strikes here if you want
}
}
}
vTaskDelay(pdMS_TO_TICKS(1000)); // run every 1s
}
}