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