From 64001de160233fd035f782bc3972dcfde01d1b93 Mon Sep 17 00:00:00 2001 From: zhaohe Date: Mon, 8 Jul 2024 18:07:53 +0800 Subject: [PATCH] =?UTF-8?q?V507,Fix=20=E7=A7=BB=E6=B6=B2=E6=B3=B5=E5=8A=A0?= =?UTF-8?q?=E6=B6=B2=E8=B6=85=E6=97=B6=E7=9A=84BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pipette_module/pipette_ctrl_module_v2.cpp | 35 ++++++++++++---------- sdk/components/sensors/smtp2_v2/smtp2_v2.cpp | 5 ++-- usrc/project_configs.h | 2 +- 3 files changed, 22 insertions(+), 20 deletions(-) diff --git a/sdk/components/pipette_module/pipette_ctrl_module_v2.cpp b/sdk/components/pipette_module/pipette_ctrl_module_v2.cpp index 4152219..5eeffdf 100644 --- a/sdk/components/pipette_module/pipette_ctrl_module_v2.cpp +++ b/sdk/components/pipette_module/pipette_ctrl_module_v2.cpp @@ -5,23 +5,23 @@ using namespace iflytop; #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 @@ -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; diff --git a/sdk/components/sensors/smtp2_v2/smtp2_v2.cpp b/sdk/components/sensors/smtp2_v2/smtp2_v2.cpp index e92dba4..8acb5e4 100644 --- a/sdk/components/sensors/smtp2_v2/smtp2_v2.cpp +++ b/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; diff --git a/usrc/project_configs.h b/usrc/project_configs.h index 714f791..1efdacd 100644 --- a/usrc/project_configs.h +++ b/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