From 29f9eece2c98cc001699adf8b4601bf3129511b9 Mon Sep 17 00:00:00 2001 From: Seiichi Horie <26223147+suikan4github@users.noreply.github.com> Date: Wed, 16 Oct 2024 10:54:14 +0900 Subject: [PATCH 1/2] Issue #15 : Remove the redundant parameter check code from ConfigureSRC() The assertion at the top of the rpp_driver::Adau1361Lower::ConfigureSrc() was redudant becuase the switch-case statement has default to catch the unkown Fs. So, the assertion was removed. Death test passed. --- src/codec/adau1361lower.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/codec/adau1361lower.cpp b/src/codec/adau1361lower.cpp index ac0752b..a3b655a 100644 --- a/src/codec/adau1361lower.cpp +++ b/src/codec/adau1361lower.cpp @@ -512,10 +512,6 @@ void ::rpp_driver::Adau1361Lower::InitializeRegisters() { // Set the converter clock. void ::rpp_driver::Adau1361Lower::ConfigureSrc(unsigned int fs) { - assert((fs == 24000 || fs == 32000 || fs == 48000 || fs == 96000 || - fs == 22050 || fs == 44100 || fs == 88200) && - "Bad Fs"); - switch (fs) { case 22050: case 24000: { @@ -549,7 +545,7 @@ void ::rpp_driver::Adau1361Lower::ConfigureSrc(unsigned int fs) { break; } default: - assert(false); + assert(false && "Bad Fs"); } } From 6302a222dedd1f22e341dc1de5115aba1d5179c1 Mon Sep 17 00:00:00 2001 From: Seiichi Horie <26223147+suikan4github@users.noreply.github.com> Date: Wed, 16 Oct 2024 10:56:22 +0900 Subject: [PATCH 2/2] Add #15 to the Changelog. --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ec8b6a0..2fa1f3e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,8 @@ The issue #16 changes its public member function. But it is referred internally - [Issue #13](https://github.com/suikan4github/rpp_driver/issues/13) Exclude Mock definition from the GCov coverage. ### Changed - [Issue #10](https://github.com/suikan4github/rpp_driver/issues/10) Cover APIs of the Raspberry Pi Pico SDK. -- [Issue #16](https://github.com/suikan4github/rpp_driver/issues/16) Change the member function name from ConfigureSRC() to ConfigureSrc(). +- [Issue #15](https://github.com/suikan4github/rpp_driver/issues/15) Remove the redundant parameter check code from ConfigureSRC() +- [Issue #16](https://github.com/suikan4github/rpp_driver/issues/16) Change the member function name from ConfigureSRC() to ConfigureSrc(). ### Deprecated ### Removed ### Fixed