Browse Source

重构部分代码

master
zhaohe 12 months ago
parent
commit
f97a74d331
  1. 4
      .settings/language.settings.xml
  2. 3
      .vscode/settings.json
  3. 2
      app_protocols/transmit_disfection_protocol
  4. 2
      app_protocols/zscanprotocol
  5. 101
      usrc/app/dmapp.cpp
  6. 163
      usrc/app/dmapp.cpp.bak
  7. 8
      usrc/app_main.cpp
  8. 2
      usrc/base/protocol_processer_mgr.cpp
  9. 2
      usrc/base/protocol_processer_utils.hpp
  10. 26
      usrc/board/public_board.cpp
  11. 18
      usrc/board/public_board.hpp
  12. 3
      usrc/module/pxxpsbus.hpp
  13. 3
      usrc/module/tmc_motor_group.cpp
  14. 2
      zsdk

4
.settings/language.settings.xml

@ -5,7 +5,7 @@
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="-950162685226061977" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="-1128069368129573915" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
@ -16,7 +16,7 @@
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="-1003371568090109608" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="-1235536402791664684" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>

3
.vscode/settings.json

@ -81,7 +81,8 @@
"common_hardware_init.h": "c",
"public_service.h": "c",
"stm32irq.h": "c",
"project_configs.h": "c"
"project_configs.h": "c",
"*.bak": "c"
},
"files.autoGuessEncoding": false,
"files.encoding": "utf8"

2
app_protocols/transmit_disfection_protocol

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

2
app_protocols/zscanprotocol

@ -1 +1 @@
Subproject commit 94c49f650f508e64b9e30e733dbb161c72ae2559
Subproject commit d11d41c1062568f629d5ec2bc6435319b7ea83e3

101
usrc/app/dmapp.cpp

