Browse Source

update

master
zhaohe 11 months ago
parent
commit
26a352c77d
  1. 1596
      sdk/components/pipette_module/pipette_ctrl_module_v1.cpp
  2. 368
      sdk/components/pipette_module/pipette_ctrl_module_v1.hpp
  3. 69
      sdk/components/pipette_module/pipette_ctrl_module_v2.cpp
  4. 27
      sdk/components/sensors/smtp2_v2/smtp2_v2.cpp
  5. 2
      sdk/components/sensors/smtp2_v2/smtp2_v2.hpp

1596
sdk/components/pipette_module/pipette_ctrl_module_v1.cpp
File diff suppressed because it is too large
View File

368
sdk/components/pipette_module/pipette_ctrl_module_v1.hpp

@ -1,185 +1,185 @@
#pragma once
//
#include "a8000_protocol\protocol.hpp"
#include "sdk/os/zos.hpp"
#include "sdk\components\sensors\smtp2_v2\smtp2_v2.hpp"
#include "sdk\components\step_motor_ctrl_module\step_motor_ctrl_module.hpp"
// #include "StepMotorCtrlModule"
/**
* @brief
*
* :https://iflytop1.feishu.cn/wiki/LTilwSyJwi6fJUkiIhzc2oRqnTb 对设备进行初始化
*
*/
namespace iflytop {
#define PIPETTEMODULE_SAMPLE_BUF_SIZE 300
class PipetteModule : public ZIModule, public ZIPipetteCtrlModule {
ENABLE_MODULE(PipetteModule, kpipette_ctrl_module, PC_VERSION);
public:
typedef enum {
kclld = 0,
kplld = 1,
kmixlld = 2,
} lld_mode_t;
typedef struct {
UART_HandleTypeDef *uart;
DMA_HandleTypeDef *hdma_rx;
DMA_HandleTypeDef *hdma_tx;
} hardward_config_t;
typedef struct {
int32_t motor_pos;
int32_t cap_val; // 电容值
int32_t pressure_val; // 压力值
} snesor_sample_data_t;
typedef struct {
int32_t limit_ul;
int32_t pump_acc;
int32_t pump_dec;
int32_t pump_vstart;
int32_t pump_vstop;
int32_t pump_vmax;
int32_t aspirate_pump_vel; // 吸吐泵机速度
int32_t lld_pump_vel; // lld,泵机吸吐速度
int32_t lld_motor_vel_rpm; // lld,z轴电机移动速度
int32_t lld_detect_period_ms; // lld,探测周期
int32_t lld_prepare_pos; // lld,页面探测准备位置
int32_t lld_prepare_pre_distribut_ul; // lld前,预分配位置
} config_t;
typedef struct {
int32_t load_val_ul; // 已装载量
int32_t aspirated; // 已经吸入过液体
int32_t lld_prepared; // 已经准备液面探测
int32_t pipette_is_inited; // 泵机是否初始化
int32_t dul; // 吸吐变化量
int32_t pump_before_pos_ul; // 执行指令前泵机位置
int32_t pump_after_pos_ul; // 执行指令后泵机位置
int32_t detected_liquid; // 检测到液面
} state_t;
private:
smtp2::SMTP2V2 m_smtp2;
StepMotorCtrlModule *m_zmotor = nullptr;
ZThread m_thread;
int32_t m_id = 0;
config_t m_config = {0};
state_t m_state = {0};
snesor_sample_data_t capturedata_buf[PIPETTEMODULE_SAMPLE_BUF_SIZE];
int32_t capturedata_num = 0;
public:
void initialize(int32_t id, config_t *config, StepMotorCtrlModule *zmotor, hardward_config_t *hardwaredcfg);
virtual int32_t getid(int32_t *id);
/*******************************************************************************
* Module *
*******************************************************************************/
virtual int32_t module_stop() override;
virtual int32_t module_active_cfg() override;
virtual int32_t module_xxx_reg(int32_t param_id, bool read, int32_t &val) override;
/*******************************************************************************
* pipette_ctrl *
*******************************************************************************/
/**
* :
* vstart
* vstop
* vmax
* acc
* dec
*
* 0.
* 0.Z轴失能
* 1.
* 2.
*
* 3.--(moterv,dpos):Z轴向下以motor_v移动dpos,使 ,
* 3.--(moterv,dpos):Z轴向下以motor_v移动dpos,使,,
* 4.()
*
* 5.(ul)
* 6.(ul)
*
*
*
*
* 使
*
* pipette_ctrl_put_tip
* |
* pipette_lld_prepare
* |
* pipette_lld
* |
* pipette_aspirate
* pipette_distribut
* pipette_mix()
*
*
*/
virtual int32_t pipette_ctrl_move_to_ul(int32_t ul) override; // 丢弃
virtual int32_t pipette_ctrl_init_device() override;
virtual int32_t pipette_ctrl_put_tip() override;
virtual int32_t pipette_lld_prepare() override;
virtual int32_t pipette_plld(int32_t zdpos, int32_t p_threshold) override;
virtual int32_t pipette_clld(int32_t zdpos, int32_t c_threshold) override;
virtual int32_t pipette_mlld(int32_t zdpos, int32_t c_threshold, int32_t p_threshold) override;
virtual int32_t pipette_lld_is_detect_liquid(int32_t *liquid) override;
virtual int32_t pipette_aspirate(int32_t ul) override;
virtual int32_t pipette_distribut(int32_t ul) override;
virtual int32_t pipette_shake_up(int32_t ul, int32_t times) override;
virtual int32_t pipette_aspirate_llf(int32_t ul, int32_t zmotor_v) override;
virtual int32_t pipette_distribut_llf(int32_t ul, int32_t zmotor_v) override;
virtual int32_t pipette_shake_up_llf(int32_t ul, int32_t zmotor_v, int32_t times) override;
virtual int32_t pipette_enable_zmotor(int32_t enable);
virtual int32_t pipette_write_cmd_direct(uint8_t *tx, int32_t len, uint8_t *rx, int32_t *rxlen) override;
virtual int32_t pipette_get_sensor_sample_data(int32_t index, int32_t *motor_pos, int32_t *cval, int32_t *pval) override; //
virtual int32_t pipette_get_sensor_sample_data_num(int32_t *num) override;
private:
int32_t do_pipette_ctrl_init_device();
int32_t do_pipette_ctrl_put_tip();
int32_t do_pipette_ctrl_move_to_ul(int32_t ul);
int32_t do_pipette_lld_prepare();
int32_t do_pipette_lld(lld_mode_t mode, int32_t zdpos, int32_t c_threshold, int32_t p_threshold);
int32_t do_pipette_aspirate(int32_t ul, int32_t zmotor_v);
int32_t do_pipette_distribut(int32_t ul, int32_t zmotor_v);
int32_t do_pipette_shake_up(int32_t ul, int32_t zmotor_v, int32_t times);
private:
int32_t befor_run();
int32_t do_put_tip_before_run();
int32_t after_run();
bool check_when_run();
private:
int32_t read_pos_ul(int32_t *val);
int32_t read_capactitance(int32_t *val);
int32_t read_tip_state(int32_t *val);
private:
private:
void push_snesor_sample_data(int32_t motor_pos, int32_t cap_val, int32_t pressure_val);
};
} // namespace iflytop
// //
// #include "a8000_protocol\protocol.hpp"
// #include "sdk/os/zos.hpp"
// #include "sdk\components\sensors\smtp2_v2\smtp2_v2.hpp"
// #include "sdk\components\step_motor_ctrl_module\step_motor_ctrl_module.hpp"
// // #include "StepMotorCtrlModule"
// /**
// * @brief
// *
// * 参考:https://iflytop1.feishu.cn/wiki/LTilwSyJwi6fJUkiIhzc2oRqnTb 对设备进行初始化
// *
// */
// namespace iflytop {
// #define PIPETTEMODULE_SAMPLE_BUF_SIZE 300
// class PipetteModule : public ZIModule, public ZIPipetteCtrlModule {
// ENABLE_MODULE(PipetteModule, kpipette_ctrl_module, PC_VERSION);
// public:
// typedef enum {
// kclld = 0,
// kplld = 1,
// kmixlld = 2,
// } lld_mode_t;
// typedef struct {
// UART_HandleTypeDef *uart;
// DMA_HandleTypeDef *hdma_rx;
// DMA_HandleTypeDef *hdma_tx;
// } hardward_config_t;
// typedef struct {
// int32_t motor_pos;
// int32_t cap_val; // 电容值
// int32_t pressure_val; // 压力值
// } snesor_sample_data_t;
// typedef struct {
// int32_t limit_ul;
// int32_t pump_acc;
// int32_t pump_dec;
// int32_t pump_vstart;
// int32_t pump_vstop;
// int32_t pump_vmax;
// int32_t aspirate_pump_vel; // 吸吐泵机速度
// int32_t lld_pump_vel; // lld,泵机吸吐速度
// int32_t lld_motor_vel_rpm; // lld,z轴电机移动速度
// int32_t lld_detect_period_ms; // lld,探测周期
// int32_t lld_prepare_pos; // lld,页面探测准备位置
// int32_t lld_prepare_pre_distribut_ul; // lld前,预分配位置
// } config_t;
// typedef struct {
// int32_t load_val_ul; // 已装载量
// int32_t aspirated; // 已经吸入过液体
// int32_t lld_prepared; // 已经准备液面探测
// int32_t pipette_is_inited; // 泵机是否初始化
// int32_t dul; // 吸吐变化量
// int32_t pump_before_pos_ul; // 执行指令前泵机位置
// int32_t pump_after_pos_ul; // 执行指令后泵机位置
// int32_t detected_liquid; // 检测到液面
// } state_t;
// private:
// smtp2::SMTP2V2 m_smtp2;
// StepMotorCtrlModule *m_zmotor = nullptr;
// ZThread m_thread;
// int32_t m_id = 0;
// config_t m_config = {0};
// state_t m_state = {0};
// snesor_sample_data_t capturedata_buf[PIPETTEMODULE_SAMPLE_BUF_SIZE];
// int32_t capturedata_num = 0;
// public:
// void initialize(int32_t id, config_t *config, StepMotorCtrlModule *zmotor, hardward_config_t *hardwaredcfg);
// virtual int32_t getid(int32_t *id);
// /*******************************************************************************
// * Module *
// *******************************************************************************/
// virtual int32_t module_stop() override;
// virtual int32_t module_active_cfg() override;
// virtual int32_t module_xxx_reg(int32_t param_id, bool read, int32_t &val) override;
// /*******************************************************************************
// * pipette_ctrl *
// *******************************************************************************/
// /**
// * 参数:
// * vstart
// * vstop
// * vmax
// * acc
// * dec
// *
// * 0.泵机复位
// * 0.Z轴失能
// * 1.移液枪初始化
// * 2.移液枪探测液面初始化
// *
// * 3.移液枪-电容探测液面-测试(moterv,dpos),动作:Z轴向下以motor_v移动dpos,使用电容模式 ,同时采集电容数值
// * 3.移液枪-压力探测液面-测试(moterv,dpos),动作:Z轴向下以motor_v移动dpos,使用分配压力模式,压力阈值设置为最大, 同时采集电容数值,压力值
// * 4.读取压力和电容数值变化数据(电机位置,电容数值,压力数值,泵机位置)
// *
// * 5.吸液(ul)
// * 6.排液(ul)
// *
// *
// *
// *
// * 使用流程
// *
// * pipette_ctrl_put_tip
// * |
// * pipette_lld_prepare
// * |
// * pipette_lld
// * |
// * pipette_aspirate
// * pipette_distribut
// * pipette_mix(吸吐混匀)
// *
// *
// */
// virtual int32_t pipette_ctrl_move_to_ul(int32_t ul) override; // 丢弃
// virtual int32_t pipette_ctrl_init_device() override;
// virtual int32_t pipette_ctrl_put_tip() override;
// virtual int32_t pipette_lld_prepare() override;
// virtual int32_t pipette_plld(int32_t zdpos, int32_t p_threshold) override;
// virtual int32_t pipette_clld(int32_t zdpos, int32_t c_threshold) override;
// virtual int32_t pipette_mlld(int32_t zdpos, int32_t c_threshold, int32_t p_threshold) override;
// virtual int32_t pipette_lld_is_detect_liquid(int32_t *liquid) override;
// virtual int32_t pipette_aspirate(int32_t ul) override;
// virtual int32_t pipette_distribut(int32_t ul) override;
// virtual int32_t pipette_shake_up(int32_t ul, int32_t times) override;
// virtual int32_t pipette_aspirate_llf(int32_t ul, int32_t zmotor_v) override;
// virtual int32_t pipette_distribut_llf(int32_t ul, int32_t zmotor_v) override;
// virtual int32_t pipette_shake_up_llf(int32_t ul, int32_t zmotor_v, int32_t times) override;
// virtual int32_t pipette_enable_zmotor(int32_t enable);
// virtual int32_t pipette_write_cmd_direct(uint8_t *tx, int32_t len, uint8_t *rx, int32_t *rxlen) override;
// virtual int32_t pipette_get_sensor_sample_data(int32_t index, int32_t *motor_pos, int32_t *cval, int32_t *pval) override; //
// virtual int32_t pipette_get_sensor_sample_data_num(int32_t *num) override;
// private:
// int32_t do_pipette_ctrl_init_device();
// int32_t do_pipette_ctrl_put_tip();
// int32_t do_pipette_ctrl_move_to_ul(int32_t ul);
// int32_t do_pipette_lld_prepare();
// int32_t do_pipette_lld(lld_mode_t mode, int32_t zdpos, int32_t c_threshold, int32_t p_threshold);
// int32_t do_pipette_aspirate(int32_t ul, int32_t zmotor_v);
// int32_t do_pipette_distribut(int32_t ul, int32_t zmotor_v);
// int32_t do_pipette_shake_up(int32_t ul, int32_t zmotor_v, int32_t times);
// private:
// int32_t befor_run();
// int32_t do_put_tip_before_run();
// int32_t after_run();
// bool check_when_run();
// private:
// int32_t read_pos_ul(int32_t *val);
// int32_t read_capactitance(int32_t *val);
// int32_t read_tip_state(int32_t *val);
// private:
// private:
// void push_snesor_sample_data(int32_t motor_pos, int32_t cap_val, int32_t pressure_val);
// };
// } // namespace iflytop

