Skip to content

Commit 473786b

Browse files
committed
Issue #24 : Doxygen cannot genearete document.
Added : - "|| DOXYGEN_COMPILE" to second out most #if to allow doxygen picks the definition. - "|| DOXYGEN_COMPILE" to mock class definition. - DOXYGEN_DOCUMENT macro to the Doxyfile.
1 parent 7a810e2 commit 473786b

6 files changed

Lines changed: 23 additions & 11 deletions

File tree

Doxyfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2423,7 +2423,7 @@ INCLUDE_FILE_PATTERNS =
24232423
# recursively expanded use the := operator instead of the = operator.
24242424
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
24252425

2426-
PREDEFINED =
2426+
PREDEFINED = DOXYGEN_COMPILE
24272427

24282428
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
24292429
# tag can be used to specify a list of macro names that should be expanded. The

src/codec/adau1361.hpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
#ifndef PICO_DRIVER_SRC_CODEC_ADAU1361_HPP_
1111
#define PICO_DRIVER_SRC_CODEC_ADAU1361_HPP_
12-
#if __has_include(<hardware/i2c.h>) || __has_include(<gmock/gmock.h>)
12+
#if __has_include(<hardware/i2c.h>) || __has_include(<gmock/gmock.h>) || DOXYGEN_COMPILE
1313

1414
#include <i2c/i2cmaster.hpp>
1515

@@ -199,8 +199,11 @@ class Adau1361 {
199199
bool hp_output_mute_; // headphone
200200
};
201201

202-
#if __has_include(<gmock/gmock.h>)
202+
#if __has_include(<gmock/gmock.h>) || DOXYGEN_COMPILE
203203
// GCOVR_EXCL_START
204+
/**
205+
* @brief Mock class for test.
206+
*/
204207
class MockAdau1361 : public Adau1361 {
205208
public:
206209
MockAdau1361(Adau1361Lower& adau1361_lower)

src/codec/adau1361lower.hpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
#ifndef PICO_DRIVER_SRC_CODEC_ADAU1361LOWER_HPP_
1111
#define PICO_DRIVER_SRC_CODEC_ADAU1361LOWER_HPP_
12-
#if __has_include(<hardware/i2c.h>) || __has_include(<gmock/gmock.h>)
12+
#if __has_include(<hardware/i2c.h>) || __has_include(<gmock/gmock.h>) || DOXYGEN_COMPILE
1313

1414
#include "i2c/i2cmaster.hpp"
1515

@@ -231,8 +231,11 @@ class Adau1361Lower {
231231
};
232232

233233
// #ifdef MOCK_METHOD0
234-
#if __has_include(<gmock/gmock.h>)
234+
#if __has_include(<gmock/gmock.h>) || DOXYGEN_COMPILE
235235
// GCOVR_EXCL_START
236+
/**
237+
* @brief Mock class for test.
238+
*/
236239
class MockAdau1361Lower : public Adau1361Lower {
237240
public:
238241
explicit MockAdau1361Lower(::rpp_driver::I2cMaster& controller)

src/codec/umbadau1361lower.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
#ifndef PICO_DRIVER_SRC_CODEC_UMBADAU1361LOWER_HPP_
1111
#define PICO_DRIVER_SRC_CODEC_UMBADAU1361LOWER_HPP_
12-
#if __has_include(<hardware/i2c.h>) || __has_include(<gmock/gmock.h>)
12+
#if __has_include(<hardware/i2c.h>) || __has_include(<gmock/gmock.h>) || DOXYGEN_COMPILE
1313

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

src/i2c/i2cmaster.hpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
#ifndef PICO_DRIVER_SRC_I2C_I2CMASATER_HPP_
1212
#define PICO_DRIVER_SRC_I2C_I2CMASATER_HPP_
13-
#if __has_include(<hardware/i2c.h>) || __has_include(<gmock/gmock.h>)
13+
#if __has_include(<hardware/i2c.h>) || __has_include(<gmock/gmock.h>) || DOXYGEN_COMPILE
1414

1515
#include <stdint.h>
1616

@@ -142,8 +142,11 @@ class I2cMaster {
142142
SdkWrapper &sdk_;
143143
}; // I2cMaster
144144

145-
#if __has_include(<gmock/gmock.h>)
145+
#if __has_include(<gmock/gmock.h>)|| DOXYGEN_COMPILE
146146
// GCOVR_EXCL_START
147+
/**
148+
* @brief Mock class for test.
149+
*/
147150
class MockI2cMaster : public I2cMaster {
148151
private:
149152
i2c_inst_t dummy_i2c = 3;

src/i2s/i2sslaveduplex.hpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66
#ifndef PICO_DRIVER_SRC_I2S_DUPLEXSLAVEI2S_HPP_
77
#define PICO_DRIVER_SRC_I2S_DUPLEXSLAVEI2S_HPP_
8-
#if __has_include(<hardware/pio.h>) || __has_include(<gmock/gmock.h>)
8+
#if __has_include(<hardware/pio.h>) || __has_include(<gmock/gmock.h>) || DOXYGEN_COMPILE
99

1010
#if __has_include(<hardware/pio.h>)
1111
#include "hardware/pio.h"
@@ -179,8 +179,11 @@ class I2sSlaveDuplex {
179179
virtual void PutFifoBlocking(int32_t value);
180180
};
181181

182-
#if __has_include(<gmock/gmock.h>)
182+
#if __has_include(<gmock/gmock.h>) || DOXYGEN_COMPILE
183183
// GCOVR_EXCL_START
184+
/**
185+
* @brief Mock class for test.
186+
*/
184187
class MockI2sSlaveDuplex : public I2sSlaveDuplex {
185188
public:
186189
MockI2sSlaveDuplex(SdkWrapper &sdk)
@@ -195,6 +198,6 @@ class MockI2sSlaveDuplex : public I2sSlaveDuplex {
195198
#endif // __has_include(<gmock/gmock.h>)
196199
} // namespace rpp_driver
197200

198-
#endif // __has_include(<hardware/pio.h>) || __has_include(<gmock/gmock.h>)
201+
#endif // __has_include(<hardware/pio.h>) || __has_include(<gmock/gmock.h>)
199202

200203
#endif // PICO_DRIVER_SRC_I2S_DUPLEXSLAVEI2S_HPP_

0 commit comments

Comments
 (0)