diff --git a/components/hardware/adc/z_simple_adc.cpp b/components/hardware/adc/z_simple_adc.cpp index 16024b9..3006f93 100644 --- a/components/hardware/adc/z_simple_adc.cpp +++ b/components/hardware/adc/z_simple_adc.cpp @@ -1,4 +1,5 @@ #include "z_simple_adc.hpp" +#ifdef HAL_ADC_MODULE_ENABLED using namespace iflytop; void ZADC::initialize(ADC_HandleTypeDef* hadc1, int32_t channel, int32_t samplingTime) { @@ -35,3 +36,4 @@ int32_t ZADC::get_adc_value(int32_t& adcval) { adcval = (uint16_t)HAL_ADC_GetValue(m_hadc1); return 0; } +#endif diff --git a/components/hardware/adc/z_simple_adc.hpp b/components/hardware/adc/z_simple_adc.hpp index 9102e20..b31de30 100644 --- a/components/hardware/adc/z_simple_adc.hpp +++ b/components/hardware/adc/z_simple_adc.hpp @@ -4,6 +4,7 @@ #include "sdk\chip\api\zi_adc.hpp" #include "sdk\components\zprotocols\zcancmder_v2\api\errorcode.hpp" #include "sdk\os\zos.hpp" +#ifdef HAL_ADC_MODULE_ENABLED namespace iflytop { using namespace std; class ZADC : public ZIADC { @@ -62,3 +63,4 @@ class ZADC : public ZIADC { virtual int32_t get_adc_value(int32_t& adcval) override; }; } // namespace iflytop +#endif diff --git a/components/sensors/mcp41xxx/mcp41xxx.cpp b/components/sensors/mcp41xxx/mcp41xxx.cpp index 9c3a1ae..378efa7 100644 --- a/components/sensors/mcp41xxx/mcp41xxx.cpp +++ b/components/sensors/mcp41xxx/mcp41xxx.cpp @@ -1,4 +1,6 @@ #include "mcp41xxx.hpp" +#ifdef HAL_SPI_MODULE_ENABLED + using namespace iflytop; using namespace std; @@ -11,6 +13,8 @@ using namespace std; #define MCP41XXX_POTENT_1 0x02 #define MCP41XXX_POTENT_0_AND_1 0x03 + + void MCP41XXX::initialize(hardware_config_t* hardwareconfig) { // m_hardwareconfig = *hardwareconfig; ZASSERT(m_hardwareconfig.spihandler); @@ -96,3 +100,5 @@ void MCP41XXX::potentiometerShutdonw(Potentiometer num, bool shutdown) { MCP41xxx_off[1] = 0; spi_send(MCP41xxx_off, 2); } + +#endif diff --git a/components/sensors/mcp41xxx/mcp41xxx.hpp b/components/sensors/mcp41xxx/mcp41xxx.hpp index 6674222..3434586 100644 --- a/components/sensors/mcp41xxx/mcp41xxx.hpp +++ b/components/sensors/mcp41xxx/mcp41xxx.hpp @@ -1,6 +1,7 @@ #pragma once #include "sdk\components\zprotocols\errorcode\errorcode.hpp" #include "sdk\os\zos.hpp" +#ifdef HAL_SPI_MODULE_ENABLED namespace iflytop { using namespace std; @@ -37,4 +38,5 @@ class MCP41XXX { void spi_send(uint8_t* data, int32_t len); }; -} // namespace iflytop \ No newline at end of file +} // namespace iflytop +#endif diff --git a/components/zprotocols/zcancmder_v2 b/components/zprotocols/zcancmder_v2 index 572610d..c8f8ad1 160000 --- a/components/zprotocols/zcancmder_v2 +++ b/components/zprotocols/zcancmder_v2 @@ -1 +1 @@ -Subproject commit 572610d6ae6419767aeef9acbe961ce461a1beeb +Subproject commit c8f8ad1cd51a5f05ead5cfac7cc6dcd8d61ad4f9