diff --git a/components/iflytop_can_slave_modules/io_control_service.cpp b/components/iflytop_can_slave_modules/io_control_service.cpp index e5dbc78..a0a0a7e 100644 --- a/components/iflytop_can_slave_modules/io_control_service.cpp +++ b/components/iflytop_can_slave_modules/io_control_service.cpp @@ -1,4 +1,5 @@ #include "io_control_service.hpp" +#ifdef HAL_CAN_MODULE_ENABLED using namespace iflytop; void IOControlService::initialize(IflytopCanProtocolStackProcesser* protocol_processer, int32_t regStartOff, write_io_cb_t write_io_cb, read_io_cb_t read_io_cb) { @@ -101,4 +102,5 @@ uint32_t IOControlService::readgpiotable0() { return val; } -// uint32_t IOControlService::readgpiotable1() {} \ No newline at end of file +// uint32_t IOControlService::readgpiotable1() {} +#endif \ No newline at end of file diff --git a/components/iflytop_can_slave_v1/iflytop_can_slave.hpp b/components/iflytop_can_slave_v1/iflytop_can_slave.hpp index 65a851a..9afca77 100644 --- a/components/iflytop_can_slave_v1/iflytop_can_slave.hpp +++ b/components/iflytop_can_slave_v1/iflytop_can_slave.hpp @@ -4,6 +4,8 @@ #pragma once #include "iflytop_can_slave_protocol.hpp" +#ifdef HAL_CAN_MODULE_ENABLED + /** * @brief * @@ -239,4 +241,5 @@ class ICPSUtils { static int32_t mutiValToRegVal(int8_t var1, int8_t var2, int8_t var3, int8_t var4) { return (var4 << 24) | (var3 << 16) | (var2 << 8) | (var1 & 0xFF); } }; -} // namespace iflytop \ No newline at end of file +} // namespace iflytop +#endif \ No newline at end of file diff --git a/components/tmc/ic/ztmc4361A.cpp b/components/tmc/ic/ztmc4361A.cpp index b7d7d51..f2cbc53 100644 --- a/components/tmc/ic/ztmc4361A.cpp +++ b/components/tmc/ic/ztmc4361A.cpp @@ -1,6 +1,8 @@ #if 1 #include "ztmc4361A.hpp" +#ifdef HAL_SPI_MODULE_ENABLED + #include #include "../basic/basic.hpp" @@ -361,3 +363,5 @@ void TMC4361A::driverIC_setIHOLD_IRUN(uint8_t ihold, uint8_t irun, uint16_t ihol #endif #endif + +#endif \ No newline at end of file diff --git a/components/tmc/ic/ztmc4361A.hpp b/components/tmc/ic/ztmc4361A.hpp index 4c07eca..2d5424e 100644 --- a/components/tmc/ic/ztmc4361A.hpp +++ b/components/tmc/ic/ztmc4361A.hpp @@ -13,6 +13,8 @@ extern "C" { #include "TMC2160\TMC2160.h" #include "TMC4361A\TMC4361A.h" } +#ifdef HAL_SPI_MODULE_ENABLED + namespace iflytop { #define TMC4361A_LISTENER_MAX 5 class TMC4361A : public IStepperMotor { @@ -153,3 +155,4 @@ class TMC4361A : public IStepperMotor { } // namespace iflytop #endif +#endif \ No newline at end of file diff --git a/components/tmc/ic/ztmc5130.cpp b/components/tmc/ic/ztmc5130.cpp index 411247c..e149e56 100644 --- a/components/tmc/ic/ztmc5130.cpp +++ b/components/tmc/ic/ztmc5130.cpp @@ -1,4 +1,6 @@ #include "ztmc5130.hpp" +#ifdef HAL_SPI_MODULE_ENABLED + using namespace iflytop; /** @@ -192,3 +194,4 @@ int32_t TMC5130::readInt(uint8_t address) { return ((uint32_t)data[1] << 24) | ((uint32_t)data[2] << 16) | (data[3] << 8) | data[4]; } +#endif \ No newline at end of file diff --git a/components/tmc/ic/ztmc5130.hpp b/components/tmc/ic/ztmc5130.hpp index 39fb5d0..41a1d50 100644 --- a/components/tmc/ic/ztmc5130.hpp +++ b/components/tmc/ic/ztmc5130.hpp @@ -9,6 +9,7 @@ extern "C" { #include "TMC5130\TMC5130.h" } +#ifdef HAL_SPI_MODULE_ENABLED namespace iflytop { #define TMC5130_LISTENER_MAX 5 /** @@ -138,4 +139,5 @@ class TMC5130 : public IStepperMotor { private: uint32_t haspassedms(uint32_t now, uint32_t last); }; -} // namespace iflytop \ No newline at end of file +} // namespace iflytop +#endif \ No newline at end of file diff --git a/hal/zcan.cpp b/hal/zcan.cpp index 9785967..be121c5 100644 --- a/hal/zcan.cpp +++ b/hal/zcan.cpp @@ -1,8 +1,8 @@ #include "zcan.hpp" +#ifdef HAL_CAN_MODULE_ENABLED extern "C" { -#ifdef HAL_CAN_MODULE_ENABLED void HAL_CAN_TxMailbox0CompleteCallback(CAN_HandleTypeDef *hcan) { for (int i = 0; i < iflytop::ZCanIRQDispatcher::instance().m_listenerNum; i++) { iflytop::ZCanIRQDispatcher::instance().m_listener[i]->STM32_HAL_onCAN_TxMailbox0Complete(hcan);