|
@@ -70,12 +70,20 @@ void DSPWriter::writeRegister(uint16_t memoryAddress, uint8_t length, const uint
|
|
|
// ---------------------------------------------------------------
|
|
// ---------------------------------------------------------------
|
|
|
// Safeload counter — static so it survives across DSPWriter
|
|
// Safeload counter — static so it survives across DSPWriter
|
|
|
// instances, but exposed via resetSafeload() so the TCP bridge
|
|
// instances, but exposed via resetSafeload() so the TCP bridge
|
|
|
-// can reset it cleanly at the start of each session.
|
|
|
|
|
|
|
+// can flush and reset cleanly on session start and disconnect.
|
|
|
// ---------------------------------------------------------------
|
|
// ---------------------------------------------------------------
|
|
|
static uint8_t s_safeload_count = 0;
|
|
static uint8_t s_safeload_count = 0;
|
|
|
|
|
|
|
|
void DSPWriter::resetSafeload()
|
|
void DSPWriter::resetSafeload()
|
|
|
{
|
|
{
|
|
|
|
|
+ // If the session ended mid-safeload, the DSP still has its own internal
|
|
|
|
|
+ // safeload counter pointing at those stale slots. Triggering IST here
|
|
|
|
|
+ // commits whatever is pending to parameter RAM so the DSP counter resets
|
|
|
|
|
+ // to zero before the next session writes new safeload data.
|
|
|
|
|
+ if (s_safeload_count > 0) {
|
|
|
|
|
+ uint8_t ist[2] = { 0x00, 0x3C };
|
|
|
|
|
+ DSPWriter::writeRegister(dspRegister::CoreRegister, sizeof(ist), ist);
|
|
|
|
|
+ }
|
|
|
s_safeload_count = 0;
|
|
s_safeload_count = 0;
|
|
|
}
|
|
}
|
|
|
|
|
|