[STM32WLx] Only build on compatible STM32 boards

This checks for some system macros to be set, but also includes the
doxygen build to generate documentation.

This reuses the RADIOLIB_EXCLUDE_STM32WLX that the code already checks
for to prevent having to duplicate this macro check in four places.

To detect running inside doxygen, this configures doxygen to predefine
a DOXYGEN macro (it seems no such macros are defined by default by
doxygen).
pull/649/head
Matthijs Kooijman 2022-12-20 16:21:48 +01:00
rodzic 3e2810cfbb
commit e52ffb0a69
2 zmienionych plików z 9 dodań i 1 usunięć

Wyświetl plik

@ -2172,7 +2172,8 @@ INCLUDE_FILE_PATTERNS =
# recursively expanded use the := operator instead of the = operator.
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
PREDEFINED = protected=private
PREDEFINED = protected=private \
DOXYGEN
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
# tag can be used to specify a list of macro names that should be expanded. The

Wyświetl plik

@ -1010,6 +1010,13 @@
#define RADIOLIB_STATIC_ARRAY_SIZE (256)
#endif
// This only compiles on STM32 boards with SUBGHZ module, but also
// include when generating docs
#if (!defined(ARDUINO_ARCH_STM32) || !defined(SUBGHZSPI_BASE)) && !defined(DOXYGEN)
#define RADIOLIB_EXCLUDE_STM32WLX
#endif
#if defined(RADIOLIB_DEBUG)
#if defined(RADIOLIB_BUILD_ARDUINO)
#define RADIOLIB_DEBUG_PRINT(...) { RADIOLIB_DEBUG_PORT.print(__VA_ARGS__); }