@ -29,67 +29,61 @@ const char* DisinfectionApp::getName() { return "DisinfectionApp"; }
void DisinfectionApp::initialize() {
int btid = PublicBoard::ins()->getBoardTypeId();
//
// 加热片
if (isBoardType(kLargeSpaceDMPowerCtrlBoard, kSmallSpaceDMPowerCtrlBoard, kPipeDMPowerCtrlBoard)) {
// only support
// large space disinfection machine,
// small space disinfection machine,
// pipe disinfection machine,
ZASSERT(PORT::isLargeSpaceDM() || PORT::isSamllSpaceDM() || PORT::isPipeDM());
/***********************************************************************************************************************
* *
***********************************************************************************************************************/
if (PORT::isPowerCtrlBoard() && (PORT::isLargeSpaceDM() || PORT::isSamllSpaceDM() || PORT::isPipeDM())) {
LargeSpaceDmPowerCtrlBoardHal::HADC1_INIT();
heaterCtrler.initialize(PC7, &hadc1, ADC_CHANNEL_2, &hadc1, ADC_CHANNEL_4);
} else if (isBoardType(kDrawBarDMPowerCtrlBoard)) {
LargeSpaceDmPowerCtrlBoardHal::HADC1_INIT();
heaterCtrler.initialize(PC7, NULL, 0, &hadc1, ADC_CHANNEL_1);
}
// 风机
if (isBoardType(kLargeSpaceDMPowerCtrlBoard, kSmallSpaceDMPowerCtrlBoard)) {
/***********************************************************************************************************************
* *
***********************************************************************************************************************/
if (PORT::isPowerCtrlBoard() && (PORT::isLargeSpaceDM() || PORT::isSamllSpaceDM())) {
LargeSpaceDmPowerCtrlBoardHal::HADC1_INIT();
blowerCtrler.initialize(PC5, &hadc1, ADC_CHANNEL_1);
} else if (isBoardType(kPipeDMPowerCtrlBoard)) {
} //
else if (PORT::isPowerCtrlBoard() && (PORT::isPipeDM())) {
LargeSpaceDmPowerCtrlBoardHal::HADC1_INIT();
LargeSpaceDmPowerCtrlBoardHal::HUART2_INIT(9600, UART_STOPBITS_1);
blowerCtrler.initializeAsHighPowerUartBlower(&huart2, &hadc1, ADC_CHANNEL_1);
} else if (isBoardType(kDrawBarDMPowerCtrlBoard)) {
DBDMPowerCtrlBoard::HTIM3_INIT();
blowerCtrler.initializeAsMiniPwmBlower(&htim3, TIM_CHANNEL_3, PC6 /*en*/, PC9 /*fb*/);
}
// 空压机
if (isBoardType(kLargeSpaceDMPowerCtrlBoard, kSmallSpaceDMPowerCtrlBoard, kPipeDMPowerCtrlBoard)) {
/***********************************************************************************************************************
* *
***********************************************************************************************************************/
if (PORT::isPowerCtrlBoard() && (PORT::isLargeSpaceDM() || PORT::isSamllSpaceDM() || PORT::isPipeDM())) {
LargeSpaceDmPowerCtrlBoardHal::HADC1_INIT();
airComCtrler.initialize(PC3, &hadc1, ADC_CHANNEL_0);
} else if (isBoardType(kDrawBarDMLiquidCtrlBoard)) {
airComCtrler.initialize(PD14, NULL, 0);
}
// 气密性测试空压机
// kfn_air_tightness_test_ac_ctrl
if (isBoardType(kPipeDMPowerCtrlBoard)) {
REG_LAMADA_FN(kfn_air_tightness_test_ac_ctrl, [&](ProcessContext* cxt) {
airComCtrler.open(GET_PARAM(0));
zcanbus_send_ack(cxt->packet, NULL, 0);
});
REG_LAMADA_FN(kfn_air_tightness_test_ac_is_open, [&](ProcessContext* cxt) { zcanbus_send_ack(cxt->packet, airComCtrler.isOpen()); });
} else if (isBoardType(kDrawBarDMLiquidCtrlBoard)) {
static ZGPIO airCompressorCtrlGpio;
airCompressorCtrlGpio.initAsOutput(PD15, kxs_gpio_nopull, true, false);
REG_LAMADA_FN(kfn_air_tightness_test_ac_ctrl, [&](ProcessContext* cxt) {
airCompressorCtrlGpio.write(GET_PARAM(0));
zcanbus_send_ack(cxt->packet, NULL, 0);
});
REG_LAMADA_FN(kfn_air_tightness_test_ac_is_open, [&](ProcessContext* cxt) { zcanbus_send_ack(cxt->packet, airCompressorCtrlGpio.read()); });
}
/***********************************************************************************************************************
* *
***********************************************************************************************************************/
// null
// H2O2传感器
if (isBoardType(kLargeSpaceDMPowerCtrlBoard, kSmallSpaceDMPowerCtrlBoard, kPipeDMPowerCtrlBoard, kDrawBarDMPowerCtrlBoard)) {
//
/***********************************************************************************************************************
* H2O2传感器 *
***********************************************************************************************************************/
if (PORT::isPowerCtrlBoard() && (PORT::isLargeSpaceDM() || PORT::isSamllSpaceDM() || PORT::isPipeDM())) {
LargeSpaceDmPowerCtrlBoardHal::HUART3_INIT(19200, UART_STOPBITS_2);
LargeSpaceDmPowerCtrlBoardHal::HADC1_INIT();
osDelay(3000);
h2o2Sensor.initialize(&huart3, &hadc1, ADC_CHANNEL_3);
}
// 水浸传感器
if (isBoardType(kLargeSpaceDMLiquidCtrlBoard, kSmallSpaceDMLiquidCtrlBoard, kPipeDMLiquidCtrlBoard)) {
/***********************************************************************************************************************
* *
***********************************************************************************************************************/
if (PORT::isLiquidCtrlBoard() && (PORT::isLargeSpaceDM() || PORT::isSamllSpaceDM() || PORT::isPipeDM())) {
ZLOGI(TAG, "WaterSensor init");
evaporationBinWS.initAsInput(PC7, kxs_gpio_nopull, kxs_gpio_no_irq, true /*mirror*/);
deviceBottomWS.initAsInput(PC8, kxs_gpio_nopull, kxs_gpio_no_irq, true /*mirror*/);
@ -98,36 +92,47 @@ void DisinfectionApp::initialize() {
REG_LAMADA_FN(kfn_evaporation_tank_water_sensor_read_state, [&](ProcessContext* cxt) { zcanbus_send_ack(cxt->packet, evaporationBinWS.read()); });
}
if (isBoardType(kLargeSpaceDMLiquidCtrlBoard, kSmallSpaceDMLiquidCtrlBoard, kPipeDMLiquidCtrlBoard, kDrawBarDMLiquidCtrlBoard)) {
/***********************************************************************************************************************
* TMC电机初始化 *
***********************************************************************************************************************/
if (PORT::isLiquidCtrlBoard() && (PORT::isLargeSpaceDM() || PORT::isSamllSpaceDM() || PORT::isPipeDM())) {
// TMC电机初始化
ZLOGI(TAG, "TMCMotorGroup init");
LargeSpaceDMLiquidCtrlBoardHal::HSPI1_INIT();
tmcPowerGroup.initialize(PB2, {&hspi1, PA4 /*cs*/, PB12 /*en*/}, {&hspi1, PC4 /*cs*/, PB13 /*en*/});
}
// 三色指示灯
if (isBoardType(kLargeSpaceDMLiquidCtrlBoard, kSmallSpaceDMLiquidCtrlBoard, kPipeDMLiquidCtrlBoard)) {
/***********************************************************************************************************************
* *
***********************************************************************************************************************/
if (PORT::isLiquidCtrlBoard() && (PORT::isLargeSpaceDM() || PORT::isSamllSpaceDM() || PORT::isPipeDM())) {
// 三色指示灯初始化
ZLOGI(TAG, "WarningLightDriver init");
wlDriver.initialize(PD8, PD7, PD9, PD10);
}
// 压力传感器初始化
if (isBoardType(kLargeSpaceDMLiquidCtrlBoard, kSmallSpaceDMLiquidCtrlBoard, kPipeDMLiquidCtrlBoard, kDrawBarDMLiquidCtrlBoard)) {
/***********************************************************************************************************************
* *
***********************************************************************************************************************/
if (PORT::isLiquidCtrlBoard() && (PORT::isLargeSpaceDM() || PORT::isSamllSpaceDM() || PORT::isPipeDM())) {
ZLOGI(TAG, "PXXPSBus init");
osDelay(1500); // 等待传感器上电
LargeSpaceDMLiquidCtrlBoardHal::HUART3_INIT(9600, UART_STOPBITS_1);
psBus.initialize(&huart3);
}
// 比例阀初始化
if (isBoardType(kPipeDMLiquidCtrlBoard)) {
/***********************************************************************************************************************
* *
***********************************************************************************************************************/
if (PORT::isLiquidCtrlBoard() && (PORT::isPipeDM())) {
ZLOGI(TAG, "ProportionalValveCtrl init");
LargeSpaceDMLiquidCtrlBoardHal::HUART2_INIT(9600);
proportionalValveCtrl.initialize(&huart2);
}
// 气密性测试通道
if (isBoardType(kPipeDMLiquidCtrlBoard)) {
/***********************************************************************************************************************
* *
***********************************************************************************************************************/
if (PORT::isLiquidCtrlBoard() && (PORT::isPipeDM())) {
static ZGPIO airTightnessTestChGpio;
static ZGPIO eValve;
static bool state = false;

163
usrc/app/dmapp.cpp.bak

@ -0,0 +1,163 @@
#include "dmapp.hpp"
/**
* @brief
* 小空间和大空间硬件一样
* 管道式-----
* 液路控制板
* 相比于大空间消毒机,不同的点:
* 1.增加比例阀控制
* 2.空压机通道控制
* 功率板
* 相比于大空间消毒机,不同的点:
* 1. 风机改成鼓风机(可控风速)
* 拉杆箱------
* 液路控制板
* 功率板
*/
using namespace iflytop;
using namespace transmit_disfection_protocol;
#define TAG "DMAPP"
DisinfectionApp* DisinfectionApp::ins() {
static DisinfectionApp instance;
return &instance;
}
const char* DisinfectionApp::getName() { return "DisinfectionApp"; }
void DisinfectionApp::initialize() {
int btid = PublicBoard::ins()->getBoardTypeId();
// only support
// large space disinfection machine,
// small space disinfection machine,
// pipe disinfection machine,
ZASSERT(PORT::isLargeSpaceDM() || PORT::isLargeSpaceDM() || PORT::isPipeDM());
// 加热片
if (PORT::isPowerCtrlBoard()) {
LargeSpaceDmPowerCtrlBoardHal::HADC1_INIT();
heaterCtrler.initialize(PC7, &hadc1, ADC_CHANNEL_2, &hadc1, ADC_CHANNEL_4);
}
if (isBoardType(kLargeSpaceDMPowerCtrlBoard, kSmallSpaceDMPowerCtrlBoard, kPipeDMPowerCtrlBoard)) {
} else if (isBoardType(kDrawBarDMPowerCtrlBoard)) {
LargeSpaceDmPowerCtrlBoardHal::HADC1_INIT();
heaterCtrler.initialize(PC7, NULL, 0, &hadc1, ADC_CHANNEL_1);
}
// 风机
if (isBoardType(kLargeSpaceDMPowerCtrlBoard, kSmallSpaceDMPowerCtrlBoard)) {
LargeSpaceDmPowerCtrlBoardHal::HADC1_INIT();
blowerCtrler.initialize(PC5, &hadc1, ADC_CHANNEL_1);
} else if (isBoardType(kPipeDMPowerCtrlBoard)) {
LargeSpaceDmPowerCtrlBoardHal::HADC1_INIT();
LargeSpaceDmPowerCtrlBoardHal::HUART2_INIT(9600, UART_STOPBITS_1);
blowerCtrler.initializeAsHighPowerUartBlower(&huart2, &hadc1, ADC_CHANNEL_1);
} else if (isBoardType(kDrawBarDMPowerCtrlBoard)) {
DBDMPowerCtrlBoard::HTIM3_INIT();
blowerCtrler.initializeAsMiniPwmBlower(&htim3, TIM_CHANNEL_3, PC6 /*en*/, PC9 /*fb*/);
}
// 空压机
if (isBoardType(kLargeSpaceDMPowerCtrlBoard, kSmallSpaceDMPowerCtrlBoard, kPipeDMPowerCtrlBoard)) {
LargeSpaceDmPowerCtrlBoardHal::HADC1_INIT();
airComCtrler.initialize(PC3, &hadc1, ADC_CHANNEL_0);
} else if (isBoardType(kDrawBarDMLiquidCtrlBoard)) {
airComCtrler.initialize(PD14, NULL, 0);
}
// 气密性测试空压机
// kfn_air_tightness_test_ac_ctrl
if (isBoardType(kPipeDMPowerCtrlBoard)) {
REG_LAMADA_FN(kfn_air_tightness_test_ac_ctrl, [&](ProcessContext* cxt) {
airComCtrler.open(GET_PARAM(0));
zcanbus_send_ack(cxt->packet, NULL, 0);
});
REG_LAMADA_FN(kfn_air_tightness_test_ac_is_open, [&](ProcessContext* cxt) { zcanbus_send_ack(cxt->packet, airComCtrler.isOpen()); });
} else if (isBoardType(kDrawBarDMLiquidCtrlBoard)) {
static ZGPIO airCompressorCtrlGpio;
airCompressorCtrlGpio.initAsOutput(PD15, kxs_gpio_nopull, true, false);
REG_LAMADA_FN(kfn_air_tightness_test_ac_ctrl, [&](ProcessContext* cxt) {
airCompressorCtrlGpio.write(GET_PARAM(0));
zcanbus_send_ack(cxt->packet, NULL, 0);
});
REG_LAMADA_FN(kfn_air_tightness_test_ac_is_open, [&](ProcessContext* cxt) { zcanbus_send_ack(cxt->packet, airCompressorCtrlGpio.read()); });
}
// H2O2传感器
if (isBoardType(kLargeSpaceDMPowerCtrlBoard, kSmallSpaceDMPowerCtrlBoard, kPipeDMPowerCtrlBoard, kDrawBarDMPowerCtrlBoard)) {
LargeSpaceDmPowerCtrlBoardHal::HUART3_INIT(19200, UART_STOPBITS_2);
LargeSpaceDmPowerCtrlBoardHal::HADC1_INIT();
osDelay(3000);
h2o2Sensor.initialize(&huart3, &hadc1, ADC_CHANNEL_3);
}
// 水浸传感器
if (isBoardType(kLargeSpaceDMLiquidCtrlBoard, kSmallSpaceDMLiquidCtrlBoard, kPipeDMLiquidCtrlBoard)) {
ZLOGI(TAG, "WaterSensor init");
evaporationBinWS.initAsInput(PC7, kxs_gpio_nopull, kxs_gpio_no_irq, true /*mirror*/);
deviceBottomWS.initAsInput(PC8, kxs_gpio_nopull, kxs_gpio_no_irq, true /*mirror*/);
REG_LAMADA_FN(kfn_device_bottom_water_sensor_read_state, [&](ProcessContext* cxt) { zcanbus_send_ack(cxt->packet, deviceBottomWS.read()); });
REG_LAMADA_FN(kfn_evaporation_tank_water_sensor_read_state, [&](ProcessContext* cxt) { zcanbus_send_ack(cxt->packet, evaporationBinWS.read()); });
}
if (isBoardType(kLargeSpaceDMLiquidCtrlBoard, kSmallSpaceDMLiquidCtrlBoard, kPipeDMLiquidCtrlBoard, kDrawBarDMLiquidCtrlBoard)) {
// TMC电机初始化
ZLOGI(TAG, "TMCMotorGroup init");
LargeSpaceDMLiquidCtrlBoardHal::HSPI1_INIT();
tmcPowerGroup.initialize(PB2, {&hspi1, PA4 /*cs*/, PB12 /*en*/}, {&hspi1, PC4 /*cs*/, PB13 /*en*/});
}
// 三色指示灯
if (isBoardType(kLargeSpaceDMLiquidCtrlBoard, kSmallSpaceDMLiquidCtrlBoard, kPipeDMLiquidCtrlBoard)) {
// 三色指示灯初始化
ZLOGI(TAG, "WarningLightDriver init");
wlDriver.initialize(PD8, PD7, PD9, PD10);
}
// 压力传感器初始化
if (isBoardType(kLargeSpaceDMLiquidCtrlBoard, kSmallSpaceDMLiquidCtrlBoard, kPipeDMLiquidCtrlBoard, kDrawBarDMLiquidCtrlBoard)) {
ZLOGI(TAG, "PXXPSBus init");
osDelay(1500); // 等待传感器上电
LargeSpaceDMLiquidCtrlBoardHal::HUART3_INIT(9600, UART_STOPBITS_1);
psBus.initialize(&huart3);
}
// 比例阀初始化
if (isBoardType(kPipeDMLiquidCtrlBoard)) {
ZLOGI(TAG, "ProportionalValveCtrl init");
LargeSpaceDMLiquidCtrlBoardHal::HUART2_INIT(9600);
proportionalValveCtrl.initialize(&huart2);
}
// 气密性测试通道
if (isBoardType(kPipeDMLiquidCtrlBoard)) {
static ZGPIO airTightnessTestChGpio;
static ZGPIO eValve;
static bool state = false;
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;
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); });
}
}
/***********************************************************************************************************************
* PROTOCOL_BIND *
***********************************************************************************************************************/

8
usrc/app_main.cpp

@ -97,14 +97,18 @@ void umain() {
PublicCmdProcesser::ins()->initialize();
switch (PublicBoard::ins()->getBoardTypeId()) {
case kDrawBarDMLiquidCtrlBoard:
case kDrawBarDMPowerCtrlBoard:
// not suppport now
gInitErrorFlag = true;
break;
case kLargeSpaceDMLiquidCtrlBoard:
case kLargeSpaceDMPowerCtrlBoard:
case kSmallSpaceDMLiquidCtrlBoard:
case kSmallSpaceDMPowerCtrlBoard:
case kPipeDMLiquidCtrlBoard:
case kPipeDMPowerCtrlBoard:
case kDrawBarDMLiquidCtrlBoard:
case kDrawBarDMPowerCtrlBoard:
DisinfectionApp::ins()->initialize();
break;
case kDrawBarDMExtChSelector:

2
usrc/base/protocol_processer_mgr.cpp

@ -58,7 +58,7 @@ void ProtocolProcesserMgr::onPacket(uint8_t from, uint8_t to, uint8_t* rawpacket
if (!processed) {
ZLOGW(TAG, "no processer support this packet");
zcanbus_send_errorack(packet, kerr_function_not_support);
zcanbus_send_errorack(packet, err::kerr_function_not_support);
}
ZLOGI(TAG, "process end");
}

2
usrc/base/protocol_processer_utils.hpp

@ -20,7 +20,7 @@ using namespace transmit_disfection_protocol;
#define CHECK_PARAM_LEN(_paramNum, expectNum) \
if (_paramNum != expectNum) { \
zcanbus_send_errorack(cxt->packet, kerr_invalid_param_num); \
zcanbus_send_errorack(cxt->packet, err::kerr_invalid_param_num); \
return; \
}

26
usrc/board/public_board.cpp

@ -141,6 +141,32 @@ int PublicBoard::getBoardId() {
return IdMgr::ins().getBoardId(getBoardTypeId()) + boardIdoff;
}
bool PORT::isLargeSpaceDM() { return PublicBoard::ins()->getProjId() == klarge_space_disinfection_machine; }
bool PORT::isSamllSpaceDM() { return PublicBoard::ins()->getProjId() == ksmall_space_disinfection_machine; }
bool PORT::isPipeDM() { return PublicBoard::ins()->getProjId() == kpipe_disinfection_machine; }
bool PORT::isDrawBarDM() { return PublicBoard::ins()->getProjId() == kdraw_bar_disinfection_box; }
bool PORT::isH2O2Sensor() { return PublicBoard::ins()->getProjId() == kh2o2_ext_sensor; }
bool PORT::isLiquidCtrlBoard() {
if (PublicBoard::ins()->getBoardTypeId() == kLargeSpaceDMLiquidCtrlBoard || //
PublicBoard::ins()->getBoardTypeId() == kSmallSpaceDMLiquidCtrlBoard || //
PublicBoard::ins()->getBoardTypeId() == kPipeDMLiquidCtrlBoard || //
PublicBoard::ins()->getBoardTypeId() == kDrawBarDMLiquidCtrlBoard) {
return true;
}
return false;
}
bool PORT::isPowerCtrlBoard() {
if (PublicBoard::ins()->getBoardTypeId() == kLargeSpaceDMPowerCtrlBoard || //
PublicBoard::ins()->getBoardTypeId() == kSmallSpaceDMPowerCtrlBoard || //
PublicBoard::ins()->getBoardTypeId() == kPipeDMPowerCtrlBoard || //
PublicBoard::ins()->getBoardTypeId() == kDrawBarDMPowerCtrlBoard) {
return true;
}
return false;
}
namespace iflytop {
bool isBoardType(int32_t val0) {
int boardType = PublicBoard::ins()->getBoardTypeId();

18
usrc/board/public_board.hpp

@ -28,4 +28,22 @@ bool isBoardType(int32_t val0, int32_t val1);
bool isBoardType(int32_t val0, int32_t val1, int32_t val2);
bool isBoardType(int32_t val0, int32_t val1, int32_t val2, int32_t val3);
// klarge_space_disinfection_machine = 1, // 大空间消毒机
// ksmall_space_disinfection_machine = 2, // 小空间消毒机
// kpipe_disinfection_machine = 3, // 管道式消毒机
// kdraw_bar_disinfection_box = 4, // 手持拉杆箱消毒机
// kh2o2_ext_sensor = 5, // 外部H2O2传感器
class PORT {
public:
static bool isLargeSpaceDM();
static bool isSamllSpaceDM();
static bool isPipeDM();
static bool isDrawBarDM();
static bool isH2O2Sensor();
static bool isLiquidCtrlBoard();
static bool isPowerCtrlBoard();
};
} // namespace iflytop

3
usrc/module/pxxpsbus.hpp

@ -3,7 +3,8 @@
namespace iflytop {
using namespace transmit_disfection_protocol;
using namespace zscanprotocol;
using namespace err;
class PXXPSBus {
PXXPressureSensorBus psbus;
bool m_isInitialized = false;

3
usrc/module/tmc_motor_group.cpp

@ -1,6 +1,9 @@
#include "tmc_motor_group.hpp"
using namespace iflytop;
#define TAG "TmcMotorGroup"
using namespace transmit_disfection_protocol;
using namespace zscanprotocol;
using namespace err;
/***********************************************************************************************************************
* *

2
zsdk

@ -1 +1 @@
Subproject commit 50565f27ea3e0128518c920d6aa8c98e299e1e54
Subproject commit 2ec58da3d9802e851e67149e3801f7fa6607621d
Loading…
Cancel
Save