From d5cb96ba038dc8126fc0103274a324b6663829a7 Mon Sep 17 00:00:00 2001 From: zhaohe Date: Wed, 12 Jun 2024 10:56:37 +0800 Subject: [PATCH] update --- components/pipette_module/pipette_ctrl_module_v2.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/components/pipette_module/pipette_ctrl_module_v2.cpp b/components/pipette_module/pipette_ctrl_module_v2.cpp index 1b6390f..47e1971 100644 --- a/components/pipette_module/pipette_ctrl_module_v2.cpp +++ b/components/pipette_module/pipette_ctrl_module_v2.cpp @@ -244,7 +244,13 @@ int32_t PipetteModule::do_pipette_clld_test(int32_t zdpos) { int32_t PipetteModule::do_pipette_plld_test(int32_t zdpos) { return 0; } int32_t PipetteModule::pipette_enable_zmotor(int32_t enable) { return m_zmotor->step_motor_enable(enable); } -int32_t PipetteModule::pipette_get_sensor_sample_data(int32_t index, int32_t *motor_pos, int32_t *cval, int32_t *pval) { return 0; } +int32_t PipetteModule::pipette_get_sensor_sample_data(int32_t index, int32_t *motor_pos, int32_t *cval, int32_t *pval) { + if (index > capturedata_num) return err::kparam_out_of_range; + *motor_pos = capturedata_buf[index].motor_pos; + *cval = capturedata_buf[index].cap_val; + *pval = capturedata_buf[index].pressure_val; + return 0; +} int32_t PipetteModule::pipette_get_sensor_sample_data_num(int32_t *num) { *num = capturedata_num; return 0;