Browse Source

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

master
zhaohe 1 year ago
parent
commit
64001de160
  1. 35
      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

35
sdk/components/pipette_module/pipette_ctrl_module_v2.cpp

@ -5,23 +5,23 @@ using namespace iflytop;
#define TAG "PipetteModule" #define TAG "PipetteModule"
#define DO(func) \
{ \
int32_t ecode = func; \
if (ecode != 0) { \
ZLOGE(TAG, "do %s fail, error %s(%d)", #func, err::error2str(ecode), ecode); \
return ecode; \
} \
#define DO(func) \
{ \
int32_t ecode = func; \
if (ecode != 0) { \
ZLOGE(TAG, "[%d] do %s fail, error %s(%d)", __LINE__, #func, err::error2str(ecode), ecode); \
return ecode; \
} \
} }
#define DO_IN_THREAD(func) \
{ \
int32_t ecode = func; \
if (ecode != 0) { \
ZLOGE(TAG, "do %s fail, error %s(%d)", #func, err::error2str(ecode), ecode); \
creg.module_errorcode = ecode; \
return; \
} \
#define DO_IN_THREAD(func) \
{ \
int32_t ecode = func; \
if (ecode != 0) { \
ZLOGE(TAG, "[%d]do %s fail, error %s(%d) ", __LINE__, #func, err::error2str(ecode), ecode); \
creg.module_errorcode = ecode; \
return; \
} \
} }
#define PIPETTE_PREPARE_POS 800 #define PIPETTE_PREPARE_POS 800
@ -550,7 +550,7 @@ int32_t PipetteModule::do_pipette_distribut(int32_t ul, int32_t zmotor_v) {
DO_IN_THREAD(befor_run()); DO_IN_THREAD(befor_run());
int32_t distribut_ul = ul; 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)); DO_IN_THREAD(m_smtp2.pump_distribut(m_config.aspirate_distribut_pump_vel, distribut_ul));
if (zmotor_v != 0) { if (zmotor_v != 0) {
submotor->moveBy(-LLF_DPOS, zmotor_v); 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; 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; creg.module_status = 0;
return 0; return 0;
tag_err: tag_err:
ZLOGI(TAG, "after_run detecte, error %d", err);
creg.module_status = 2; creg.module_status = 2;
creg.module_errorcode = err; creg.module_errorcode = err;
return 0; 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) { bool SMTP2V2::sendcmd_auto_retry(bool dump, int auto_retry_times, const char* cmd) {
for (size_t i = 0; i < auto_retry_times; i++) { for (size_t i = 0; i < auto_retry_times; i++) {
if (_sendcmd(dump, cmd)) { if (_sendcmd(dump, cmd)) {
break;
return true;
} }
osDelay(10); osDelay(10);
m_rxNum = 0; m_rxNum = 0;
return false;
} }
return true;
return false;
} }
bool SMTP2V2::_sendcmd(bool dump, const char* cmd) { bool SMTP2V2::_sendcmd(bool dump, const char* cmd) {
m_rxNum = 0; m_rxNum = 0;

2
usrc/project_configs.h

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

Loading…
Cancel
Save