Browse Source

update

master
zhaohe 2 years ago
parent
commit
27249143a6
  1. 1
      components/pipette_module/pipette_ctrl_module_v2.cpp
  2. 10
      components/sensors/smtp2/smtp2.cpp

1
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) {

10
components/sensors/smtp2/smtp2.cpp

@ -2,8 +2,8 @@
#include <stdarg.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <string.h>
#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;
}

Loading…
Cancel
Save