Browse Source

去掉部分日志,添加部分调试代码

master
zhaohe 3 months ago
parent
commit
9ef4b470a8
  1. 2
      sdk/components/step_motor_ctrl_module/step_motor_ctrl_module.cpp
  2. 7
      sdk/components/zcan_protocol_parser/zcan_protocol_parser.cpp
  3. 4
      sdk/components/zcancmder/zcanreceiver.cpp

2
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);

7
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;

4
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);
}
}

Loading…
Cancel
Save