From 983bea80e02b409c0377b43a058472cdbfa9cfc8 Mon Sep 17 00:00:00 2001 From: zhaohe Date: Mon, 26 Aug 2024 11:44:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=B0=94=E5=AF=86=E6=80=A7?= =?UTF-8?q?=E6=A3=80=E6=B5=8B=E7=94=B5=E7=A3=81=E9=98=80=E6=8E=A7=E5=88=B6?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .settings/language.settings.xml | 4 ++-- app_protocols/transmit_disfection_protocol | 2 +- usrc/app/dmapp.cpp | 33 ++++++++++++++++++++---------- 3 files changed, 25 insertions(+), 14 deletions(-) diff --git a/.settings/language.settings.xml b/.settings/language.settings.xml index 6106b10..02e817d 100644 --- a/.settings/language.settings.xml +++ b/.settings/language.settings.xml @@ -5,7 +5,7 @@ - + @@ -16,7 +16,7 @@ - + diff --git a/app_protocols/transmit_disfection_protocol b/app_protocols/transmit_disfection_protocol index 9135659..4aef968 160000 --- a/app_protocols/transmit_disfection_protocol +++ b/app_protocols/transmit_disfection_protocol @@ -1 +1 @@ -Subproject commit 9135659ab41af623d10c691646501d313f927c14 +Subproject commit 4aef96865307cfad9f2386253496f696c6ed5ecf diff --git a/usrc/app/dmapp.cpp b/usrc/app/dmapp.cpp index 191ef35..3200c08 100644 --- a/usrc/app/dmapp.cpp +++ b/usrc/app/dmapp.cpp @@ -144,22 +144,33 @@ void DisinfectionApp::initialize() { static ZGPIO eValve0; static ZGPIO eValve1; airTightnessTestChGpio.initAsOutput(PD14, kxs_gpio_nopull, true, false); - eValve0.initAsOutput(PD15, kxs_gpio_nopull, false, true); - eValve1.initAsOutput(PC6, kxs_gpio_nopull, false, true); + eValve0.initAsOutput(PD15, kxs_gpio_nopull, true, false); + eValve1.initAsOutput(PC6, kxs_gpio_nopull, true, false); REG_LAMADA_FN(kfn_air_leak_test_set_mode, [&](ProcessContext* cxt) { if (GET_PARAM(0) == kAirLeakTestMode_disinfection) { - airTightnessTestChGpio.write(1); // 内管路 - eValve0.write(1); // 电磁阀打开 - eValve1.write(1); // 电磁阀打开 + airTightnessTestChGpio.write(0); // 内管路 + eValve0.write(0); // 联通 + eValve1.write(0); // 联通 } else if (GET_PARAM(0) == kAirLeakTestMode_inflation) { - airTightnessTestChGpio.write(0); // 连接空气 - eValve0.write(1); // 电磁阀打开 - eValve1.write(1); // 电磁阀打开 + airTightnessTestChGpio.write(1); // 连接空气 + eValve0.write(0); // 联通 + eValve1.write(0); // 联通 } else if (GET_PARAM(0) == kAirLeakTestMode_leakTest) { - airTightnessTestChGpio.write(1); // 内管路 - eValve0.write(0); // 电磁阀闭合 - eValve1.write(0); // 电磁阀闭合 + airTightnessTestChGpio.write(0); // 内管路 + eValve0.write(1); // 闭合 + eValve1.write(1); // 闭合 + } else if (GET_PARAM(0) == kAirLeakTestMode_closeAll) { + airTightnessTestChGpio.write(0); + eValve0.write(0); + eValve1.write(0); + } else if (GET_PARAM(0) == kAirLeakTestMode_openAll) { + airTightnessTestChGpio.write(1); + eValve0.write(1); + eValve1.write(1); } + + // kAirLeakTestMode_closeAll + // kAirLeakTestMode_openAll airLeakTestMode = (air_leak_test_mode_t)GET_PARAM(0); zcanbus_send_ack(cxt->packet, NULL, 0); });