Change module enable logic

This commit is contained in:
Henrik Stickann
2023-01-20 01:52:18 +01:00
parent 7f2f4a4df9
commit dd2983821e
12 changed files with 70 additions and 71 deletions

View File

@@ -22,12 +22,20 @@
#endif // DOXYGEN
// Only enable module on STM32 platform w/ HAL GPIO module enabled
#include <sta/config.hpp>
#ifdef STA_STM32_GPIO_ENABLE
#ifdef STA_PLATFORM_STM32
# include <sta/stm32/hal.hpp>
# ifdef HAL_GPIO_MODULE_ENABLED
# define STA_STM32_GPIO_ENABLED
# endif // HAL_GPIO_MODULE_ENABLED
#endif // STA_PLATFORM_STM32
#ifdef STA_STM32_GPIO_ENABLED
#include <sta/gpio_pin.hpp>
#include <sta/stm32/hal.hpp>
namespace sta
@@ -103,6 +111,6 @@ namespace sta
#define STA_STM32_GPIO_PIN(label) sta::STM32GpioPin{label##_GPIO_Port, label##_Pin}
#endif // STA_STM32_GPIO_ENABLE
#endif // STA_STM32_GPIO_ENABLED
#endif // STA_CORE_STM32_GPIO_PIN_HPP