From 9ef4b470a84ea941f0bef202b0829a713b36db8c Mon Sep 17 00:00:00 2001 From: zhaohe Date: Mon, 21 Apr 2025 22:24:03 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E9=83=A8=E5=88=86=E6=97=A5?= =?UTF-8?q?=E5=BF=97=EF=BC=8C=E6=B7=BB=E5=8A=A0=E9=83=A8=E5=88=86=E8=B0=83?= =?UTF-8?q?=E8=AF=95=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sdk/components/step_motor_ctrl_module/step_motor_ctrl_module.cpp | 2 +- sdk/components/zcan_protocol_parser/zcan_protocol_parser.cpp | 7 +++++++ sdk/components/zcancmder/zcanreceiver.cpp | 4 ++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/sdk/components/step_motor_ctrl_module/step_motor_ctrl_module.cpp b/sdk/components/step_motor_ctrl_module/step_motor_ctrl_module.cpp index 10920db..89f816f 100644 --- a/sdk/components/step_motor_ctrl_module/step_motor_ctrl_module.cpp +++ b/sdk/components/step_motor_ctrl_module/step_motor_ctrl_module.cpp @@ -251,7 +251,7 @@ int32_t StepMotorCtrlModule::step_motor_stop(int32_t breakstop) { int32_t StepMotorCtrlModule::step_motor_easy_set_current_pos(int32_t pos) { return setnowpos(pos); } int32_t StepMotorCtrlModule::step_motor_active_cfg() { - ZLOGI(TAG, "m%d motor_active_cfg", module_id); + // ZLOGI(TAG, "m%d motor_active_cfg", module_id); m_stepM1->enable(false); m_stepM1->setMRES((mres_type_t)m_cfg.stepmotor_mres); m_stepM1->setIHOLD_IRUN(m_cfg.stepmotor_ihold, m_cfg.stepmotor_irun, m_cfg.stepmotor_iholddelay); diff --git a/sdk/components/zcan_protocol_parser/zcan_protocol_parser.cpp b/sdk/components/zcan_protocol_parser/zcan_protocol_parser.cpp index a23261a..cb62953 100644 --- a/sdk/components/zcan_protocol_parser/zcan_protocol_parser.cpp +++ b/sdk/components/zcan_protocol_parser/zcan_protocol_parser.cpp @@ -251,6 +251,13 @@ void ZCanProtocolParser::_processRxPacket(ZIModule* module, zcr_cmd_header_t* rx return; } + // static int32_t lastindex = 0; + // // ZLOGI(TAG, "rx index:%d", rxcmd->index); + // if (rxcmd->index != lastindex + 1) { + // ZLOGI(TAG, "lost packet:%d", lastindex - rxcmd->index); + // } + // lastindex = rxcmd->index; + cmdcontxt_t cxt = {0}; cxt.module = module; cxt.rxcmd = rxcmd; diff --git a/sdk/components/zcancmder/zcanreceiver.cpp b/sdk/components/zcancmder/zcanreceiver.cpp index 13f30d3..415d3b2 100644 --- a/sdk/components/zcancmder/zcanreceiver.cpp +++ b/sdk/components/zcancmder/zcanreceiver.cpp @@ -299,6 +299,8 @@ void ZCanReceiver::STM32_HAL_onCAN_RxFifo0MsgPending(CAN_HandleTypeDef *canHandl if (pHeader.RTR != CAN_RTR_DATA || pHeader.IDE != CAN_ID_STD) continue; if (pHeader.DLC == 0) continue; + // printf("."); + /** * @brief 处理接收到的数据 */ @@ -337,8 +339,10 @@ void ZCanReceiver::STM32_HAL_onCAN_RxFifo0MsgPending(CAN_HandleTypeDef *canHandl curRxBuf->npacket = nframe; bool pass = rxprocesser->filterPacket(curRxBuf); if (pass) { + // printf("y\n"); m_pendingMsgQueue.sendIRQ(curRxBuf); } else { + // printf("x\n"); m_rxFramePool.free(&curRxBuf); } }