diff --git a/README.md b/README.md index c1a0936..8b19af0 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,9 @@ V202 1. 添加新设备DT600B的支持 + V203 + 1. 修改协议 kfn_disinfectant_bucket_level_sensor_read_level 名称和定义 + 2. 修复部分BUG ``` ```c @@ -54,7 +57,7 @@ BoardTypeId: kDrawBarDMExtBallValveCtrl = 0x9, // 手持拉杆箱消毒机外部球阀控制板 kH2O2SensorBoard = 0xA, // H2O2传感器板 - DT600B_LC_BOARD = 0x61, - DT600B_PC_BOARD = 0x62, + DT600B_LC_BOARD = 0x61,//大空间标准版 液路 + DT600B_PC_BOARD = 0x62,//大空间标准版 电源 ``` \ No newline at end of file diff --git a/app_protocols/transmit_disfection_protocol b/app_protocols/transmit_disfection_protocol index a779858..613751c 160000 --- a/app_protocols/transmit_disfection_protocol +++ b/app_protocols/transmit_disfection_protocol @@ -1 +1 @@ -Subproject commit a77985829c2972df6bf04a8a2195431559acff75 +Subproject commit 613751c12e7df7f0e4deb9d56cfa22bc2555ca70 diff --git a/usrc/app/dmapp.cpp b/usrc/app/dmapp.cpp index b0adb47..1196d24 100644 --- a/usrc/app/dmapp.cpp +++ b/usrc/app/dmapp.cpp @@ -207,17 +207,27 @@ void DisinfectionApp::initialize() { } if (io0enable || io1enable || io2enable) { - REG_LAMADA_FN(kfn_liquid_level_read_io_state, [&](ProcessContext* cxt) { + REG_LAMADA_FN(kfn_disinfectant_bucket_level_sensor_read_level, [&](ProcessContext* cxt) { int32_t liquid_level_state = 0; - if (io0enable) { - liquid_level_state |= (io0.read() ? 0 : 1) << 0; // bit0:低液位置 - } - if (io1enable) { - liquid_level_state |= (io1.read() ? 0 : 1) << 1; // bit1:中液位 - } - if (io2enable) { - liquid_level_state |= (io2.read() ? 0 : 1) << 2; // bit2:高液位 + + bool io0state = false; + bool io1state = false; + bool io2state = false; + + if (io0enable) io0state = io0.read(); + if (io1enable) io1state = io1.read(); + if (io2enable) io2state = io2.read(); + + if (io2state) { + liquid_level_state = 3; // 液位最高 + } else if (io1state) { + liquid_level_state = 2; // 液位中等 + } else if (io0state) { + liquid_level_state = 1; // 液位最低 + } else { + liquid_level_state = 0; // 无液位 } + zcanbus_send_ack(cxt->packet, liquid_level_state); }); } diff --git a/usrc/app_main.cpp b/usrc/app_main.cpp index 63fba3a..a3ba7dd 100644 --- a/usrc/app_main.cpp +++ b/usrc/app_main.cpp @@ -92,7 +92,8 @@ void umain() { case kSmallSpaceDMPowerCtrlBoard: case kPipeDMLiquidCtrlBoard: case kPipeDMPowerCtrlBoard: - + case DT600B_LC_BOARD: + case DT600B_PC_BOARD: DisinfectionApp::ins()->initialize(); break; case kDrawBarDMExtChSelector: diff --git a/usrc/project_configs.h b/usrc/project_configs.h index 88b85e1..ad95293 100644 --- a/usrc/project_configs.h +++ b/usrc/project_configs.h @@ -15,7 +15,7 @@ * @brief 基础配置 * */ -#define SOFTWARE_VERSION 202 // 软件版本 +#define SOFTWARE_VERSION 203 // 软件版本 #define HARDWARE_VERSION 1 // 硬件版本 #define PROJECT "transmit_disinfection_micro_re" // 工程名称 #define SN_HEADER "SN" // SN号前缀