Skip to content

Commit

Permalink
Issue #15 : Remove the redundant parameter check code from ConfigureS…
Browse files Browse the repository at this point in the history
…RC()

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.
  • Loading branch information
suikan4github committed Oct 16, 2024
1 parent 429c954 commit 29f9eec
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/codec/adau1361lower.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down Expand Up @@ -549,7 +545,7 @@ void ::rpp_driver::Adau1361Lower::ConfigureSrc(unsigned int fs) {
break;
}
default:
assert(false);
assert(false && "Bad Fs");
}
}

Expand Down

0 comments on commit 29f9eec

Please # to comment.