From 33c3af4e9df41724f7f5421512477eece0f94388 Mon Sep 17 00:00:00 2001 From: Curtis Campbell Date: Mon, 29 Aug 2022 10:00:15 +0100 Subject: [PATCH 1/2] adds functionality for mute without slew --- src/SigmaDSP.cpp | 18 ++++++++++++++++++ src/SigmaDSP.h | 1 + 2 files changed, 19 insertions(+) diff --git a/src/SigmaDSP.cpp b/src/SigmaDSP.cpp index c057f6e..0e0860f 100644 --- a/src/SigmaDSP.cpp +++ b/src/SigmaDSP.cpp @@ -180,6 +180,24 @@ void SigmaDSP::volume(uint16_t startMemoryAddress, float dB) safeload_write(startMemoryAddress, volume); } +/** + * @brief control mute/unmute block without slew + * + * @param startMemoryAddress DSP memory address + * @param flag true or false + */ +void SigmaDSP::mute(uint16_t startMemoryAddress, bool flag) +{ + if (flag) + { + safeload_write(startMemoryAddress, 8388608); + } + else + { + safeload_write(startMemoryAddress, 0); + } +} + /** * @brief Control index filters (bass, treble, ect) * in 28 0 format. Please see: diff --git a/src/SigmaDSP.h b/src/SigmaDSP.h index 550c62a..6a29000 100644 --- a/src/SigmaDSP.h +++ b/src/SigmaDSP.h @@ -74,6 +74,7 @@ class SigmaDSP void volume_slew(uint16_t startMemoryAddress, float dB, uint8_t slew = 12); void volume(uint16_t startMemoryAddress, float dB); + void mute(uint16_t startMemoryAddress, bool flag); void dcSource(uint16_t startMemoryAddress, uint32_t value); void dynamicBass(uint16_t startMemoryAddress, float dB); void dynamicBass(uint16_t startMemoryAddress, float dB, uint16_t frequency); From 188aae6ded1bdc610472b160c93f0be0a82389f7 Mon Sep 17 00:00:00 2001 From: Curtis Campbell Date: Mon, 29 Aug 2022 10:32:02 +0100 Subject: [PATCH 2/2] refactors logic for mute and updates formatting --- src/SigmaDSP.cpp | 15 ++++----------- src/SigmaDSP.h | 2 +- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/src/SigmaDSP.cpp b/src/SigmaDSP.cpp index 0e0860f..88e1d7f 100644 --- a/src/SigmaDSP.cpp +++ b/src/SigmaDSP.cpp @@ -181,21 +181,14 @@ void SigmaDSP::volume(uint16_t startMemoryAddress, float dB) } /** - * @brief control mute/unmute block without slew + * @brief Control mute/unmute block without slew * * @param startMemoryAddress DSP memory address - * @param flag true or false + * @param state true or false */ -void SigmaDSP::mute(uint16_t startMemoryAddress, bool flag) +void SigmaDSP::mute(uint16_t startMemoryAddress, bool state) { - if (flag) - { - safeload_write(startMemoryAddress, 8388608); - } - else - { - safeload_write(startMemoryAddress, 0); - } + safeload_write(startMemoryAddress, state ? 0x800000 : 0); } /** diff --git a/src/SigmaDSP.h b/src/SigmaDSP.h index 6a29000..c8f8b90 100644 --- a/src/SigmaDSP.h +++ b/src/SigmaDSP.h @@ -74,7 +74,7 @@ class SigmaDSP void volume_slew(uint16_t startMemoryAddress, float dB, uint8_t slew = 12); void volume(uint16_t startMemoryAddress, float dB); - void mute(uint16_t startMemoryAddress, bool flag); + void mute(uint16_t startMemoryAddress, bool state); void dcSource(uint16_t startMemoryAddress, uint32_t value); void dynamicBass(uint16_t startMemoryAddress, float dB); void dynamicBass(uint16_t startMemoryAddress, float dB, uint16_t frequency);