Browse Source

update

master
zhaohe 1 year ago
parent
commit
c9c5480d8b
  1. 5
      components/pipette_module/pipette_ctrl_module_v2.cpp
  2. 2
      components/pipette_module/pipette_ctrl_module_v2.hpp
  3. 8
      components/sensors/smtp2_v2/smtp2_v2.cpp
  4. 6
      components/tmc/ic/ztmc5130.cpp

5
components/pipette_module/pipette_ctrl_module_v2.cpp

@ -288,7 +288,7 @@ int32_t PipetteModule::pipette_write_cmd_direct(uint8_t *tx, int32_t len, uint8_
return err::ksubdevice_overtime; return err::ksubdevice_overtime;
} }
m_smtp2.getack((char *)rx, rxlen); m_smtp2.getack((char *)rx, rxlen);
ZLOGI(TAG, "rxlen = %d", *rxlen);
// ZLOGI(TAG, "rxlen = %d", *rxlen);
return 0; return 0;
} }
@ -316,12 +316,13 @@ void PipetteModule::push_snesor_sample_data(int32_t motor_pos, int32_t cap_val,
return; return;
} }
ZLOGI(TAG, "sample mpos:%d cap:%d pressure_val:%d", motor_pos, cap_val, pressure_val);
ZLOGI(TAG, "sample %2d mpos:%2d cap:%4d pressure_val:%4d", capturedata_num, motor_pos, cap_val, pressure_val);
capturedata_buf[capturedata_num].motor_pos = motor_pos; capturedata_buf[capturedata_num].motor_pos = motor_pos;
capturedata_buf[capturedata_num].cap_val = cap_val; capturedata_buf[capturedata_num].cap_val = cap_val;
capturedata_buf[capturedata_num].pressure_val = pressure_val; capturedata_buf[capturedata_num].pressure_val = pressure_val;
capturedata_num++; capturedata_num++;
} }
//高试管800
/******************************************************************************* /*******************************************************************************
* PRIVATE * * PRIVATE *

2
components/pipette_module/pipette_ctrl_module_v2.hpp

@ -14,7 +14,7 @@
*/ */
namespace iflytop { namespace iflytop {
#define PIPETTEMODULE_SAMPLE_BUF_SIZE 100
#define PIPETTEMODULE_SAMPLE_BUF_SIZE 300
class PipetteModule : public ZIModule, public ZIPipetteCtrlModule { class PipetteModule : public ZIModule, public ZIPipetteCtrlModule {
ENABLE_MODULE(PipetteModule, kpipette_ctrl_module, PC_VERSION); ENABLE_MODULE(PipetteModule, kpipette_ctrl_module, PC_VERSION);

8
components/sensors/smtp2_v2/smtp2_v2.cpp

@ -11,7 +11,7 @@ using namespace smtp2;
#define TAG "SMTP2" #define TAG "SMTP2"
#define OVERTIME 100 #define OVERTIME 100
#define DUMP_HEX 1
#define DUMP_HEX 0
#define SEND_CMD(fmt, ...) sendcmd(true, "/1" fmt "R\r", ##__VA_ARGS__); #define SEND_CMD(fmt, ...) sendcmd(true, "/1" fmt "R\r", ##__VA_ARGS__);
#define SEND_CMD_NLOG(fmt, ...) sendcmd(false, "/1" fmt "R\r", ##__VA_ARGS__); #define SEND_CMD_NLOG(fmt, ...) sendcmd(false, "/1" fmt "R\r", ##__VA_ARGS__);
@ -42,7 +42,7 @@ int32_t SMTP2V2::pump_get_state(int32_t* isbusy) {
} }
int32_t SMTP2V2::pump_get_state_as_int(int32_t state_index, int32_t* val) { int32_t SMTP2V2::pump_get_state_as_int(int32_t state_index, int32_t* val) {
size_t rxlen = 0; size_t rxlen = 0;
int ret = SEND_CMD("/1?%d\r", state_index);
int ret = SEND_CMD("?%d\r", state_index);
if (ret != 0) { if (ret != 0) {
return ret; return ret;
} }
@ -164,7 +164,7 @@ bool SMTP2V2::sendcmd_auto_retry(bool dump, const char* cmd) {
bool SMTP2V2::_sendcmd(bool dump, const char* cmd) { bool SMTP2V2::_sendcmd(bool dump, const char* cmd) {
m_rxNum = 0; m_rxNum = 0;
#ifdef DUMP_HEX
#if DUMP_HEX
if (dump) { if (dump) {
ZLOGI(TAG, "tx:%s", cmd); ZLOGI(TAG, "tx:%s", cmd);
} }
@ -172,7 +172,7 @@ bool SMTP2V2::_sendcmd(bool dump, const char* cmd) {
bool ret = _sendcmd_dma(cmd); bool ret = _sendcmd_dma(cmd);
#ifdef DUMP_HEX
#if DUMP_HEX
if (dump) { if (dump) {
ZLOGI(TAG, "rx:%s", m_rxbuf); ZLOGI(TAG, "rx:%s", m_rxbuf);
} }

6
components/tmc/ic/ztmc5130.cpp

@ -212,8 +212,10 @@ void TMC51X0::moveToEnd(int32_t direction, uint32_t velocityMax) {
} }
void TMC51X0::moveBy(int32_t relativePosition, uint32_t velocityMax) { // determine actual position and add numbers of ticks to move void TMC51X0::moveBy(int32_t relativePosition, uint32_t velocityMax) { // determine actual position and add numbers of ticks to move
relativePosition += readInt(TMC5130_XACTUAL);
moveTo(relativePosition, velocityMax);
int32_t pos = getXACTUAL();
int32_t target = pos + relativePosition;
moveTo(target, velocityMax);
} }
uint32_t TMC51X0::readXTARGET() { return readInt(TMC5130_XTARGET); } uint32_t TMC51X0::readXTARGET() { return readInt(TMC5130_XTARGET); }
uint32_t TMC51X0::haspassedms(uint32_t now, uint32_t last) { uint32_t TMC51X0::haspassedms(uint32_t now, uint32_t last) {

Loading…
Cancel
Save