Browse Source

v1.0

master
zhaohe 1 year ago
parent
commit
b9702acbae
  1. 2
      transmit_disinfection_protocol_v1
  2. 6
      usrc/base/hardware.cpp
  3. 1
      usrc/protocol_impl/protocol_impl_service.cpp
  4. BIN
      zrelease/v1/h2o2_ext_sensor_pv1.bin
  5. BIN
      zrelease/v1/h2o2_ext_sensor_pv1.elf
  6. 6016
      zrelease/v1/h2o2_ext_sensor_pv1.hex
  7. 51947
      zrelease/v1/h2o2_ext_sensor_pv1.list

2
transmit_disinfection_protocol_v1

@ -1 +1 @@
Subproject commit a3bc27ca9ca6c3d636d4a924c5d8bc9f7f4b5fc8
Subproject commit d5af72cb615c31b9107ce66e9288f0503d3fe940

6
usrc/base/hardware.cpp

@ -28,6 +28,7 @@ int32_t Hardware::readSwitchGroup() {
id |= m_switch_group2.read() << 2;
id |= m_switch_group3.read() << 3;
id |= m_switch_group4.read() << 4;
return id;
}
void Hardware::setAlarmLight(bool r, bool g, bool y) {
@ -163,7 +164,7 @@ int32_t Hardware::h2o2_sensor_data(report_h2o2_data_t* readdata) {
// float ma = mv / 150.0;
// float ppm = (ma - 4) / (20 - 4) * 2000;
int32_t h2o2ma = (h2o2adcVal / 4095.0 * 3.3 * 1000) / 150.0;
int32_t h2o2ppm = (h2o2ma - 4) / (20 - 4) * 2000;
int32_t h2o2ppm = (h2o2ma - 4) * 1.0 / (20 - 4) * 2000;
readdata->sensor_error = ecode != 0;
readdata->h2o2 = h2o2ppm;
@ -228,12 +229,13 @@ void Hardware::onH2O2CaptureThread() {
void Hardware::onAlarmLightThread() {
while (1) {
osDelay(500);
if (m_alarmLightState == kdisconnected) {
static bool state;
setAlarmLight(false, state, false);
state = !state;
} else if (m_alarmLightState == kconnected) {
setAlarmLight(true, true, false);
setAlarmLight(false, true, false);
} else if (m_alarmLightState == kerror) {
setAlarmLight(true, false, false);
}

1
usrc/protocol_impl/protocol_impl_service.cpp

@ -23,6 +23,7 @@ static void onDeviceStateMonitorThreadStart(void const* argument) {
while (true) {
osDelay(1000);
if (Hardware::ins().h2o2_sensor_read_sub_ic_errorcode() != 0) {
ZLOGI(TAG, "H2O2 sensor sub ic error");
Hardware::ins().setAlarmLight(kerror);
} else {
Hardware::ins().setAlarmLight(kconnected);

BIN
zrelease/v1/h2o2_ext_sensor_pv1.bin

BIN
zrelease/v1/h2o2_ext_sensor_pv1.elf

6016
zrelease/v1/h2o2_ext_sensor_pv1.hex
File diff suppressed because it is too large
View File

51947
zrelease/v1/h2o2_ext_sensor_pv1.list
File diff suppressed because it is too large
View File

Loading…
Cancel
Save