From c08516dd10957ff701453f8283324d89f7b7d315 Mon Sep 17 00:00:00 2001 From: zhaohe Date: Tue, 10 Sep 2024 16:54:46 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=B0=86=E6=89=80=E6=9C=89=E4=BE=9D?= =?UTF-8?q?=E8=B5=96=E5=BA=93=E6=94=AF=E6=8C=81=E5=88=B0=E6=9C=80=E6=96=B0?= =?UTF-8?q?=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .settings/language.settings.xml | 4 ++-- Drivers | 2 +- app_protocols/transmit_disfection_protocol | 2 +- app_protocols/zscanprotocol | 2 +- stm32basic | 2 +- stm32components | 2 +- stm32halport | 2 +- ucomponents/hmp110/hmp110.hpp | 6 +++--- ucomponents/hpp272/hpp272.hpp | 4 ++-- .../preportional_valve/preportional_valve_ctrl.cpp | 24 +++++++++++----------- .../pxx_pressure_sensor_bus.hpp | 2 +- usrc/app/exth2o2_sensor.cpp | 2 +- usrc/app_main.cpp | 2 +- usrc/base/config_service.cpp | 3 ++- usrc/base/config_service.hpp | 3 ++- usrc/base/device_info.hpp | 1 + usrc/base/protocol_processer_mgr.cpp | 1 - usrc/base/protocol_processer_utils.hpp | 5 ++--- usrc/module/air_compressor_controller.hpp | 1 - usrc/module/blower_controller.hpp | 2 +- usrc/module/pxxpsbus.hpp | 2 -- usrc/module/tmc_motor_group.cpp | 10 ++++----- usrc/module/tmc_motor_group.hpp | 2 ++ .../public_cmd_processer.cpp | 1 - .../public_cmd_processer.hpp | 1 - 25 files changed, 43 insertions(+), 45 deletions(-) diff --git a/.settings/language.settings.xml b/.settings/language.settings.xml index 02e817d..02bc15c 100644 --- a/.settings/language.settings.xml +++ b/.settings/language.settings.xml @@ -5,7 +5,7 @@ - + @@ -16,7 +16,7 @@ - + diff --git a/Drivers b/Drivers index e71ddbc..078acc8 160000 --- a/Drivers +++ b/Drivers @@ -1 +1 @@ -Subproject commit e71ddbca4e7fc61b82b6b1f03f66b7cfbffb0495 +Subproject commit 078acc813aab2a755e85f89f8d3b1f94174cfd1f diff --git a/app_protocols/transmit_disfection_protocol b/app_protocols/transmit_disfection_protocol index bc4d7a3..0edd82d 160000 --- a/app_protocols/transmit_disfection_protocol +++ b/app_protocols/transmit_disfection_protocol @@ -1 +1 @@ -Subproject commit bc4d7a3d201125f735fb193b6109be24399be84a +Subproject commit 0edd82d824736ca1d4d2f113a382204e702709bc diff --git a/app_protocols/zscanprotocol b/app_protocols/zscanprotocol index 1b678c1..81529a1 160000 --- a/app_protocols/zscanprotocol +++ b/app_protocols/zscanprotocol @@ -1 +1 @@ -Subproject commit 1b678c19f32b1718ae4ebd719b1dc19cd1e48bf5 +Subproject commit 81529a15c57000f73cc5bd4b7276f567099b9988 diff --git a/stm32basic b/stm32basic index bed34d4..ea11d9f 160000 --- a/stm32basic +++ b/stm32basic @@ -1 +1 @@ -Subproject commit bed34d48c7e2a5e019af3a567d4de3b47702c4dc +Subproject commit ea11d9f77beed2bf8145bbe490283c0830fa8a77 diff --git a/stm32components b/stm32components index a3069a8..c329787 160000 --- a/stm32components +++ b/stm32components @@ -1 +1 @@ -Subproject commit a3069a8005dcb8277f95d0341551c145fac2a046 +Subproject commit c3297878099d6ab606c91c0cd29c37ebadcd035a diff --git a/stm32halport b/stm32halport index 6c550d6..a0107db 160000 --- a/stm32halport +++ b/stm32halport @@ -1 +1 @@ -Subproject commit 6c550d69902d048e8fdd782d11e3feba7120b740 +Subproject commit a0107dbac5d3ec2750b60b553097f5f7e1763ef7 diff --git a/ucomponents/hmp110/hmp110.hpp b/ucomponents/hmp110/hmp110.hpp index 21a88b8..2aed003 100644 --- a/ucomponents/hmp110/hmp110.hpp +++ b/ucomponents/hmp110/hmp110.hpp @@ -31,15 +31,15 @@ class HMP110 { ModbusBlockHost* m_modbusBlockHost = NULL; int32_t m_id = 0; - zmutex m_lock; + zmutex m_lock = {"HMP110:m_lock"}; hmp110_sensordata_t m_rdbuf; hmp110_sensordata_t m_cachedata; int32_t m_cache_errorcode = 0; - zmutex m_cache_lock; + zmutex m_cache_lock = {"HMP110:m_cache_lock"}; - zmutex m_chlock; + zmutex m_chlock = {"HMP110:m_chlock"}; public: /*********************************************************************************************************************** diff --git a/ucomponents/hpp272/hpp272.hpp b/ucomponents/hpp272/hpp272.hpp index 7fdb0ec..63010ed 100644 --- a/ucomponents/hpp272/hpp272.hpp +++ b/ucomponents/hpp272/hpp272.hpp @@ -38,13 +38,13 @@ class HPP272 { ModbusBlockHost* m_modbusBlockHost = NULL; int32_t m_id = 0; - zmutex m_lock; + zmutex m_lock = {"HPP272:m_lock"}; hpp272_data_t m_readbuf; hpp272_data_t m_cachedata; int32_t m_cache_errorcode = 0; - zmutex m_cache_lock; + zmutex m_cache_lock={"HPP272:m_cache_lock"}; public: /*********************************************************************************************************************** diff --git a/ucomponents/preportional_valve/preportional_valve_ctrl.cpp b/ucomponents/preportional_valve/preportional_valve_ctrl.cpp index 8f8fdcb..9904fed 100644 --- a/ucomponents/preportional_valve/preportional_valve_ctrl.cpp +++ b/ucomponents/preportional_valve/preportional_valve_ctrl.cpp @@ -2,7 +2,7 @@ #include "transmit_disfection_protocol/transmit_disfection_protocol.hpp" using namespace iflytop; -using namespace zscanprotocol; +using namespace transmit_disfection_protocol; #define WORK_STATE_REG 0x0000 #define CTRL_STATE_REG 0x0001 @@ -10,7 +10,7 @@ using namespace zscanprotocol; #define OVERTIME 100 #define TAG "PreportionalValveCtrl" -void PreportionalValveCtrl::initialize(UART_HandleTypeDef* huart) {// +void PreportionalValveCtrl::initialize(UART_HandleTypeDef* huart) { // m_modbusBlockHost.initialize(huart); m_modbusBlockHost.enableDump(false); } @@ -18,21 +18,21 @@ void PreportionalValveCtrl::initialize(UART_HandleTypeDef* huart) {// int32_t PreportionalValveCtrl::writeReg06(uint8_t slaveAddr, uint16_t regAddr, uint16_t regVal) { int32_t err = m_modbusBlockHost.writeReg06(slaveAddr, regAddr, regVal, OVERTIME); if (err == 0) return 0; - return err::kerr_subdevice_overtime; + return kerr_subdevice_overtime; } int32_t PreportionalValveCtrl::readReg03(uint8_t slaveAddr, uint16_t regAddr, uint16_t* regVal) { int32_t err = m_modbusBlockHost.readReg03(slaveAddr, regAddr, regVal, OVERTIME); if (err == 0) return 0; - return err::kerr_subdevice_overtime; + return kerr_subdevice_overtime; } int32_t PreportionalValveCtrl::setValvePos(int32_t valueid, int32_t pos) { // int32_t ret = 0; if (valueid > 255 || valueid < 1) { - return err::kerr_invalid_param; + return kerr_invalid_param; } ret = writeReg06(valueid, CTRL_STATE_REG, pos); - if (!ret) return err::kerr_subdevice_overtime; + if (!ret) return kerr_subdevice_overtime; m_last_set_valve_ticket = HAL_GetTick(); m_targetpos[valueid] = pos; @@ -42,12 +42,12 @@ int32_t PreportionalValveCtrl::setValvePos(int32_t valueid, int32_t pos) { // int32_t PreportionalValveCtrl::getValvePos(int32_t valueid, int32_t* pos) { int32_t ret = 0; if (valueid > 255 || valueid < 1) { - return err::kerr_invalid_param; + return kerr_invalid_param; } uint16_t pos16 = 0; ret = readReg03(valueid, POS_STATE_REG, &pos16); - if (!ret) return err::kerr_subdevice_overtime; + if (!ret) return kerr_subdevice_overtime; *pos = pos16; return 0; @@ -55,12 +55,12 @@ int32_t PreportionalValveCtrl::getValvePos(int32_t valueid, int32_t* pos) { int32_t PreportionalValveCtrl::getValveOrderPos(int32_t valueid, int32_t* pos) { int32_t ret = 0; if (valueid > 255 || valueid < 1) { - return err::kerr_invalid_param; + return kerr_invalid_param; } uint16_t pos16 = 0; ret = readReg03(valueid, CTRL_STATE_REG, &pos16); - if (!ret) return err::kerr_subdevice_overtime; + if (!ret) return kerr_subdevice_overtime; *pos = pos16; return 0; @@ -93,12 +93,12 @@ int32_t PreportionalValveCtrl::isBusy(int32_t valueid, int32_t* busy) { int32_t PreportionalValveCtrl::getValveWorkState(int32_t valueid, int32_t* state) { int32_t ret = 0; if (valueid > 255 || valueid < 1) { - return err::kerr_invalid_param; + return kerr_invalid_param; } uint16_t state16 = 0; ret = readReg03(valueid, WORK_STATE_REG, &state16); - if (!ret) return err::kerr_subdevice_overtime; + if (!ret) return kerr_subdevice_overtime; *state = state16; return 0; } \ No newline at end of file diff --git a/ucomponents/pxx_pressure_sensor_driver/pxx_pressure_sensor_bus.hpp b/ucomponents/pxx_pressure_sensor_driver/pxx_pressure_sensor_bus.hpp index 7cead01..87c5b50 100644 --- a/ucomponents/pxx_pressure_sensor_driver/pxx_pressure_sensor_bus.hpp +++ b/ucomponents/pxx_pressure_sensor_driver/pxx_pressure_sensor_bus.hpp @@ -45,7 +45,7 @@ class PXXPressureSensorBus { ModbusBlockHost* m_modbusBlockHost; bool initedEnd = false; - zmutex m_lock; + zmutex m_lock={"PXXPressureSensorBus:m_lock"}; public: sensor_t sensors[PXX_PRESSURE_SENSOR_NUM] = {0}; diff --git a/usrc/app/exth2o2_sensor.cpp b/usrc/app/exth2o2_sensor.cpp index 4bc8e8d..475d749 100644 --- a/usrc/app/exth2o2_sensor.cpp +++ b/usrc/app/exth2o2_sensor.cpp @@ -15,7 +15,7 @@ ExtH2O2Sensor* ExtH2O2Sensor::ins() { return &instance; } void ExtH2O2Sensor::initialize() { - LargeSpaceDmPowerCtrlBoardHal::HUART3_INIT(19200, UART_STOPBITS_2); + LargeSpaceDmPowerCtrlBoardHal::HUART2_INIT(19200, UART_STOPBITS_2); H2O2ExtBoard::HADC1_INIT(); h2o2Sensor.initialize(&huart2, &hadc1, ADC_CHANNEL_10); diff --git a/usrc/app_main.cpp b/usrc/app_main.cpp index a363438..0f02d9f 100644 --- a/usrc/app_main.cpp +++ b/usrc/app_main.cpp @@ -85,7 +85,7 @@ void umain() { idtable_init(); deviceInfo_init(); - config_init(); + // config_init(); AppPeriodTaskMgr::ins()->initialize(); PublicBoard::ins()->initialize(); diff --git a/usrc/base/config_service.cpp b/usrc/base/config_service.cpp index 590e81d..17ba97d 100644 --- a/usrc/base/config_service.cpp +++ b/usrc/base/config_service.cpp @@ -1,5 +1,5 @@ #include "config_service.hpp" - +#if 0 static config_t _config; static config_t _default_val_config; @@ -35,3 +35,4 @@ config_t *config_get(void) { return &_config; } void config_flush(void) { zflash_flush(); } void config_factory_reset(void) { zflash_factory_reset(); } +#endif \ No newline at end of file diff --git a/usrc/base/config_service.hpp b/usrc/base/config_service.hpp index c568cc3..f11ce6e 100644 --- a/usrc/base/config_service.hpp +++ b/usrc/base/config_service.hpp @@ -1,4 +1,5 @@ #pragma once +#if 0 #include #include "stm32basic/stm32basic.hpp" @@ -14,4 +15,4 @@ void config_init(void); config_t* config_get(void); void config_flush(void); void config_factory_reset(void); - +#endif diff --git a/usrc/base/device_info.hpp b/usrc/base/device_info.hpp index 95e6133..ec5313b 100644 --- a/usrc/base/device_info.hpp +++ b/usrc/base/device_info.hpp @@ -1,6 +1,7 @@ #pragma once #include #include +#include #include "project_configs.h" #include "base/config_service.hpp" diff --git a/usrc/base/protocol_processer_mgr.cpp b/usrc/base/protocol_processer_mgr.cpp index 0de723b..b64b2b5 100644 --- a/usrc/base/protocol_processer_mgr.cpp +++ b/usrc/base/protocol_processer_mgr.cpp @@ -1,6 +1,5 @@ #include "protocol_processer_mgr.hpp" using namespace iflytop; -using namespace zscanprotocol; using namespace transmit_disfection_protocol; #define TAG "ProtocolProcesserMgr" diff --git a/usrc/base/protocol_processer_utils.hpp b/usrc/base/protocol_processer_utils.hpp index b514d5e..d378f6a 100644 --- a/usrc/base/protocol_processer_utils.hpp +++ b/usrc/base/protocol_processer_utils.hpp @@ -11,7 +11,6 @@ namespace iflytop { using namespace std; -using namespace zscanprotocol; using namespace transmit_disfection_protocol; #define GET_PARAM(off) ((((int32_t*)(cxt->packet->params))[off])) @@ -19,7 +18,7 @@ using namespace transmit_disfection_protocol; #define CHECK_PARAM_LEN(_paramNum, expectNum) \ if (_paramNum != expectNum) { \ - zcanbus_send_errorack(cxt->packet, err::kerr_invalid_param_num); \ + zcanbus_send_errorack(cxt->packet, kerr_invalid_param_num); \ return; \ } @@ -48,4 +47,4 @@ class CmdProcesser { CmdProcesser(int cmd, cmdprocessfn_t fn) : cmd(cmd), fn(fn) {} }; -} // namespace iflytop \ No newline at end of file +} // namespace iflytop diff --git a/usrc/module/air_compressor_controller.hpp b/usrc/module/air_compressor_controller.hpp index 4f09e8c..ee5ae70 100644 --- a/usrc/module/air_compressor_controller.hpp +++ b/usrc/module/air_compressor_controller.hpp @@ -2,7 +2,6 @@ #include "base/appdep.hpp" namespace iflytop { -using namespace zscanprotocol; using namespace transmit_disfection_protocol; class AirCompressorController { diff --git a/usrc/module/blower_controller.hpp b/usrc/module/blower_controller.hpp index c598456..9e4d0b9 100644 --- a/usrc/module/blower_controller.hpp +++ b/usrc/module/blower_controller.hpp @@ -117,7 +117,7 @@ class BlowerController { zcanbus_send_ack(cxt->packet, NULL, 0); isopen = GET_PARAM(0) > 0 ? true : false; } else { - zcanbus_send_errorack(cxt->packet, err::kerr_subdevice_overtime); + zcanbus_send_errorack(cxt->packet, kerr_subdevice_overtime); } } else if (m_blowerType == kMiniPwmBlower) { diff --git a/usrc/module/pxxpsbus.hpp b/usrc/module/pxxpsbus.hpp index fef4797..20bd042 100644 --- a/usrc/module/pxxpsbus.hpp +++ b/usrc/module/pxxpsbus.hpp @@ -3,8 +3,6 @@ namespace iflytop { using namespace transmit_disfection_protocol; -using namespace zscanprotocol; -using namespace err; class PXXPSBus { PXXPressureSensorBus psbus; bool m_isInitialized = false; diff --git a/usrc/module/tmc_motor_group.cpp b/usrc/module/tmc_motor_group.cpp index 2e47eb2..2dc26c3 100644 --- a/usrc/module/tmc_motor_group.cpp +++ b/usrc/module/tmc_motor_group.cpp @@ -2,15 +2,15 @@ using namespace iflytop; #define TAG "TmcMotorGroup" using namespace transmit_disfection_protocol; -using namespace zscanprotocol; -using namespace err; +// using namespace zscanprotocol; +// using namespace err; /*********************************************************************************************************************** * 电机异常监控 * ***********************************************************************************************************************/ static osTimerId MotorMonitorTimerId; // 压力传感器数值上报 static bool motorErrorFlagCache[10]; // 电机异常状态上报标志位 -static zmutex motorErrorFlagCacheLock; +static zmutex motorErrorFlagCacheLock = {"motorErrorFlagCacheLock"}; static TmcMotorGroup* tmcgroup_p; static bool motorErrorFlag_get(int subindex) { @@ -115,11 +115,11 @@ void TmcMotorGroup::initialize(Pin_t tmcPowerPin, TMC51X0Cfg cfg0, TMC51X0Cfg cf m_tmc_power_pin.write(true); // PB2 - m_motor[0].initialize(cfg0); + m_motor[0].initialize(0, cfg0); m_motor[0].setIHOLD_IRUN(1, 20, 0); m_motor[0].setMotorShaft(true); - m_motor[1].initialize(cfg1); + m_motor[1].initialize(1, cfg1); m_motor[1].setIHOLD_IRUN(1, 20, 0); m_motor[1].setMotorShaft(true); diff --git a/usrc/module/tmc_motor_group.hpp b/usrc/module/tmc_motor_group.hpp index 6509d90..2669525 100644 --- a/usrc/module/tmc_motor_group.hpp +++ b/usrc/module/tmc_motor_group.hpp @@ -25,10 +25,12 @@ class TmcMotorGroup { private: void fn_pump_rotate(ProcessContext* cxt); void fn_pump_stop(ProcessContext* cxt); + void fn_pump_set_ihold_irun_idelay(ProcessContext* cxt); void fn_pump_set_acc(ProcessContext* cxt); void fn_pump_set_ramp(ProcessContext* cxt); void fn_pump_set_tzw(ProcessContext* cxt); + void fn_pump_set_subic_reg(ProcessContext* cxt); void fn_pump_get_subic_reg(ProcessContext* cxt); void fn_pump_ping(ProcessContext* cxt); diff --git a/usrc/protocol_processer_impl/public_cmd_processer.cpp b/usrc/protocol_processer_impl/public_cmd_processer.cpp index 4990952..9f9ccdb 100644 --- a/usrc/protocol_processer_impl/public_cmd_processer.cpp +++ b/usrc/protocol_processer_impl/public_cmd_processer.cpp @@ -1,7 +1,6 @@ #include "public_cmd_processer.hpp" using namespace iflytop; -using namespace zscanprotocol; using namespace transmit_disfection_protocol; #define ThisClass PublicCmdProcesser diff --git a/usrc/protocol_processer_impl/public_cmd_processer.hpp b/usrc/protocol_processer_impl/public_cmd_processer.hpp index b7a9728..c04b9a6 100644 --- a/usrc/protocol_processer_impl/public_cmd_processer.hpp +++ b/usrc/protocol_processer_impl/public_cmd_processer.hpp @@ -4,7 +4,6 @@ namespace iflytop { using namespace std; -using namespace zscanprotocol; using namespace transmit_disfection_protocol; class PublicCmdProcesser { From 7b9d854ace66459f2ab3d84c929de07b39fcbe3d Mon Sep 17 00:00:00 2001 From: zhaohe Date: Tue, 10 Sep 2024 17:02:54 +0800 Subject: [PATCH 2/3] merge --- .settings/language.settings.xml | 4 ---- ucomponents/preportional_valve/preportional_valve_ctrl.cpp | 5 ----- 2 files changed, 9 deletions(-) diff --git a/.settings/language.settings.xml b/.settings/language.settings.xml index 73834eb..02bc15c 100644 --- a/.settings/language.settings.xml +++ b/.settings/language.settings.xml @@ -16,11 +16,7 @@ -<<<<<<< HEAD -======= - ->>>>>>> origin/master diff --git a/ucomponents/preportional_valve/preportional_valve_ctrl.cpp b/ucomponents/preportional_valve/preportional_valve_ctrl.cpp index f5a7b80..9904fed 100644 --- a/ucomponents/preportional_valve/preportional_valve_ctrl.cpp +++ b/ucomponents/preportional_valve/preportional_valve_ctrl.cpp @@ -2,13 +2,8 @@ #include "transmit_disfection_protocol/transmit_disfection_protocol.hpp" using namespace iflytop; -<<<<<<< HEAD using namespace transmit_disfection_protocol; -======= -using namespace zscanprotocol; -using namespace transmit_disfection_protocol; ->>>>>>> origin/master #define WORK_STATE_REG 0x0000 #define CTRL_STATE_REG 0x0001 #define POS_STATE_REG 0x0013 From 2ea48c241ebaf0365c2bf53fbdf36bd65a28e9e6 Mon Sep 17 00:00:00 2001 From: zhaohe Date: Tue, 10 Sep 2024 17:04:10 +0800 Subject: [PATCH 3/3] v106 --- README.md | 4 ++++ usrc/project_configs.h | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5138590..574fe99 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,10 @@ 3. 上位机指令超时时间建议设置成500ms V105: 1.修复比例阀控制失败的BUG + V106: + 1.修复电机错误的停止方式 + 2.将所有依赖更新到最新版本 + 3.支持外置过氧化氢传感器 ``` diff --git a/usrc/project_configs.h b/usrc/project_configs.h index 25ddd3f..03b92b9 100644 --- a/usrc/project_configs.h +++ b/usrc/project_configs.h @@ -15,7 +15,7 @@ * @brief 基础配置 * */ -#define SOFTWARE_VERSION 105 // 软件版本 +#define SOFTWARE_VERSION 106 // 软件版本 #define HARDWARE_VERSION 1 // 硬件版本 #define PROJECT "transmit_disinfection_micro_re" // 工程名称 #define SN_HEADER "SN" // SN号前缀