Browse Source

V507,Fix 移液泵加液超时的BUG

master
zhaohe 1 year ago
parent
commit
64001de160
  1. 9
      sdk/components/pipette_module/pipette_ctrl_module_v2.cpp
  2. 5
      sdk/components/sensors/smtp2_v2/smtp2_v2.cpp
  3. 2
      usrc/project_configs.h

9
sdk/components/pipette_module/pipette_ctrl_module_v2.cpp

@ -9,7 +9,7 @@ using namespace iflytop;
{ \
int32_t ecode = func; \
if (ecode != 0) { \
ZLOGE(TAG, "do %s fail, error %s(%d)", #func, err::error2str(ecode), ecode); \
ZLOGE(TAG, "[%d] do %s fail, error %s(%d)", __LINE__, #func, err::error2str(ecode), ecode); \
return ecode; \
} \
}
@ -18,7 +18,7 @@ using namespace iflytop;
{ \
int32_t ecode = func; \
if (ecode != 0) { \
ZLOGE(TAG, "do %s fail, error %s(%d)", #func, err::error2str(ecode), ecode); \
ZLOGE(TAG, "[%d]do %s fail, error %s(%d) ", __LINE__, #func, err::error2str(ecode), ecode); \
creg.module_errorcode = ecode; \
return; \
} \
@ -550,7 +550,7 @@ int32_t PipetteModule::do_pipette_distribut(int32_t ul, int32_t zmotor_v) {
DO_IN_THREAD(befor_run());
int32_t distribut_ul = ul;
if (distribut_ul == 0) distribut_ul = m_state.load_val_ul;
if (distribut_ul == 0) distribut_ul = m_state.load_val_ul + 1;
DO_IN_THREAD(m_smtp2.pump_distribut(m_config.aspirate_distribut_pump_vel, distribut_ul));
if (zmotor_v != 0) {
submotor->moveBy(-LLF_DPOS, zmotor_v);
@ -741,10 +741,13 @@ int32_t PipetteModule::after_run() {
m_state.dul = m_state.pump_after_pos_ul - m_state.pump_before_pos_ul;
ZLOGI(TAG, "after_run before:%d after:%d dul:%d", m_state.pump_before_pos_ul, m_state.pump_after_pos_ul, m_state.dul);
creg.module_status = 0;
return 0;
tag_err:
ZLOGI(TAG, "after_run detecte, error %d", err);
creg.module_status = 2;
creg.module_errorcode = err;
return 0;

5
sdk/components/sensors/smtp2_v2/smtp2_v2.cpp

@ -232,13 +232,12 @@ int32_t SMTP2V2::sendcmd(bool dump, int auto_retry_times, const char* format, ..
bool SMTP2V2::sendcmd_auto_retry(bool dump, int auto_retry_times, const char* cmd) {
for (size_t i = 0; i < auto_retry_times; i++) {
if (_sendcmd(dump, cmd)) {
break;
return true;
}
osDelay(10);
m_rxNum = 0;
return false;
}
return true;
return false;
}
bool SMTP2V2::_sendcmd(bool dump, const char* cmd) {
m_rxNum = 0;

2
usrc/project_configs.h

@ -1,5 +1,5 @@
#pragma once
#define PC_VERSION 506
#define PC_VERSION 507
#define PC_MANUFACTURER "http://www.iflytop.com/"
#define PC_PROJECT_NAME "a8000_subboard"
#define PC_IFLYTOP_ENABLE_OS 1

Loading…
Cancel
Save