69
sdk/components/pipette_module/pipette_ctrl_module_v2.cpp

@ -33,7 +33,7 @@
#define THREAD_START_WORK(...) thread_start_work(__FUNCTION__, __VA_ARGS__)
#define PIPETTE_PREPARE_POS 800
#define PIPETTE_PREPARE_POS 400
#define LLD_PREPARE_DISTRIBUT_POS 100
#define LLF_DPOS 1000
#define ASPIRATE_POS 100
@ -340,6 +340,7 @@ int32_t PipetteModuleV2::pipette_lld_prepare() {
DO_IN_THREAD(m_smtp2.pump_move_to_ul(m_cfg.pump_vmax, m_cfg.lld_prepare_pos)); // 移动到中点
pump_waitfor_stop();
m_state.lld_prepared = 1;
m_state.load_val_ul = 0;
});
return 0;
}
@ -363,14 +364,17 @@ int32_t PipetteModuleV2::pipette_aspirate_prepare() {
m_state.aspirate_cfg_eigen_time = 0;
m_state.aspirate_cfg_p_thre = 0;
m_state.aspirate_cfg_llf_zm_rpm = 0;
int32_t nowpos = zm_get_now_pos();
int32_t bak = nowpos - 100;
m_state.load_val_ul = 0;
int32_t nowpos = zm_get_now_pos();
int32_t bak = nowpos - 100;
if (bak < 0) bak = 0;
zm_move_to(bak, m_cfg.zm_default_velocity);
zm_waitfor_stop();
DO_IN_THREAD(m_smtp2.pump_move_to_ul(m_cfg.pump_vmax, 0));
pump_waitfor_stop();
DO_IN_THREAD(m_smtp2.pump_move_to_ul(m_cfg.pump_vmax, ASPIRATE_POS));
pump_waitfor_stop();
@ -413,19 +417,20 @@ int32_t PipetteModuleV2::pipette_aspirate(int32_t ul) {
THREAD_START_WORK([this, ul]() {
m_state.lld_prepared = 0;
DO_IN_THREAD(m_smtp2.pump_move_to_ul(m_cfg.pump_vmax, ASPIRATE_POS));
int dul = m_state.load_val_ul + ul <= 0 ? -m_state.load_val_ul : ul;
DO_IN_THREAD(m_smtp2.pump_aspirate(m_cfg.aspirate_pump_vel, dul));
int32_t dpos = ul > 0 ? m_cfg.aspirate_zmotor_max_move_by : -m_cfg.aspirate_zmotor_max_move_by;
if (m_state.aspirate_cfg_llf_zm_rpm != 0) zm_move_by(dpos, m_state.aspirate_cfg_llf_zm_rpm);
pump_waitfor_stop();
if (ul > 0) {
// zmotor and pump move
if (m_state.aspirate_cfg_llf_zm_rpm != 0) zm_move_by(m_cfg.aspirate_zmotor_max_move_by, m_state.aspirate_cfg_llf_zm_rpm);
DO_IN_THREAD(m_smtp2.pump_aspirate(m_cfg.aspirate_pump_vel, ul));
} else {
if (m_state.aspirate_cfg_llf_zm_rpm != 0) zm_move_by(-m_cfg.aspirate_zmotor_max_move_by, m_state.aspirate_cfg_llf_zm_rpm);
DO_IN_THREAD(m_smtp2.pump_distribut(m_cfg.aspirate_pump_vel, ul));
// 全部排空时,多分配10ul去掉挂液
if ((m_state.load_val_ul - dul) == 0) {
m_smtp2.pump_aspirate(m_cfg.aspirate_pump_vel, -10);
pump_waitfor_stop();
}
// wait...
pump_waitfor_stop();
// stop
m_zm->stop();
m_smtp2.pump_stop();
@ -445,11 +450,15 @@ int32_t PipetteModuleV2::pipette_aspirate_and_verify(int32_t ul) {
m_state.lld_prepared = 0;
// zmotor and pump move
if (m_state.aspirate_cfg_llf_zm_rpm != 0) zm_move_by(m_cfg.aspirate_zmotor_max_move_by, m_state.aspirate_cfg_llf_zm_rpm);
DO_IN_THREAD(m_smtp2.pump_aspirate_and_verify(m_cfg.aspirate_pump_vel, ul, //
int dul = m_state.load_val_ul + ul <= 0 ? -m_state.load_val_ul : ul;
DO_IN_THREAD(m_smtp2.pump_aspirate_and_verify(m_cfg.aspirate_pump_vel, dul, //
m_state.aspirate_cfg_p_thre, //
m_state.aspirate_cfg_eigen_time, //
m_state.aspirate_cfg_tolerance));
int32_t dpos = ul > 0 ? m_cfg.aspirate_zmotor_max_move_by : -m_cfg.aspirate_zmotor_max_move_by;
if (m_state.aspirate_cfg_llf_zm_rpm != 0) zm_move_by(dpos, m_state.aspirate_cfg_llf_zm_rpm);
// wait...
pump_waitfor_stop();
// stop
@ -463,6 +472,16 @@ int32_t PipetteModuleV2::pipette_aspirate_and_verify(int32_t ul) {
}
int32_t PipetteModuleV2::pipette_shake_up(int32_t ul, int32_t times) {
if (m_state.load_val_ul != 0) {
ZLOGE(TAG, "pipette_shake_up fail, load_val_ul %d != 0", m_state.load_val_ul);
return err::kpipette_error_pump_load_val_is_not_empty;
}
if (m_state.load_val_ul + ul > m_cfg.limit_ul) {
ZLOGE(TAG, "pipette_aspirate %d fail , final ul (%d + %d)> limit ul %d", ul, m_state.load_val_ul, ul, m_cfg.limit_ul);
return err::kparam_out_of_range;
}
THREAD_START_WORK([this, ul, times]() {
//
int32_t dpos = 0;
@ -481,7 +500,7 @@ int32_t PipetteModuleV2::pipette_shake_up(int32_t ul, int32_t times) {
for (int i = 0; i < times - 1; i++) {
// distribute
if (m_state.aspirate_cfg_llf_zm_rpm) zm_move_to(startpos, m_state.aspirate_cfg_llf_zm_rpm);
DO_IN_THREAD(m_smtp2.pump_distribut(m_cfg.aspirate_pump_vel, ul));
DO_IN_THREAD(m_smtp2.pump_aspirate(m_cfg.aspirate_pump_vel, -ul));
pump_waitfor_stop();
zm_waitfor_stop();
@ -494,7 +513,7 @@ int32_t PipetteModuleV2::pipette_shake_up(int32_t ul, int32_t times) {
// final distribute
if (m_state.aspirate_cfg_llf_zm_rpm) zm_move_to(startpos, m_state.aspirate_cfg_llf_zm_rpm);
DO_IN_THREAD(m_smtp2.pump_distribut(m_cfg.aspirate_pump_vel, ul));
DO_IN_THREAD(m_smtp2.pump_aspirate(m_cfg.aspirate_pump_vel, -ul));
pump_waitfor_stop();
zm_waitfor_stop();
});
@ -621,7 +640,7 @@ int32_t PipetteModuleV2::do_pipette_lld(bool recorddata, int32_t lldtype /*kclld
// 先分配一点体积,消除一些误差。
ZLOGI(TAG, "start lld before distribut %d ul", m_cfg.lld_prepare_pre_distribut_ul);
DO_IN_THREAD(m_smtp2.pump_distribut(m_cfg.pump_vmax, m_cfg.lld_prepare_pre_distribut_ul));
DO_IN_THREAD(m_smtp2.pump_aspirate(m_cfg.pump_vmax, -m_cfg.lld_prepare_pre_distribut_ul));
pump_waitfor_stop();
ZLOGI(TAG, "lld before distribut ok");
@ -949,8 +968,8 @@ void PipetteModuleV2::thread_start_work(const char *fnname, function<void()> fn)
m_thread.start([this, fnname, fn]() {
osDelay(1);
ZLOGI(TAG, "start work -> %s", fnname);
int32_t pump_before_pos_ul;
int32_t pump_after_pos_ul;
// int32_t pump_before_pos_ul;
// int32_t pump_after_pos_ul;
// clear some state
m_state.dul = 0;
@ -959,7 +978,7 @@ void PipetteModuleV2::thread_start_work(const char *fnname, function<void()> fn)
try {
// before do
int32_t startpos = zm_get_now_pos();
DO_IN_THREAD(m_smtp2.pump_get_motor_pos_ul(&pump_before_pos_ul));
// DO_IN_THREAD(m_smtp2.pump_get_motor_pos_ul(&pump_before_pos_ul));
// do fn
if (fn) fn();
@ -968,10 +987,10 @@ void PipetteModuleV2::thread_start_work(const char *fnname, function<void()> fn)
m_smtp2.pump_stop();
// after do
DO_IN_THREAD(m_smtp2.pump_get_motor_pos_ul(&pump_after_pos_ul));
// DO_IN_THREAD(m_smtp2.pump_get_motor_pos_ul(&pump_after_pos_ul));
int32_t endpos = zm_get_now_pos();
m_state.dul = pump_after_pos_ul - pump_before_pos_ul;
m_state.dpos = endpos - startpos;
// m_state.dul = pump_after_pos_ul - pump_before_pos_ul;
m_state.dpos = endpos - startpos;
} catch (const zapp_thread_stoped_exception &e) { // break by usr
ZLOGI(TAG, "break by usr");

27
sdk/components/sensors/smtp2_v2/smtp2_v2.cpp

@ -48,8 +48,6 @@ int32_t SMTP2V2::pump_get_state_as_int(int32_t state_index, int32_t* val) {
return err::ksucc;
}
int32_t SMTP2V2::pump_get_capacitance(int32_t* capacitance) { return pump_get_state_as_int(kstate_capacitance, capacitance); }
int32_t SMTP2V2::pump_get_pressure(int32_t* pressure) { //
return pump_get_state_as_int(kstate_pressure_ad, pressure);
@ -121,6 +119,18 @@ int32_t SMTP2V2::pump_aspirate(int32_t v, int32_t ul) {
if (targetnl < 0) targetnl = 0;
return pump_move_to_nl(v, targetnl);
}
// int32_t SMTP2V2::pump_distribut(int32_t v, int32_t ul) {
// ZLOGI(TAG, "pump_distribut %d", ul);
// int32_t nownl = 0;
// int32_t ret = pump_get_state_as_int(kstate_pump_pos_nl, &nownl);
// if (ret != 0) return ret;
// int targetnl = nownl - ul * 1000;
// if (targetnl < 0) targetnl = 0;
// return pump_move_to_nl(v, targetnl);
// }
int32_t SMTP2V2::pump_aspirate_and_verify(int32_t v, int32_t ul, int32_t eigen_time, int32_t p_thre, int32_t tolerance) {
/**
@ -223,19 +233,6 @@ int32_t SMTP2V2::pump_aspirate_and_verf(int32_t v, int32_t ul, int32_t p_thro, i
}
#endif
int32_t SMTP2V2::pump_distribut(int32_t v, int32_t ul) {
ZLOGI(TAG, "pump_distribut %d", ul);
int32_t nownl = 0;
int32_t ret = pump_get_state_as_int(kstate_pump_pos_nl, &nownl);
if (ret != 0) return ret;
int targetnl = nownl - ul * 1000;
if (targetnl < 0) targetnl = 0;
return pump_move_to_nl(v, targetnl);
}
int32_t SMTP2V2::pump_distribut_plld(int32_t pumpv, int32_t pressure_threshold) {
// M100V100t50,0R
ZLOGI(TAG, "pump_distribut_plld %d %d", pumpv, pressure_threshold);

2
sdk/components/sensors/smtp2_v2/smtp2_v2.hpp

@ -199,7 +199,7 @@ class SMTP2V2 {
int32_t pump_aspirate(int32_t v, int32_t ul);
int32_t pump_aspirate_and_verify(int32_t v, int32_t ul, int32_t eigen_time, int32_t p_thre, int32_t tolerance);
int32_t pump_distribut(int32_t v, int32_t ul);
// int32_t pump_distribut(int32_t v, int32_t ul);
int32_t pump_aspirate_infer_pressure(int32_t v, int32_t ul);
int32_t pump_get_infer_pressure(int32_t* p_thre);

Loading…
Cancel
Save