Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing readRawValue from LKCoreMicrophone. #188

Merged
merged 2 commits into from
Mar 21, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions drivers/LKCoreMicrophone/include/LKCoreMicrophone.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ class LKCoreMicrophone

float readVolume(void);

private:
float readRawValue(void);

private:
mbed::AnalogIn _pin;
};
Expand Down
7 changes: 1 addition & 6 deletions drivers/LKCoreMicrophone/source/LKCoreMicrophone.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,9 @@

namespace leka {

float LKCoreMicrophone::readRawValue(void) // TODO: make sure the method is useful and remove if needed
{
return _pin.read();
}

float LKCoreMicrophone::readVolume(void)
{
return readRawValue();
return _pin.read();
}

} // namespace leka
4 changes: 2 additions & 2 deletions drivers/LKCoreMicrophone/tests/LKCoreMicrophone_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ TEST(LKCoreMicrophoneTest, readMinSound)
ASSERT_EQ(expected, micro.readVolume());
}

TEST(LKCoreMicrophoneTest, readMiddleSound)
TEST(LKCoreMicrophoneTest, readAverageSound)
{
auto expected = test_set_sound(0.25f);
auto expected = test_set_sound(0.50f);

ASSERT_EQ(expected, micro.readVolume());
}
Expand Down