commit 6cb6b0fce6583810631c386456982a9bc874a03c
parent f14806fed5ef1c96ac6b20a1c2b67bf191e284ce
Author: dsp56300 <dsp56300@users.noreply.github.com>
Date: Sat, 18 May 2024 16:38:51 +0200
only send global parameter change to DSP if it is actually changing, prevents pingpong between hardware and emulator
Diffstat:
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/source/virusLib/microcontroller.cpp b/source/virusLib/microcontroller.cpp
@@ -390,6 +390,13 @@ bool Microcontroller::send(const Page _page, const uint8_t _part, const uint8_t
{
std::lock_guard lock(m_mutex);
+ if(_page == globalSettingsPage())
+ {
+ if(m_globalSettings[_param] == _value)
+ return true;
+ m_globalSettings[_param] = _value;
+ }
+
writeHostBitsWithWait(0,1);
TWord buf[] = {0xf4f400, 0x0};
@@ -399,10 +406,6 @@ bool Microcontroller::send(const Page _page, const uint8_t _part, const uint8_t
// LOG("Send command, page " << (int)_page << ", part " << (int)_part << ", param " << (int)_param << ", value " << (int)_value);
- if(_page == globalSettingsPage())
- {
- m_globalSettings[_param] = _value;
- }
return true;
}