From 27249143a63652a520c4296963c53ada1d67acc0 Mon Sep 17 00:00:00 2001 From: zhaohe Date: Fri, 17 Nov 2023 20:45:32 +0800 Subject: [PATCH] update --- components/pipette_module/pipette_ctrl_module_v2.cpp | 1 + components/sensors/smtp2/smtp2.cpp | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/components/pipette_module/pipette_ctrl_module_v2.cpp b/components/pipette_module/pipette_ctrl_module_v2.cpp index db5d0b4..c5b19d5 100644 --- a/components/pipette_module/pipette_ctrl_module_v2.cpp +++ b/components/pipette_module/pipette_ctrl_module_v2.cpp @@ -21,6 +21,7 @@ void PipetteModule::initialize(int32_t id, config_t *config, hardward_config_t * m_id = id; m_config = *config; m_smtp2.initialize(hardwaredcfg->uart, hardwaredcfg->hdma_rx, hardwaredcfg->hdma_tx); + m_thread.init("pipette_ctrl", 1024); } int32_t PipetteModule::getid(int32_t *id) { diff --git a/components/sensors/smtp2/smtp2.cpp b/components/sensors/smtp2/smtp2.cpp index e93a4bf..e78b00e 100644 --- a/components/sensors/smtp2/smtp2.cpp +++ b/components/sensors/smtp2/smtp2.cpp @@ -2,8 +2,8 @@ #include #include -#include #include +#include #include "sdk\components\zprotocols\errorcode\errorcode.hpp" using namespace iflytop; @@ -319,9 +319,9 @@ int32_t SMTP2::doaction(char* cmd) { } uint8_t state = (uint8_t)m_rxbuf[2]; - if (state > '`') { + if (state >= '`') { state = state - '`'; - } else if (state > '@') { + } else if (state >= '@') { state = state - '@'; } @@ -338,7 +338,7 @@ int32_t SMTP2::sendcmd(const char* cmd, size_t txlen, char* rxbuf, size_t rxbufl // size_t rxlen = 0; #ifdef DUMP_HEX - printf("tx:%s\n", cmd); + ZLOGI_NOT_END_LINE(TAG, "tx:%s", cmd); #endif if (m_hdma_rx) @@ -347,7 +347,7 @@ int32_t SMTP2::sendcmd(const char* cmd, size_t txlen, char* rxbuf, size_t rxbufl ret = sendcmd_block(cmd, txlen, (char*)m_rxbuf, sizeof(m_rxbuf), rxlen); #ifdef DUMP_HEX - printf("rx:%s\n", m_rxbuf); + ZLOGI_NOT_END_LINE(TAG, "rx:%s", m_rxbuf); #endif return ret; }