|
@ -2,7 +2,6 @@ |
|
|
|
|
|
|
|
|
#include "adc.h"
|
|
|
#include "adc.h"
|
|
|
#include "tim.h"
|
|
|
#include "tim.h"
|
|
|
|
|
|
|
|
|
#include "zsdk/zcanreceiver/zcanreceiver.hpp"
|
|
|
#include "zsdk/zcanreceiver/zcanreceiver.hpp"
|
|
|
#define TAG "HARD"
|
|
|
#define TAG "HARD"
|
|
|
using namespace iflytop; |
|
|
using namespace iflytop; |
|
@ -114,6 +113,9 @@ bool Hardware::h2o2_sensor_is_online() { |
|
|
return true; |
|
|
return true; |
|
|
} |
|
|
} |
|
|
int32_t Hardware::h2o2_sensor_read_calibration_date(int32_t* year, int32_t* month, int32_t* day) { //
|
|
|
int32_t Hardware::h2o2_sensor_read_calibration_date(int32_t* year, int32_t* month, int32_t* day) { //
|
|
|
|
|
|
*year = 1; |
|
|
|
|
|
*month = 2; |
|
|
|
|
|
*day = 3; |
|
|
return 0; |
|
|
return 0; |
|
|
} |
|
|
} |
|
|
int32_t Hardware::h2o2_sensor_read_sub_ic_errorcode() { //
|
|
|
int32_t Hardware::h2o2_sensor_read_sub_ic_errorcode() { //
|
|
@ -172,7 +174,6 @@ int32_t Hardware::h2o2_sensor_data(report_h2o2_data_t* readdata) { |
|
|
HPP272::hpp272_data_t sensordata; |
|
|
HPP272::hpp272_data_t sensordata; |
|
|
m_H2o2Sensor_HPP272.read_cache_sensor_data(&sensordata); |
|
|
m_H2o2Sensor_HPP272.read_cache_sensor_data(&sensordata); |
|
|
|
|
|
|
|
|
readdata->subid = 0; |
|
|
|
|
|
readdata->sensor_error = ecode != 0; |
|
|
readdata->sensor_error = ecode != 0; |
|
|
readdata->h2o2 = sensordata.hydrogen_peroxide_volume / 10.0; |
|
|
readdata->h2o2 = sensordata.hydrogen_peroxide_volume / 10.0; |
|
|
readdata->humid = sensordata.relative_humidity / 10.0; |
|
|
readdata->humid = sensordata.relative_humidity / 10.0; |
|
@ -191,11 +192,18 @@ int32_t Hardware::h2o2_sensor_data(report_h2o2_data_t* readdata) { |
|
|
|
|
|
|
|
|
void Hardware::onAdcCaptureThread() { |
|
|
void Hardware::onAdcCaptureThread() { |
|
|
while (1) { |
|
|
while (1) { |
|
|
osDelay(30); |
|
|
|
|
|
|
|
|
// osDelay(30);
|
|
|
m_Heater_electricCurrentAdc.updateAdcValToCache(); |
|
|
m_Heater_electricCurrentAdc.updateAdcValToCache(); |
|
|
m_Heater_temperatureAdc.updateAdcValToCache(); |
|
|
m_Heater_temperatureAdc.updateAdcValToCache(); |
|
|
m_Blowser_electricCurrentAdc.updateAdcValToCache(); |
|
|
|
|
|
m_AirCompressor_electricCurrentAdc.updateAdcValToCache(); |
|
|
m_AirCompressor_electricCurrentAdc.updateAdcValToCache(); |
|
|
|
|
|
m_Blowser_electricCurrentAdc.updateAdcValToCache(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
osDelay(1000); |
|
|
|
|
|
int32_t adcv1 = m_Blowser_electricCurrentAdc.getCacheVal(); |
|
|
|
|
|
int32_t adcv2 = m_AirCompressor_electricCurrentAdc.getCacheVal(); |
|
|
|
|
|
int32_t adcv3 = m_Heater_electricCurrentAdc.getCacheVal(); |
|
|
|
|
|
ZLOGI(TAG, "b:%d, a:%d, h:%d", adcv1, adcv2, adcv3); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
void Hardware::onH2O2CaptureThread() { |
|
|
void Hardware::onH2O2CaptureThread() { |
|
|