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

@@ -14,14 +14,6 @@
*/
#ifdef DOXYGEN
/**
* @def STA_STM32_CAN_ENABLE
* @brief Enable module.
*
* @ingroup stm32BuildConfig
*/
# define STA_STM32_CAN_ENABLE
/**
* @def STA_STM32_CAN_GLOBAL
* @brief Create global CanBus object using this CAN instance.
@@ -32,12 +24,20 @@
#endif // DOXYGEN
// Only enable module on STM32 platform w/ HAL CAN module enabled
#include <sta/config.hpp>
#ifdef STA_STM32_CAN_ENABLE
#ifdef STA_PLATFORM_STM32
# include <sta/stm32/hal.hpp>
# ifdef HAL_CAN_MODULE_ENABLED
# define STA_STM32_CAN_ENABLED
# endif // HAL_CAN_MODULE_ENABLED
#endif // STA_PLATFORM_STM32
#include <sta/can_bus/controller.hpp>
#include <sta/stm32/hal.hpp>
#ifdef STA_STM32_CAN_ENABLED
#include <sta/can/controller.hpp>
namespace sta
@@ -124,6 +124,6 @@ namespace sta
} // namespace sta
#endif // STA_STM32_CAN_ENABLE
#endif // STA_STM32_CAN_ENABLED
#endif // STA_CORE_STM32_CAN_HPP