Skip to content

Commit

Permalink
🔀 Merge branch 'yann/refactor/bufferedserial/remove-enable-input-disa…
Browse files Browse the repository at this point in the history
…ble-input' into develop
  • Loading branch information
ladislas committed Feb 4, 2024
2 parents 648101b + 0ff2987 commit f1298d8
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 34 deletions.
3 changes: 0 additions & 3 deletions drivers/CoreBufferedSerial/include/CoreBufferedSerial.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ class CoreBufferedSerial : public interface::BufferedSerial

auto readable() -> bool final;

void enable_input() final;
void disable_input() final;

void enableDeepSleep() final;
void disableDeepSleep() final;

Expand Down
14 changes: 2 additions & 12 deletions drivers/CoreBufferedSerial/source/CoreBufferedSerial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ auto CoreBufferedSerial::readable() -> bool
return _serial.readable();
}

void CoreBufferedSerial::enable_input()
void CoreBufferedSerial::disableDeepSleep()
{
_serial.enable_input(true);
}

void CoreBufferedSerial::disable_input()
void CoreBufferedSerial::enableDeepSleep()
{
_serial.enable_input(false);
}
Expand All @@ -36,13 +36,3 @@ void CoreBufferedSerial::sigio(std::function<void()> const &callback)
_sigio_callback = callback;
_serial.sigio(mbed::Callback<void()> {[this] { _sigio_callback(); }});
}

void CoreBufferedSerial::enableDeepSleep()
{
disable_input();
}

void CoreBufferedSerial::disableDeepSleep()
{
enable_input();
}
14 changes: 0 additions & 14 deletions drivers/CoreBufferedSerial/tests/CoreBufferedSerial_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,20 +59,6 @@ TEST_F(CoreBufferedSerialTest, readable)
// nothing expected
}

TEST_F(CoreBufferedSerialTest, enableInput)
{
coreserial.enable_input();

ASSERT_TRUE(spy_BufferedSerial_getEnableInput());
}

TEST_F(CoreBufferedSerialTest, disableInput)
{
coreserial.disable_input();

ASSERT_FALSE(spy_BufferedSerial_getEnableInput());
}

TEST_F(CoreBufferedSerialTest, sigio)
{
auto mock_function = MockFunction<void()> {};
Expand Down
3 changes: 0 additions & 3 deletions include/interface/drivers/BufferedSerial.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ class BufferedSerial : public interface::DeepSleepEnabled

virtual auto readable() -> bool = 0;

virtual void disable_input() = 0;
virtual void enable_input() = 0;

virtual void sigio(std::function<void()> const &callback) = 0;
};

Expand Down
2 changes: 0 additions & 2 deletions tests/unit/mocks/mocks/leka/CoreBufferedSerial.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ class CoreBufferedSerial : public interface::BufferedSerial
MOCK_METHOD(std::size_t, read, (uint8_t *, std::size_t), (override));
MOCK_METHOD(std::size_t, write, (const uint8_t *, std::size_t), (override));
MOCK_METHOD(bool, readable, (), (override));
MOCK_METHOD(void, disable_input, (), (override));
MOCK_METHOD(void, enable_input, (), (override));
MOCK_METHOD(void, sigio, (std::function<void()> const &), (override));

MOCK_METHOD(void, enableDeepSleep, (), (override));
Expand Down

0 comments on commit f1298d8

Please sign in to comment.