mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/sta-core.git
synced 2025-12-16 16:48:04 +00:00
Change module enable logic
This commit is contained in:
@@ -11,26 +11,21 @@
|
||||
* @brief STM32 SPI module.
|
||||
*/
|
||||
|
||||
#ifdef DOXYGEN
|
||||
/**
|
||||
* @def STA_STM32_SPI_ENABLE
|
||||
* @brief Enable module.
|
||||
*
|
||||
* Requires **STM_GPIO** module.
|
||||
*
|
||||
* @ingroup stm32BuildConfig
|
||||
*/
|
||||
# define STA_STM32_SPI_ENABLE
|
||||
#endif // DOXYGEN
|
||||
|
||||
|
||||
// Only enable module on STM32 platform w/ HAL SPI module enabled
|
||||
#include <sta/config.hpp>
|
||||
#ifdef STA_STM32_SPI_ENABLE
|
||||
#ifdef STA_PLATFORM_STM32
|
||||
# include <sta/stm32/hal.hpp>
|
||||
# ifndef HAL_GPIO_MODULE_ENABLED
|
||||
# error "STM32 GPIO module required!"
|
||||
# endif // !HAL_GPIO_MODULE_ENABLED
|
||||
# ifdef HAL_SPI_MODULE_ENABLED
|
||||
# define STA_STM32_SPI_ENABLED
|
||||
# endif // HAL_SPI_MODULE_ENABLED
|
||||
#endif // STA_PLATFORM_STM32
|
||||
|
||||
#ifndef STA_STM32_GPIO_ENABLE
|
||||
#error "STM32 GPIO module required"
|
||||
#endif // !STA_STM32_GPIO_ENABLE
|
||||
|
||||
#ifdef STA_STM32_SPI_ENABLED
|
||||
|
||||
#include <sta/spi/device.hpp>
|
||||
#include <sta/spi/interface.hpp>
|
||||
@@ -128,6 +123,6 @@ namespace sta
|
||||
#define STA_STM32_SPI_INFO(handle) sta::STM32SpiInterfaceInfo{&handle, STA_STM32_GET_HANDLE_PCLK_FREQ_FN(handle)}
|
||||
|
||||
|
||||
#endif // STA_STM32_SPI_ENABLE
|
||||
#endif // STA_STM32_SPI_ENABLED
|
||||
|
||||
#endif // STA_CORE_STM32_SPI_HPP
|
||||
|
||||
Reference in New Issue
Block a user