diff --git a/.cproject b/.cproject
index 92ee012..3ccd458 100644
--- a/.cproject
+++ b/.cproject
@@ -28,7 +28,7 @@
-
+
-
+
@@ -209,16 +209,16 @@
-
+
-
+
-
+
diff --git a/.project b/.project
index 085a4d5..cba0c00 100644
--- a/.project
+++ b/.project
@@ -1,6 +1,6 @@
- zapp
+ pipeline_disinfection_liquid_path_control
diff --git a/.settings/language.settings.xml b/.settings/language.settings.xml
index 0c64d05..6d9848e 100644
--- a/.settings/language.settings.xml
+++ b/.settings/language.settings.xml
@@ -5,7 +5,7 @@
-
+
@@ -16,7 +16,7 @@
-
+
diff --git a/zapp.ioc b/pipeline_disinfection_liquid_path_control.ioc
similarity index 98%
rename from zapp.ioc
rename to pipeline_disinfection_liquid_path_control.ioc
index 680d564..7f52c7e 100644
--- a/zapp.ioc
+++ b/pipeline_disinfection_liquid_path_control.ioc
@@ -147,8 +147,8 @@ ProjectManager.MainLocation=Core/Src
ProjectManager.NoMain=false
ProjectManager.PreviousToolchain=STM32CubeIDE
ProjectManager.ProjectBuild=false
-ProjectManager.ProjectFileName=zapp.ioc
-ProjectManager.ProjectName=zapp
+ProjectManager.ProjectFileName=pipeline_disinfection_liquid_path_control.ioc
+ProjectManager.ProjectName=pipeline_disinfection_liquid_path_control
ProjectManager.ProjectStructure=
ProjectManager.RegisterCallBack=
ProjectManager.StackSize=0x1000
diff --git a/zapp.launch b/pipeline_disinfection_liquid_path_control.launch
similarity index 83%
rename from zapp.launch
rename to pipeline_disinfection_liquid_path_control.launch
index b284c63..3252a88 100644
--- a/zapp.launch
+++ b/pipeline_disinfection_liquid_path_control.launch
@@ -12,7 +12,7 @@
-
+
@@ -20,10 +20,11 @@
-
-
+
+
+
@@ -46,7 +47,7 @@
-
+
@@ -54,6 +55,7 @@
+
@@ -64,9 +66,9 @@
-
+
-
+
@@ -80,13 +82,13 @@
-
-
+
+
-
+
diff --git a/sdk b/sdk
index 6bd928e..34ff920 160000
--- a/sdk
+++ b/sdk
@@ -1 +1 @@
-Subproject commit 6bd928e42a0bdb1c6345b5751014d94b09ba8985
+Subproject commit 34ff920d0192478c2470f21d15da6f5434181c8d
diff --git a/usrc/main.cpp b/usrc/main.cpp
index 7a92ba8..a467143 100644
--- a/usrc/main.cpp
+++ b/usrc/main.cpp
@@ -22,6 +22,11 @@
#include "sdk\components\zcan_module\zcan_basic_order_module.hpp"
#include "sdk\components\zcan_module\zcan_pump_ctrl_module.hpp"
#include "sdk\components\zcan_module\zcan_trigle_warning_light_ctl_module.hpp"
+//
+#include
+
+#include "sdk\components\cmdscheduler\cmd_scheduler_v2.hpp"
+#include "sdk\hal\zuart.hpp"
#define TAG "main"
namespace iflytop {
@@ -92,7 +97,7 @@ void Main::run() {
};
ZHALCORE::getInstance()->initialize(oscfg);
- ZLOGI(TAG, "zapp:%s", VERSION);
+ ZLOGI(TAG, "pipeline_disinfection_liquid_path_control:%s", VERSION);
printf("int32_t %d int %d longint %d\n", sizeof(int32_t), sizeof(int), sizeof(long int));
debuglight.initAsOutput(DEBUG_LIGHT_GPIO, ZGPIO::kMode_nopull, false, false);
@@ -242,6 +247,61 @@ void Main::run() {
m_huachengPressureSensor.regSubmodule(4, &huart3, 4);
}
+ /*******************************************************************************
+ * 调试方法初始化 *
+ *******************************************************************************/
+ static ZUART uartreceiver;
+ static CmdSchedulerV2 cmdScheduler;
+ static ZUART::cfg_t uartreceiver_cfg = {
+ .name = "uartreceiver",
+ .huart = &DEBUG_UART,
+ .rxbuffersize = 512,
+ .rxovertime_ms = 30,
+ };
+ uartreceiver.initialize(&uartreceiver_cfg);
+ cmdScheduler.initialize(&uartreceiver);
+
+ cmdScheduler.regCMD("setmotor1", "(int16_t acc_rpm2, int16_t rpm, int16_t idlepower, int16_t power)", 4, //
+ [](int32_t paramN, const char **paraV, ICmdParserACK *ack) {
+ int16_t acc_rpm2 = atoi(paraV[0]);
+ int16_t rpm = atoi(paraV[1]);
+ int16_t idlepower = atoi(paraV[2]);
+ int16_t power = atoi(paraV[3]);
+ setmotor(&m_motor1, acc_rpm2, rpm, idlepower, power);
+ ack->setNoneAck(0);
+ });
+ cmdScheduler.regCMD("setmotor2", "(int16_t acc_rpm2, int16_t rpm, int16_t idlepower, int16_t power)", 4, //
+ [](int32_t paramN, const char **paraV, ICmdParserACK *ack) {
+ int16_t acc_rpm2 = atoi(paraV[0]);
+ int16_t rpm = atoi(paraV[1]);
+ int16_t idlepower = atoi(paraV[2]);
+ int16_t power = atoi(paraV[3]);
+ setmotor(&m_motor2, acc_rpm2, rpm, idlepower, power);
+ ack->setNoneAck(0);
+ });
+ cmdScheduler.regCMD("setlight", "(uint8_t r, uint8_t g, uint8_t b, uint8_t beep)", 4, //
+ [](int32_t paramN, const char **paraV, ICmdParserACK *ack) {
+ uint8_t r = atoi(paraV[0]);
+ uint8_t g = atoi(paraV[1]);
+ uint8_t b = atoi(paraV[2]);
+ uint8_t beep = atoi(paraV[3]);
+ triLight_R.setState(r != 0);
+ triLight_G.setState(g != 0);
+ triLight_B.setState(b != 0);
+ triLight_BEEP.setState(beep != 0);
+ ack->setNoneAck(0);
+ });
+ cmdScheduler.regCMD("pressure_sensor_read", "(uint8_t sensorid)", 1, //
+ [](int32_t paramN, const char **paraV, ICmdParserACK *ack) {
+ uint8_t sensorid = atoi(paraV[0]);
+ DP600PressureSensor::sensor_data_t data = m_huachengPressureSensor.readsensordata(sensorid);
+ ZLOGI(TAG, "precision:%d", data.precision);
+ ZLOGI(TAG, "pressure_unit:%d", data.pressure_unit);
+ ZLOGI(TAG, "value:%d", data.value);
+ ZLOGI(TAG, "zero_point:%d", data.zero_point);
+ ZLOGI(TAG, "range_full_point:%d", data.range_full_point);
+ ack->setNoneAck(0);
+ });
ZLOGI(TAG, "init done");
while (1) {
ZHALCORE::getInstance()->loop();