Browse Source

remove some compile error

master
zhaohe 2 years ago
parent
commit
0b58d1f10d
  1. 2
      components/hardware/adc/z_simple_adc.cpp
  2. 2
      components/hardware/adc/z_simple_adc.hpp
  3. 6
      components/sensors/mcp41xxx/mcp41xxx.cpp
  4. 4
      components/sensors/mcp41xxx/mcp41xxx.hpp
  5. 2
      components/zprotocols/zcancmder_v2

2
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

2
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

6
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

4
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
} // namespace iflytop
#endif

2
components/zprotocols/zcancmder_v2

@ -1 +1 @@
Subproject commit 572610d6ae6419767aeef9acbe961ce461a1beeb
Subproject commit c8f8ad1cd51a5f05ead5cfac7cc6dcd8d61ad4f9
Loading…
Cancel
Save