diff --git a/app_protocols/transmit_disfection_protocol b/app_protocols/transmit_disfection_protocol index 9836b9c..bd6d6b0 160000 --- a/app_protocols/transmit_disfection_protocol +++ b/app_protocols/transmit_disfection_protocol @@ -1 +1 @@ -Subproject commit 9836b9c4356e8cf635be9ab8394d75c8fb301dfe +Subproject commit bd6d6b04af6fbcb7d9dced79f8ecacb636492a17 diff --git a/usrc/app/dmapp.cpp b/usrc/app/dmapp.cpp index ee0095f..8b6c66f 100644 --- a/usrc/app/dmapp.cpp +++ b/usrc/app/dmapp.cpp @@ -139,20 +139,19 @@ void DisinfectionApp::initialize() { airTightnessTestChGpio.initAsOutput(PD15, kxs_gpio_nopull, true, false); eValve.initAsOutput(PD14, kxs_gpio_nopull, false, true); - REG_LAMADA_FN(kfn_air_tightness_test_cutoff_ch, [&](ProcessContext* cxt) { - airTightnessTestChGpio.write(1); // 内管路,气密性测试 - eValve.write(0); // 电磁阀闭合 - state = true; + REG_LAMADA_FN(kfn_air_leak_detect_test_set_mode, [&](ProcessContext* cxt) { + if (GET_PARAM(0) == 1) { + airTightnessTestChGpio.write(1); // 内管路,气密性测试 + eValve.write(0); // 电磁阀闭合 + state = true; + } else { + airTightnessTestChGpio.write(0); // 连接空气 + eValve.write(1); // 电磁阀打开 + state = false; + } zcanbus_send_ack(cxt->packet, NULL, 0); }); - REG_LAMADA_FN(kfn_air_tightness_test_release_ch, [&](ProcessContext* cxt) { - airTightnessTestChGpio.write(0); // 连接空气 - eValve.write(1); // 电磁阀打开 - state = false; - zcanbus_send_ack(cxt->packet, NULL, 0); - }); - // kfn_air_tightness_test_is_cutoff - REG_LAMADA_FN(kfn_air_tightness_test_is_cutoff, [&](ProcessContext* cxt) { zcanbus_send_ack(cxt->packet, state); }); + REG_LAMADA_FN(kfn_air_tightness_test_get_mode, [&](ProcessContext* cxt) { zcanbus_send_ack(cxt->packet, state); }); } }