Browse Source

update protocol

master
zhaohe 12 months ago
parent
commit
8dfd8e6ed1
  1. 2
      app_protocols/transmit_disfection_protocol
  2. 23
      usrc/app/dmapp.cpp

2
app_protocols/transmit_disfection_protocol

@ -1 +1 @@
Subproject commit 9836b9c4356e8cf635be9ab8394d75c8fb301dfe
Subproject commit bd6d6b04af6fbcb7d9dced79f8ecacb636492a17

23
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); });
}
}

Loading…
Cancel
Save