Skip to content

Commit

Permalink
Merge branch 'feature/20' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
suikan4github committed Oct 17, 2024
2 parents 8b07afc + 4fbdcc5 commit 9f360af
Show file tree
Hide file tree
Showing 24 changed files with 32 additions and 34 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ The issue #16 changes its public member function. But it is referred internally
### Removed
### Fixed
- [Issue #11](https://github.com/suikan4github/rpp_driver/issues/11) Fails to compile in MSVC.
- [Issue #14](https://github.com/suikan4github/rpp_driver/issues/14) Clean up Internal include directive.
- [Issue #17](https://github.com/suikan4github/rpp_driver/issues/17) The mock of the GpioBasic has the wrong definition.
- [Issue #18](https://github.com/suikan4github/rpp_driver/issues/18) The constructor of the MockI2sSlaveDuplex.hpp is missing.
- [Issue #19](https://github.com/suikan4github/rpp_driver/issues/19) The Mock of the rpp_driver::Adau1361 is missing.
Expand Down
2 changes: 2 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ cmake_minimum_required(VERSION 3.13)
# These declaration works for both UNIX/Win and bare metal.

add_library(rpp_driver INTERFACE)
target_include_directories(rpp_driver INTERFACE .)


# Win/Unix specific option.
if((${WIN32}) OR (${UNIX}))
Expand Down
1 change: 0 additions & 1 deletion src/codec/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@ target_sources(rpp_driver INTERFACE
adau1361.cpp
adau1361lower.cpp
umbadau1361lower.cpp)
target_include_directories(rpp_driver INTERFACE .)
2 changes: 1 addition & 1 deletion src/codec/adau1361.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

#include <assert.h>

#include "i2cmasterinterface.hpp"
#include "i2c/i2cmasterinterface.hpp"

// Macro for easy-to-read
#define CODEC_SYSLOG(fmt, ...) \
Expand Down
2 changes: 1 addition & 1 deletion src/codec/adau1361.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#ifndef PICO_DRIVER_SRC_CODEC_ADAU1361_HPP_
#define PICO_DRIVER_SRC_CODEC_ADAU1361_HPP_

#include <i2cmasterinterface.hpp>
#include <i2c/i2cmasterinterface.hpp>

#include "adau1361lower.hpp"
namespace rpp_driver {
Expand Down
2 changes: 1 addition & 1 deletion src/codec/adau1361lower.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#ifndef PICO_DRIVER_SRC_CODEC_ADAU1361LOWER_HPP_
#define PICO_DRIVER_SRC_CODEC_ADAU1361LOWER_HPP_

#include "i2cmaster.hpp"
#include "i2c/i2cmaster.hpp"

#if __has_include(<gmock/gmock.h>)
#include <gmock/gmock.h>
Expand Down
4 changes: 2 additions & 2 deletions src/codec/umbadau1361lower.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
#ifndef PICO_DRIVER_SRC_CODEC_UMBADAU1361LOWER_HPP_
#define PICO_DRIVER_SRC_CODEC_UMBADAU1361LOWER_HPP_

#include "adau1361lower.hpp"
#include "i2cmaster.hpp"
#include "codec/adau1361lower.hpp"
#include "i2c/i2cmaster.hpp"

namespace rpp_driver {

Expand Down
1 change: 0 additions & 1 deletion src/gpio/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ cmake_minimum_required(VERSION 3.13)
# These declaration works for both UNIX/Win and bare metal.
target_sources(rpp_driver INTERFACE
gpiobasic.cpp)
target_include_directories(rpp_driver INTERFACE .)
2 changes: 1 addition & 1 deletion src/gpio/gpiobasic.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
// Alternate definition for unit test.
#endif // __has_include(<hardware/i2c.h>)

#include "sdkwrapper.hpp"
#include "sdk/sdkwrapper.hpp"

namespace rpp_driver {
/**
Expand Down
1 change: 0 additions & 1 deletion src/i2c/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ cmake_minimum_required(VERSION 3.13)
# These declaration works for both UNIX/Win and bare metal.
target_sources(rpp_driver INTERFACE
i2cmaster.cpp)
target_include_directories(rpp_driver INTERFACE .)
4 changes: 2 additions & 2 deletions src/i2c/i2cmaster.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ typedef int i2c_inst_t;
#define GPIO_FUNC_I2C 11
#endif // __has_include(<hardware/i2c.h>)

#include "i2cmasterinterface.hpp"
#include "sdkwrapper.hpp"
#include "i2c/i2cmasterinterface.hpp"
#include "sdk/sdkwrapper.hpp"

namespace rpp_driver {
/**
Expand Down
1 change: 0 additions & 1 deletion src/i2s/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ cmake_minimum_required(VERSION 3.13)
# Common declaration for both UNIX/Win and bare metal.
target_sources(rpp_driver INTERFACE
i2sslaveduplex.cpp)
target_include_directories(rpp_driver INTERFACE .)

# Bare metal specific declaration.
if(NOT (${WIN32}) AND NOT(${UNIX})) # Is Target bare metal?
Expand Down
4 changes: 2 additions & 2 deletions src/i2s/i2sslaveduplex.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "i2sslaveduplex.hpp"
#include "i2s/i2sslaveduplex.hpp"

#include "sdkwrapper.hpp"
#include "sdk/sdkwrapper.hpp"

#if __has_include(<hardware/pio.h>) // Is build in Pico Environment?
extern "C" {
Expand Down
2 changes: 1 addition & 1 deletion src/i2s/i2sslaveduplex.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <gmock/gmock.h>
#endif

#include "sdkwrapper.hpp"
#include "sdk/sdkwrapper.hpp"

namespace rpp_driver {
/**
Expand Down
1 change: 0 additions & 1 deletion src/sdk/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
cmake_minimum_required(VERSION 3.13)

# Common declaration for both UNIX/Win and bare metal.
target_include_directories(rpp_driver INTERFACE .)
target_sources(rpp_driver INTERFACE
pico_sdk_apistub.cpp
)
Expand Down
6 changes: 3 additions & 3 deletions test/test_adau1361.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#include <gmock/gmock.h>
#include <gtest/gtest.h>

#include "adau1361.hpp"
#include "i2cmasterinterface.hpp"
#include "umbadau1361lower.hpp"
#include "codec/adau1361.hpp"
#include "codec/umbadau1361lower.hpp"
#include "i2c/i2cmasterinterface.hpp"

class Adau1361Test : public ::testing::Test {
protected:
Expand Down
4 changes: 2 additions & 2 deletions test/test_adau1361lower.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include <gmock/gmock.h>
#include <gtest/gtest.h>

#include "adau1361lower.hpp"
#include "i2cmasterinterface.hpp"
#include "codec/adau1361lower.hpp"
#include "i2c/i2cmasterinterface.hpp"

// Class under test. Provide a dummy member function for test.
class CutAdau1361Lower : public ::rpp_driver::Adau1361Lower {
Expand Down
4 changes: 2 additions & 2 deletions test/test_gpiobasic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

#include <random>

#include "gpiobasic.hpp"
#include "sdkwrapper.hpp"
#include "gpio/gpiobasic.hpp"
#include "sdk/sdkwrapper.hpp"

class GpioBasicTest : public ::testing::Test {
protected:
Expand Down
2 changes: 1 addition & 1 deletion test/test_i2cmaster.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <gmock/gmock.h>
#include <gtest/gtest.h>

#include "i2cmaster.hpp"
#include "i2c/i2cmaster.hpp"

using testing::Return;

Expand Down
4 changes: 2 additions & 2 deletions test/test_i2sslaveduplex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

#include <random>

#include "i2sslaveduplex.hpp"
#include "sdkwrapper.hpp"
#include "i2s/i2sslaveduplex.hpp"
#include "sdk/sdkwrapper.hpp"

class I2sSlaveDuplexTest : public ::testing::Test {
protected:
Expand Down
4 changes: 2 additions & 2 deletions test/test_mockadau1361.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
#include <gmock/gmock.h>
#include <gtest/gtest.h>

#include "adau1361.hpp"
#include "sdkwrapper.hpp"
#include "codec/adau1361.hpp"
#include "sdk/sdkwrapper.hpp"

using ::testing::_;
class MockAdau1361Test : public ::testing::Test {
Expand Down
4 changes: 2 additions & 2 deletions test/test_mockgpiobasic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
#include <gmock/gmock.h>
#include <gtest/gtest.h>

#include "gpiobasic.hpp"
#include "sdkwrapper.hpp"
#include "gpio/gpiobasic.hpp"
#include "sdk/sdkwrapper.hpp"

using ::testing::_;
class MockGpioBasicTest : public ::testing::Test {
Expand Down
4 changes: 2 additions & 2 deletions test/test_mocki2sslaveduplex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
#include <gmock/gmock.h>
#include <gtest/gtest.h>

#include "i2sslaveduplex.hpp"
#include "sdkwrapper.hpp"
#include "i2s/i2sslaveduplex.hpp"
#include "sdk/sdkwrapper.hpp"

using ::testing::_;
class MockI2sSlaveDuplexTest : public ::testing::Test {
Expand Down
4 changes: 2 additions & 2 deletions test/test_umbadau1361lower.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include <gmock/gmock.h>
#include <gtest/gtest.h>

#include "i2cmasterinterface.hpp"
#include "umbadau1361lower.hpp"
#include "codec/umbadau1361lower.hpp"
#include "i2c/i2cmasterinterface.hpp"

class UmbAdau1361LowerTest : public ::testing::Test {
protected:
Expand Down

0 comments on commit 9f360af

Please sign in to comment.