-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🤡 (mbed): Mock mbed::interface::DigitalOut
To work we need to also stub mbed::gpio_read and mbed::gpio_is_connected
- Loading branch information
Showing
4 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,3 +62,4 @@ | |
#define __CORTEX_M7 1 | ||
#define __FPU_PRESENT 1 | ||
#define __MBED_CMSIS_RTOS_CM 1 | ||
#define FEATURE_EXPERIMENTAL_API 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Leka - LekaOS | ||
// Copyright 2021 APF France handicap | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
#ifndef _LEKA_OS_MBED_MOCK_DIGITAL_OUT_H_ | ||
#define _LEKA_OS_MBED_MOCK_DIGITAL_OUT_H_ | ||
|
||
#include "PinNames.h" | ||
|
||
#include "drivers/interfaces/InterfaceDigitalOut.h" | ||
|
||
#include "gmock/gmock.h" | ||
|
||
namespace mbed::mock { | ||
|
||
class DigitalOut : public mbed::interface::DigitalOut | ||
{ | ||
public: | ||
DigitalOut(PinName pin) {}; | ||
MOCK_METHOD(void, write, (int value), (override)); | ||
MOCK_METHOD(int, read, (), (override)); | ||
MOCK_METHOD(int, is_connected, (), (override)); | ||
}; | ||
|
||
} // namespace mbed::mock | ||
|
||
#endif // _LEKA_OS_MBED_MOCK_DIGITAL_OUT_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters