diff --git a/.settings/language.settings.xml b/.settings/language.settings.xml index adcba3c..e1e42a8 100644 --- a/.settings/language.settings.xml +++ b/.settings/language.settings.xml @@ -5,7 +5,7 @@ - + @@ -16,7 +16,7 @@ - + diff --git a/a8000_protocol b/a8000_protocol index ba614e6..5d083e1 160000 --- a/a8000_protocol +++ b/a8000_protocol @@ -1 +1 @@ -Subproject commit ba614e601a4ec166fa2d6511f2fe0b4c14f60f85 +Subproject commit 5d083e13b654460d9de05192ce9446c9b1d62069 diff --git a/build.bat b/build.bat new file mode 100644 index 0000000..724d072 --- /dev/null +++ b/build.bat @@ -0,0 +1 @@ +C:\ST\STM32CubeIDE_1.15.0\STM32CubeIDE\headless-build.bat -data ../ -build a8000_subboard/Debug \ No newline at end of file diff --git a/flush.bat b/flush.bat new file mode 100644 index 0000000..5fff247 --- /dev/null +++ b/flush.bat @@ -0,0 +1,2 @@ +C:\ST\STM32CubeIDE_1.15.0\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.cubeprogrammer.win32_2.1.200.202311302303\tools\bin\STM32_Programmer_CLI.exe ^ +-c port=SWD -w Debug\a8000_subboard.hex -rst \ No newline at end of file diff --git a/sdk/chip/basic/logger.hpp b/sdk/chip/basic/logger.hpp index 5e4d791..b1d262f 100644 --- a/sdk/chip/basic/logger.hpp +++ b/sdk/chip/basic/logger.hpp @@ -9,30 +9,30 @@ extern "C" { extern bool g_enable_log; #define ZEARLY_LOG_RELEASE(TAG, fmt, ...) \ if (g_enable_log) { \ - zchip_log(TAG "" fmt "\n", ##__VA_ARGS__); \ + zchip_log(TAG "" fmt "\r\n", ##__VA_ARGS__); \ } #define ZEARLY_LOGI(TAG, fmt, ...) \ if (g_enable_log) { \ - zchip_log("%08lu INFO [%-8s] " fmt "\n", zchip_clock_get_ticket(), TAG, ##__VA_ARGS__); \ + zchip_log("%08lu INFO [%-8s] " fmt "\r\n", zchip_clock_get_ticket(), TAG, ##__VA_ARGS__); \ } #define ZEARLY_LOGD(TAG, fmt, ...) \ if (g_enable_log) { \ - zchip_log("%08lu DEBU [%-8s] " fmt "\n", zchip_clock_get_ticket(), TAG, ##__VA_ARGS__); \ + zchip_log("%08lu DEBU [%-8s] " fmt "\r\n", zchip_clock_get_ticket(), TAG, ##__VA_ARGS__); \ } #define ZEARLY_LOGE(TAG, fmt, ...) \ if (g_enable_log) { \ - zchip_log("%08lu ERRO [%-8s] " fmt "\n", zchip_clock_get_ticket(), TAG, ##__VA_ARGS__); \ + zchip_log("%08lu ERRO [%-8s] " fmt "\r\n", zchip_clock_get_ticket(), TAG, ##__VA_ARGS__); \ } #define ZEARLY_LOGW(TAG, fmt, ...) \ if (g_enable_log) { \ - zchip_log("%08lu WARN [%-8s] " fmt "\n", zchip_clock_get_ticket(), TAG, ##__VA_ARGS__); \ + zchip_log("%08lu WARN [%-8s] " fmt "\r\n", zchip_clock_get_ticket(), TAG, ##__VA_ARGS__); \ } #define ZEARLY_ASSERT(cond) \ if (!(cond)) { \ while (1) { \ - zchip_log("ASSERT: %s [%s:%d]\n", #cond, __FILE__, __LINE__); \ + zchip_log("ASSERT: %s [%s:%d]\r\n", #cond, __FILE__, __LINE__); \ zchip_clock_early_delayus(1000 * 1000); \ } \ } diff --git a/sdk/components/pipette_module/pipette_ctrl_module_v2.cpp b/sdk/components/pipette_module/pipette_ctrl_module_v2.cpp index 8abe480..0c97de0 100644 --- a/sdk/components/pipette_module/pipette_ctrl_module_v2.cpp +++ b/sdk/components/pipette_module/pipette_ctrl_module_v2.cpp @@ -66,22 +66,24 @@ void PipetteModuleV2::initialize(int32_t id, config_t *config, hardward_config_t m_zm->getGState(); // 读取状态,清空下复位标识 module_active_cfg(); + + // m_smtp2.dumpparam(); } void PipetteModuleV2::create_default_cfg(config_t *defaultcfg) { // defaultcfg->limit_ul = 250; - defaultcfg->pump_acc = 18; - defaultcfg->pump_dec = 18; - defaultcfg->pump_vstart = 200; - defaultcfg->pump_vstop = 300; - defaultcfg->aspirate_pump_vel = 500; // - defaultcfg->distribu_pump_vel = 1000; // - defaultcfg->pump_vmax = 1000; // 1000已经是最大速度 - defaultcfg->lld_pump_vel = 30; // lld推荐使用速度为50->200,这里 - defaultcfg->lld_motor_vel_rpm = 80; - defaultcfg->lld_detect_period_ms = 1; // 100ms - defaultcfg->lld_prepare_pos = PIPETTE_PREPARE_POS; - defaultcfg->lld_prepare_pre_distribut_ul = LLD_PREPARE_DISTRIBUT_POS; + // defaultcfg->pump_acc = 18; + // defaultcfg->pump_dec = 18; + // defaultcfg->pump_vstart = 200; + // defaultcfg->pump_vstop = 300; + // defaultcfg->aspirate_pump_vel = 500; // + // defaultcfg->distribu_pump_vel = 1000; // + // defaultcfg->pump_vmax = 8000; // 8000已经是最大速度 + // defaultcfg->lld_pump_vel = 30; // lld推荐使用速度为50->200,这里 + // defaultcfg->lld_motor_vel_rpm = 80; + // defaultcfg->lld_detect_period_ms = 1; // 100ms + // defaultcfg->lld_prepare_pos = PIPETTE_PREPARE_POS; + // defaultcfg->lld_prepare_pre_distribut_ul = LLD_PREPARE_DISTRIBUT_POS; defaultcfg->zm_one_circle_pulse = 10000; defaultcfg->zm_one_circle_pulse_denominator = 1; @@ -101,9 +103,9 @@ int32_t PipetteModuleV2::module_stop() { return 0; } int32_t PipetteModuleV2::module_active_cfg() { - m_smtp2.pump_set_acc_and_dec(m_cfg.pump_acc, m_cfg.pump_dec); - m_smtp2.pump_set_vstart(m_cfg.pump_vstart); - m_smtp2.pump_set_vstop(m_cfg.pump_vstop); + // m_smtp2.pump_set_acc_and_dec(m_cfg.pump_acc, m_cfg.pump_dec); + // m_smtp2.pump_set_vstart(m_cfg.pump_vstart); + // m_smtp2.pump_set_vstop(m_cfg.pump_vstop); m_zm->enable(false); m_zm->setIHOLD_IRUN(m_cfg.zm_ihold, m_cfg.zm_irun, m_cfg.zm_iholddelay); @@ -155,21 +157,6 @@ int32_t PipetteModuleV2::module_xxx_reg_impl(int32_t param_id, bool read, int32_ /*********************************************************************************************************************** * CFG * ***********************************************************************************************************************/ - // XXX_CFG_REG(limit_ul); - XXX_CFG_REG(pump_acc); - XXX_CFG_REG(pump_dec); - XXX_CFG_REG(pump_vstart); - XXX_CFG_REG(pump_vstop); - XXX_CFG_REG(pump_vmax); - XXX_CFG_REG(aspirate_pump_vel); - XXX_CFG_REG(lld_pump_vel); - XXX_CFG_REG(lld_motor_vel_rpm); - XXX_CFG_REG(lld_detect_period_ms); - XXX_CFG_REG(lld_prepare_pos); - XXX_CFG_REG(lld_prepare_pre_distribut_ul); - XXX_CFG_REG(lld_enable_record_data); - XXX_CFG_REG(distribu_pump_vel); - XXX_CFG_REG(zm_shaft); XXX_CFG_REG(zm_one_circle_pulse); XXX_CFG_REG(zm_one_circle_pulse_denominator); @@ -312,20 +299,84 @@ int32_t PipetteModuleV2::pipette_zmotor_move_to_zero_point_quick() { return 0; } +/*********************************************************************************************************************** + * PUMP * + ***********************************************************************************************************************/ +int32_t PipetteModuleV2::liquid_operation_clear_params() { + memset(&liquid_operation_runparam, 0, sizeof(liquid_operation_runparam)); + return 0; +} +/** + * @brief 设置泵机液体操作-枪运动参数 + * + * @param acc 1->20 deafault 14 datasheet:page-29 + * @param dec 1->20 deafault 14 datasheet:page-29 + * @param vstart 0->1000 default 0 + * @param vstop 0->1000 default 900 + * @param vmax 0->8000 default 1400 + * @return int32_t + */ +int32_t PipetteModuleV2::liquid_operation_set_gun_runparams(int32_t acc, int32_t dec, int32_t vstart, int32_t vstop, int32_t vmax) { + liquid_operation_runparam.pump_acc = acc; + liquid_operation_runparam.pump_dec = dec; + liquid_operation_runparam.pump_vstart = vstart; + liquid_operation_runparam.pump_vstop = vstop; + liquid_operation_runparam.pump_vmax = vmax; + return 0; +} + +/** + * @brief 设置泵机液体操作-枪运动参数 + * + * @param posmin z轴运动范围最小值 + * @param posmax z轴运动范围最大值 + * @param vmax z轴运动最大速度 + * @return int32_t + */ +int32_t PipetteModuleV2::liquid_operation_set_zmotor_runparams(int32_t posmin, int32_t posmax, int32_t vmax) { + liquid_operation_runparam.zmotor_posmin = posmin; + liquid_operation_runparam.zmotor_posmax = posmax; + liquid_operation_runparam.zmotor_vmax = vmax; + return 0; +} + +int32_t PipetteModuleV2::liquid_operation_enable_lld_record() { + liquid_operation_runparam.lld_enable_record_data = 1; + return 0; +} +/** + * @brief 刷新液体操作参数 + * + * @return int32_t + */ +int32_t PipetteModuleV2::liquid_operation_fresh_params() { + ZLOGI(TAG, "liquid_operation_runparam:"); + ZLOGI(TAG, "pump_acc :%d", liquid_operation_runparam.pump_acc); + ZLOGI(TAG, "pump_dec :%d", liquid_operation_runparam.pump_dec); + ZLOGI(TAG, "pump_vstart :%d", liquid_operation_runparam.pump_vstart); + ZLOGI(TAG, "pump_vstop :%d", liquid_operation_runparam.pump_vstop); + ZLOGI(TAG, "pump_vmax :%d", liquid_operation_runparam.pump_vmax); + ZLOGI(TAG, "zmotor_posmin :%d", liquid_operation_runparam.zmotor_posmin); + ZLOGI(TAG, "zmotor_posmax :%d", liquid_operation_runparam.zmotor_posmax); + ZLOGI(TAG, "zmotor_vmax :%d", liquid_operation_runparam.zmotor_vmax); + ZLOGI(TAG, "lld_enable_record_data :%d", liquid_operation_runparam.lld_enable_record_data); + + DO(m_smtp2.pump_set_acc_and_dec(liquid_operation_runparam.pump_acc, liquid_operation_runparam.pump_dec)); + DO(m_smtp2.pump_set_vstart(liquid_operation_runparam.pump_vstart)); + DO(m_smtp2.pump_set_vstop(liquid_operation_runparam.pump_vstop)); + DO(m_smtp2.pump_set_io1_mode(0)); // lld输入高 + DO(m_smtp2.pump_set_io2_mode(0)); // 通用输入 + DO(m_smtp2.pump_set_tip_size(1)); // 250ul + DO(m_smtp2.pump_enable_temp_compensation(0)); // 关闭温度补偿 + DO(m_smtp2.write_cmd("/1K0R\r")); // 设置背隙为0 + + return 0; +} + int32_t PipetteModuleV2::pipette_init_device() { THREAD_START_WORK([this]() { - DO_IN_THREAD(m_smtp2.pump_init(m_cfg.pump_vmax)); + DO_IN_THREAD(m_smtp2.pump_init(liquid_operation_runparam.pump_vmax)); pump_waitfor_stop(); - - DO_IN_THREAD(m_smtp2.pump_set_io1_mode(0)); // lld输入高 - DO_IN_THREAD(m_smtp2.pump_set_io2_mode(0)); // 通用输入 - DO_IN_THREAD(m_smtp2.pump_set_tip_size(1)); // 250ul - DO_IN_THREAD(m_smtp2.pump_enable_temp_compensation(0)); // 温度补偿 - - // - // m_state.load_val_ul = 0; - // m_state.lld_prepared = 0; - m_state.pipette_is_inited = 1; }); return 0; } @@ -333,14 +384,14 @@ int32_t PipetteModuleV2::pipette_init_device() { int32_t PipetteModuleV2::pipette_put_tip() { THREAD_START_WORK([this]() { DO_IN_THREAD(m_smtp2.pump_put_tip()); - // m_state.lld_prepared = 0; pump_waitfor_stop(); }); return 0; } -int32_t PipetteModuleV2::pipette_pump_move_to(int32_t pumpv, int32_t nl) { - THREAD_START_WORK([this, pumpv, nl]() { +int32_t PipetteModuleV2::pipette_pump_move_to(int32_t nl) { + THREAD_START_WORK([this, nl]() { + int32_t pumpv = liquid_operation_runparam.pump_vmax; DO_IN_THREAD(m_smtp2.pump_move_to_nl(pumpv, nl)); pump_waitfor_stop(); m_smtp2.pump_stop(); @@ -348,7 +399,7 @@ int32_t PipetteModuleV2::pipette_pump_move_to(int32_t pumpv, int32_t nl) { return 0; } -int32_t PipetteModuleV2::pipette_lld(int32_t lldtype, int32_t maxzpos, int32_t c_threshold, int32_t p_threshold) { +int32_t PipetteModuleV2::pipette_lld(int32_t lldtype, int32_t c_threshold, int32_t p_threshold) { // 检查泵机是否初始化过 if (lldtype < 0 || lldtype > klldtypemax) { return err::kparam_out_of_range; @@ -364,17 +415,12 @@ int32_t PipetteModuleV2::pipette_lld(int32_t lldtype, int32_t maxzpos, int32_t c return err::kpipette_error_no_tip_when_lld; } - int32_t recorddata = m_cfg.lld_enable_record_data; - THREAD_START_WORK([this, recorddata, lldtype, maxzpos, c_threshold, p_threshold]() { // - int32_t start_capacitance = 0; // 启动时电容数值 - int32_t start_pressure = 0; // 启动时压力数值 - int32_t start_motor_pos = 0; // 启动时电机位置 + int32_t recorddata = liquid_operation_runparam.lld_enable_record_data; + thread_start_work(__FUNCTION__, [this, recorddata, lldtype, c_threshold, p_threshold]() { // + int32_t start_capacitance = 0; // 启动时电容数值 + int32_t start_pressure = 0; // 启动时压力数值 + int32_t start_motor_pos = 0; // 启动时电机位置 - // 1. 泵机移动到0位 - DO_IN_THREAD(m_smtp2.pump_distribut_all(m_cfg.pump_vmax)); - pump_waitfor_stop(); - - // 2. 读取初值 DO_IN_THREAD(m_smtp2.pump_get_capacitance(&start_capacitance)); DO_IN_THREAD(m_smtp2.pump_get_pressure(&start_pressure)); start_motor_pos = m_zm->getXACTUAL(); @@ -383,10 +429,10 @@ int32_t PipetteModuleV2::pipette_lld(int32_t lldtype, int32_t maxzpos, int32_t c if (lldtype == kclld) { DO_IN_THREAD(m_smtp2.pump_clld(c_threshold)); } else if (lldtype == kplld) { - DO_IN_THREAD(m_smtp2.pump_distribut_plld(m_cfg.lld_pump_vel, p_threshold)); + DO_IN_THREAD(m_smtp2.pump_aspirate_plld(liquid_operation_runparam.pump_vmax, p_threshold)); } osDelay(110); - zm_move_to(maxzpos, m_cfg.lld_motor_vel_rpm); + zm_move_to(liquid_operation_runparam.zmotor_posmax, liquid_operation_runparam.zmotor_vmax); while (true) { bool motorstoped = false; @@ -408,7 +454,7 @@ int32_t PipetteModuleV2::pipette_lld(int32_t lldtype, int32_t maxzpos, int32_t c if (lldtype == kclld) { DO_IN_THREAD(m_smtp2.pump_clld_get_state(&detect_liquid)); } else if (lldtype == kplld) { - DO_IN_THREAD(m_smtp2.pump_distribut_plld_get_state(&detect_liquid)); + DO_IN_THREAD(m_smtp2.pump_aspirate_plld_get_state(&detect_liquid)); } // 探测到液面 @@ -429,7 +475,7 @@ int32_t PipetteModuleV2::pipette_lld(int32_t lldtype, int32_t maxzpos, int32_t c } if (recorddata) push_snesor_sample_data(motorpos, capacitance, pressure); - m_thread.sleep(m_cfg.lld_detect_period_ms); + m_thread.sleep(2); } }); @@ -441,14 +487,18 @@ int32_t PipetteModuleV2::pipette_lld_is_detect_liquid(int32_t *detect) { return 0; } -int32_t PipetteModuleV2::pipette_aspirate(int32_t llfrpm, int32_t llftpos, int32_t pumpv, int32_t nl) { +int32_t PipetteModuleV2::pipette_aspirate(int32_t nl) { // pipette_aspirate if (nl < 0) { ZLOGE(TAG, "pipette_aspirate %d fail , ul < 0", nl); return err::kparam_out_of_range; } - THREAD_START_WORK([this, llfrpm, llftpos, pumpv, nl]() { + THREAD_START_WORK([this, nl]() { + int32_t llfrpm = liquid_operation_runparam.zmotor_vmax; + int32_t llftpos = liquid_operation_runparam.zmotor_posmax; + int32_t pumpv = liquid_operation_runparam.pump_vmax; + DO_IN_THREAD(m_smtp2.pump_aspirate_nl(pumpv, nl)); if (llfrpm != 0) zm_move_to(llftpos, llfrpm); @@ -460,17 +510,20 @@ int32_t PipetteModuleV2::pipette_aspirate(int32_t llfrpm, int32_t llftpos, int32 }); return 0; } -int32_t PipetteModuleV2::pipette_distribu(int32_t llfrpm, int32_t pumpv, int32_t nl) { +int32_t PipetteModuleV2::pipette_distribu(int32_t nl) { // pipette_aspirate if (nl < 0) { ZLOGE(TAG, "pipette_distribu %d fail , nl < 0", nl); return err::kparam_out_of_range; } - THREAD_START_WORK([this, llfrpm, pumpv, nl]() { + THREAD_START_WORK([this, nl]() { + int32_t llfrpm = liquid_operation_runparam.zmotor_vmax; + int32_t pumpv = liquid_operation_runparam.pump_vmax; + DO_IN_THREAD(m_smtp2.pump_aspirate_nl(pumpv, -nl)); - if (llfrpm != 0) zm_move_to(0, llfrpm); + if (llfrpm != 0) zm_move_to(liquid_operation_runparam.zmotor_posmin, llfrpm); pump_waitfor_stop(); @@ -479,14 +532,18 @@ int32_t PipetteModuleV2::pipette_distribu(int32_t llfrpm, int32_t pumpv, int32_t }); return 0; } -int32_t PipetteModuleV2::pipette_shake_up(int32_t llfrpm, int32_t maxzpos, int32_t pumpv, int32_t nl, int32_t times) { - THREAD_START_WORK([this, llfrpm, maxzpos, pumpv, nl, times]() { +int32_t PipetteModuleV2::pipette_shake_up(int32_t nl, int32_t times) { + thread_start_work(__FUNCTION__, [this, nl, times]() { // int32_t dpos = 0; int32_t startpos = m_zm->getXACTUAL(); int32_t endpos = 0; + int32_t llfrpm = liquid_operation_runparam.zmotor_vmax; + int32_t maxzpos = liquid_operation_runparam.zmotor_posmax; + int32_t pumpv = liquid_operation_runparam.pump_vmax; + if (llfrpm != 0) zm_move_to(maxzpos, llfrpm); DO_IN_THREAD(m_smtp2.pump_aspirate_nl(pumpv, nl)); @@ -521,16 +578,8 @@ int32_t PipetteModuleV2::pipette_shake_up(int32_t llfrpm, int32_t maxzpos, int32 int32_t PipetteModuleV2::pipette_clear_hanging_liquid(int32_t repeat_times) { // llf_startz // llf_endz - THREAD_START_WORK([this, repeat_times]() { - for (int i = 0; i < repeat_times; i++) { - m_smtp2.pump_move_to_nl(m_cfg.pump_vmax, 0); - pump_waitfor_stop(); + thread_start_work(__FUNCTION__, [this, repeat_times]() { - m_smtp2.pump_move_to_nl(m_cfg.pump_vmax, 100 * 1000); - pump_waitfor_stop(); - } - m_smtp2.pump_move_to_nl(m_cfg.pump_vmax, 0); - pump_waitfor_stop(); }); return 0; } @@ -591,104 +640,6 @@ void PipetteModuleV2::do_pipette_zmotor_move_to_zero_point_quick() { throw zapp_exception(err::kstep_motor_lost_step); } } -#if 0 -int32_t PipetteModuleV2::do_pipette_lld(bool recorddata, int32_t lldtype, int32_t startpos, int32_t zdpos, int32_t c_threshold, int32_t p_threshold) { - // 检查泵机是否初始化过 - - if (lldtype < 0 || lldtype > klldtypemax) { - return err::kparam_out_of_range; - } - - THREAD_START_WORK([this, recorddata, lldtype, startpos, zdpos, c_threshold, p_threshold]() { // - m_state.lld_prepared = 0; // 失效m_state.lld_prepared - - int32_t start_capacitance = 0; // 启动时电容数值 - int32_t start_pressure = 0; // 启动时压力数值 - int32_t start_motor_pos = 0; // 启动时电机位置 - - // 准备 - capturedata_num = 0; - - // 读取初值 - DO_IN_THREAD(m_smtp2.pump_get_capacitance(&start_capacitance)); - DO_IN_THREAD(m_smtp2.pump_get_pressure(&start_pressure)); - start_motor_pos = m_zm->getXACTUAL(); - - // 先分配一点体积,消除一些误差。 - ZLOGI(TAG, "start lld before distribut %d ul", 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"); - - ZLOGI(TAG, "start lld"); - - bool moveToStartPos = false; - - zm_move_to(startpos, m_cfg.zm_default_velocity); - osDelay(10); - if (lldtype == kclld) { - DO_IN_THREAD(m_smtp2.pump_clld(c_threshold)); - } else if (lldtype == kplld) { - DO_IN_THREAD(m_smtp2.pump_distribut_plld(m_cfg.lld_pump_vel, p_threshold)); - } else if (lldtype == kmixlld) { - DO_IN_THREAD(m_smtp2.pump_distribut_mlld(m_cfg.lld_pump_vel, c_threshold, p_threshold)); - } - - while (true) { - bool motorstoped = false; - int32_t motorerror = 0; - - int32_t motorpos = 0; - int32_t capacitance = 0; - int32_t pressure = 0; - - // 获取状态 - if (recorddata) { - DO_IN_THREAD(m_smtp2.pump_get_capacitance(&capacitance)); - DO_IN_THREAD(m_smtp2.pump_get_pressure(&pressure)); - motorpos = m_zm->getXACTUAL() - start_motor_pos; - } - - // 液面探测检测 - int32_t detect_liquid = 0; - if (lldtype == kclld) { - DO_IN_THREAD(m_smtp2.pump_clld_get_state(&detect_liquid)); - } else if (lldtype == kplld) { - DO_IN_THREAD(m_smtp2.pump_distribut_plld_get_state(&detect_liquid)); - } else if (lldtype == kmixlld) { - DO_IN_THREAD(m_smtp2.pump_distribut_mlld_get_state(&detect_liquid)); - } - - // 探测到液面 - if (detect_liquid == 1) { - ZLOGI(TAG, "detect liquid"); - m_state.detected_liquid = 1; - if (recorddata) push_snesor_sample_data(motorpos, capacitance, pressure); - break; - } - - // 电机停了也没有探测到液面 - if (m_zm->isStoped()) { - if (!moveToStartPos) { - zm_move_by(zdpos, m_cfg.lld_motor_vel_rpm); - moveToStartPos = true; - } else { - ZLOGI(TAG, "motorstoped,but not detect liquid"); - creg.module_errorcode = 0; - m_state.detected_liquid = 0; - if (recorddata) push_snesor_sample_data(motorpos, capacitance, pressure); - break; - } - } - - if (recorddata) push_snesor_sample_data(motorpos, capacitance, pressure); - m_thread.sleep(m_cfg.lld_detect_period_ms); - } - - }); - return 0; -} -#endif int32_t PipetteModuleV2::pipette_zmotor_read_zero_point_state(int32_t *state) { *state = zm0p_is_trigger(); diff --git a/sdk/components/pipette_module/pipette_ctrl_module_v2.hpp b/sdk/components/pipette_module/pipette_ctrl_module_v2.hpp index 94dd875..d6abc59 100644 --- a/sdk/components/pipette_module/pipette_ctrl_module_v2.hpp +++ b/sdk/components/pipette_module/pipette_ctrl_module_v2.hpp @@ -52,24 +52,6 @@ class PipetteModuleV2 : public ZIModule { } 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 distribu_pump_vel; // 吸吐泵机速度 - // int32_t aspirate_zmotor_max_move_by; // 吸液Z轴最大移动距离 //TODO add config index to set it - 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前,预分配位置 - int32_t lld_enable_record_data; // - - int32_t llf_area2rpm; // 液面跟随,电机运动速度和容器截面积比例关系 - int32_t zm_shaft; int32_t zm_one_circle_pulse; // int32_t zm_one_circle_pulse_denominator; // @@ -98,10 +80,24 @@ class PipetteModuleV2 : public ZIModule { } config_t; typedef struct { - int32_t enable; // 电机使能 - int32_t pipette_is_inited; // 泵机是否初始化 - int32_t dul; // 吸吐变化量 - int32_t detected_liquid; // 检测到液面 + int32_t pump_acc; + int32_t pump_dec; + int32_t pump_vstart; + int32_t pump_vstop; + int32_t pump_vmax; + + int32_t zmotor_posmin; + int32_t zmotor_posmax; + int32_t zmotor_vmax; + + int32_t lld_enable_record_data; + + } liquid_operation_runparam_t; + + typedef struct { + int32_t enable; // 电机使能 + int32_t dul; // 吸吐变化量 + int32_t detected_liquid; // 检测到液面 int32_t dpos; int32_t aspirate_cfg_p_thre; // 吸液操作验证,压力阈值,用来检测tip阻塞问题 @@ -121,15 +117,18 @@ class PipetteModuleV2 : public ZIModule { ZGPIO *m_zm0p = nullptr; TMC51X0 *m_zm = nullptr; - int32_t m_id = 0; - config_t m_cfg = {0}; - bool m_config_update = false; + int32_t m_id = 0; + config_t m_cfg = {0}; + + bool m_config_update = false; /*********************************************************************************************************************** * state * ***********************************************************************************************************************/ state_t m_state = {0}; + liquid_operation_runparam_t liquid_operation_runparam; + /*********************************************************************************************************************** * run_thread * ***********************************************************************************************************************/ @@ -169,15 +168,28 @@ class PipetteModuleV2 : public ZIModule { /*********************************************************************************************************************** * PUMP * ***********************************************************************************************************************/ + + /** + * @brief 复位泵机运行参数 + * + * @param enable + * @return int32_t + */ + virtual int32_t liquid_operation_clear_params(); + virtual int32_t liquid_operation_set_gun_runparams(int32_t acc, int32_t dec, int32_t vstart, int32_t vstop, int32_t vmax); + virtual int32_t liquid_operation_set_zmotor_runparams(int32_t posmin, int32_t posmax, int32_t vmax); + virtual int32_t liquid_operation_enable_lld_record(); + virtual int32_t liquid_operation_fresh_params(); + virtual int32_t pipette_init_device(); virtual int32_t pipette_put_tip(); - virtual int32_t pipette_pump_move_to(int32_t pumpv, int32_t ul); - virtual int32_t pipette_lld(int32_t lldtype, int32_t maxzpos, int32_t c_threshold, int32_t p_threshold); + virtual int32_t pipette_pump_move_to(int32_t ul); + virtual int32_t pipette_lld(int32_t lldtype, int32_t c_threshold, int32_t p_threshold); virtual int32_t pipette_lld_is_detect_liquid(int32_t *detect); - virtual int32_t pipette_aspirate(int32_t llfrpm, int32_t llftpos, int32_t pumpv, int32_t ul); - virtual int32_t pipette_distribu(int32_t llfrpm, int32_t pumpv, int32_t ul); - virtual int32_t pipette_shake_up(int32_t llfrpm, int32_t maxzpos, int32_t pumpv, int32_t ul, int32_t times); + virtual int32_t pipette_aspirate(int32_t nl); + virtual int32_t pipette_distribu(int32_t nl); + virtual int32_t pipette_shake_up(int32_t nl, int32_t times); virtual int32_t pipette_clear_hanging_liquid(int32_t repeat_times); /*********************************************************************************************************************** * READ_STATE * diff --git a/sdk/components/sensors/smtp2_v2/smtp2_v2.cpp b/sdk/components/sensors/smtp2_v2/smtp2_v2.cpp index ed06c80..8b00705 100644 --- a/sdk/components/sensors/smtp2_v2/smtp2_v2.cpp +++ b/sdk/components/sensors/smtp2_v2/smtp2_v2.cpp @@ -58,7 +58,6 @@ int32_t SMTP2V2::pump_get_pressure(int32_t* pressure) { // int32_t SMTP2V2::pump_get_tip_state(int32_t* tipison) { return pump_get_state_as_int(kstate_tip_state, tipison); } int32_t SMTP2V2::pump_get_nl(int32_t* nl) { - int32_t ret = pump_get_state_as_int(kstate_pump_pos_nl, nl); if (ret != 0) return ret; return ret; @@ -125,7 +124,6 @@ int32_t SMTP2V2::pump_aspirate_nl(int32_t v, int32_t nl) { } int32_t SMTP2V2::pump_distribut_nl(int32_t v, int32_t nl) { return pump_aspirate_nl(v, -nl); } -int32_t SMTP2V2::pump_distribut_all(int32_t v) { return pump_aspirate_nl(v, -1000 * 1000); } // int32_t SMTP2V2::pump_distribut(int32_t v, int32_t ul) { // ZLOGI(TAG, "pump_distribut %d", ul); @@ -241,14 +239,14 @@ int32_t SMTP2V2::pump_aspirate_and_verf(int32_t v, int32_t ul, int32_t p_thro, i } #endif -int32_t SMTP2V2::pump_distribut_plld(int32_t pumpv, int32_t pressure_threshold) { +int32_t SMTP2V2::pump_aspirate_plld(int32_t pumpv, int32_t pressure_threshold) { // M100V100t50,0R - ZLOGI(TAG, "pump_distribut_plld %d %d", pumpv, pressure_threshold); + ZLOGI(TAG, "pump_aspirate_plld %d %d", pumpv, pressure_threshold); // return runaction(true, "/1V%dt%d,0R\r", pumpv * 319, pressure_threshold); return runaction(true, "/1V%dt%d,1R\r", pumpv * 319, pressure_threshold); // 6.14.1 t,压力液面检测(pLLD),吸取或分配 } -int32_t SMTP2V2::pump_distribut_plld_get_state(int32_t* detected) { +int32_t SMTP2V2::pump_aspirate_plld_get_state(int32_t* detected) { int32_t isbusy = 0; int32_t ret = pump_get_state(&isbusy); if (isbusy != 0) { @@ -308,6 +306,24 @@ void SMTP2V2::getack(char* rx, int32_t* rxbufsize) { memcpy(rx, m_rxbuf, m_rxNum - 2); rx[*rxbufsize - 1] = 0; } + +void SMTP2V2::dumpparam() { + static char rxbuf[128]; + static int32_t rxbufsize = 0; + + // write_cmd("/1K0R\r"); + + // memset(rxbuf, 0, sizeof(rxbuf)); + // write_cmd("/1?4\r"); + // getack(rxbuf, &rxbufsize); + // ZLOGI(TAG, "K(r): %s", rxbuf); + + // memset(rxbuf, 0, sizeof(rxbuf)); + // write_cmd("/1?53\r"); + // getack(rxbuf, &rxbufsize); + // ZLOGI(TAG, "K(r): %s", rxbuf); +} + /*********************************************************************************************************************** * BASIC * ***********************************************************************************************************************/ diff --git a/sdk/components/sensors/smtp2_v2/smtp2_v2.hpp b/sdk/components/sensors/smtp2_v2/smtp2_v2.hpp index 2c01f10..e90441a 100644 --- a/sdk/components/sensors/smtp2_v2/smtp2_v2.hpp +++ b/sdk/components/sensors/smtp2_v2/smtp2_v2.hpp @@ -40,7 +40,6 @@ typedef enum { } cmd_t; typedef enum { - kcfg_pump_limit_ul = 1, // 最大行程(Tip尺寸) 1...3500 default:3143 kcfg_baudrate = 2, // 0:9600 1:38400 default:1 kcfg_communication_protocol = 3, @@ -158,18 +157,6 @@ class SMTP2V2 { bool pump_ping(); - /*********************************************************************************************************************** - * STATE * - ***********************************************************************************************************************/ - int32_t pump_get_state(int32_t* isbusy); - int32_t pump_get_capacitance(int32_t* capacitance); - int32_t pump_get_pressure(int32_t* pressure); - int32_t pump_get_tip_state(int32_t* tipison); - int32_t pump_get_nl(int32_t* nl); - - int32_t pump_get_state_as_int(int32_t state_index, int32_t* val); - - // pump_get_state_as_int(kstate_pump_pos_nl, &nownl); /*********************************************************************************************************************** * CONFIG * @@ -179,13 +166,24 @@ class SMTP2V2 { int32_t pump_set_vmax(int32_t vel); int32_t pump_set_acc_and_dec(int32_t acc, int32_t dec); int32_t pump_set_plld_start_delay(int32_t delay_ms); - int32_t pump_set_io1_mode(int32_t mode); // 0LLD输出高 1LLD输出低 2通用输出 int32_t pump_set_io2_mode(int32_t mode); // 0通用输入 1紧急制动 2Tip脱落输出高 3Tip脱落输出低 int32_t pump_set_tip_size(int32_t size); // Tip大小 0:1ml 1:200ul(max:250ul) 2:50ul(max:62ul) 3=20ul(max:40ul) int32_t pump_enable_temp_compensation(int32_t enable); // 0:关闭 1:开启 /*********************************************************************************************************************** + * STATE * + ***********************************************************************************************************************/ + int32_t pump_get_state(int32_t* isbusy); + int32_t pump_get_capacitance(int32_t* capacitance); + int32_t pump_get_pressure(int32_t* pressure); + int32_t pump_get_tip_state(int32_t* tipison); + int32_t pump_get_nl(int32_t* nl); + int32_t pump_get_state_as_int(int32_t state_index, int32_t* val); + + // pump_get_state_as_int(kstate_pump_pos_nl, &nownl); + + /*********************************************************************************************************************** * ACTION * ***********************************************************************************************************************/ int32_t pump_init(int32_t v); // 泵机初始化(归零) @@ -194,9 +192,8 @@ class SMTP2V2 { int32_t pump_put_tip(); // 丢弃TIP int32_t pump_move_to_nl(int32_t v, int32_t nl); // - - int32_t pump_distribut_plld(int32_t pumpv, int32_t pressure_threshold); // plld,分配探测 - int32_t pump_distribut_plld_get_state(int32_t* detected); + int32_t pump_aspirate_plld(int32_t pumpv, int32_t pressure_threshold); // plld,分配探测 + int32_t pump_aspirate_plld_get_state(int32_t* detected); int32_t pump_clld(int32_t c_threshold); // clld 0...130 int32_t pump_clld_get_state(int32_t* detected); @@ -206,11 +203,14 @@ class SMTP2V2 { int32_t pump_aspirate_nl(int32_t v, int32_t nl); int32_t pump_distribut_nl(int32_t v, int32_t nl); - int32_t pump_distribut_all(int32_t v); - + 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); + /*********************************************************************************************************************** + * infer * + ***********************************************************************************************************************/ + int32_t pump_aspirate_infer_pressure(int32_t v, int32_t ul); int32_t pump_get_infer_pressure(int32_t* p_thre); @@ -223,6 +223,8 @@ class SMTP2V2 { bool write_cmd(const char* cmd); void getack(char* rx, int32_t* rxbufsize); + void dumpparam(); + private: int32_t runaction(bool dump, const char* format, ...); int32_t _runaction(bool dump, const char* cmd); diff --git a/sdk/components/zcancmder/zcan_protocol_parser.cpp b/sdk/components/zcancmder/zcan_protocol_parser.cpp index 2f5f94f..593c0a2 100644 --- a/sdk/components/zcancmder/zcan_protocol_parser.cpp +++ b/sdk/components/zcancmder/zcan_protocol_parser.cpp @@ -74,26 +74,6 @@ void ZCanProtocolParser::initialize(IZCanReceiver* cancmder) { REGFN(code_scaner_get_result_length); REGFN(code_scaner_read_scaner_result); - // REGFN(pipette_ctrl_init_device); - // REGFN(pipette_ctrl_put_tip); - // REGFN(pipette_ctrl_move_to_ul); - // REGFN(pipette_lld_prepare); - // REGFN(pipette_plld); - // REGFN(pipette_clld); - // REGFN(pipette_mlld); - // REGFN(pipette_lld_is_detect_liquid); - // REGFN(pipette_aspirate); - // REGFN(pipette_distribut); - // REGFN(pipette_shake_up); - // REGFN(pipette_aspirate_llf); - // REGFN(pipette_distribut_llf); - // REGFN(pipette_shake_up_llf); - - // REGFN(pipette_enable_zmotor); - // REGFN(pipette_write_cmd_direct); - // REGFN(pipette_get_sensor_sample_data); - // REGFN(pipette_get_sensor_sample_data_num); - REGFN(temp_controler_start_hearting); REGFN(temp_controler_stop_hearting); REGFN(temp_controler_set_peltier_power_level); @@ -159,6 +139,12 @@ void ZCanProtocolParser::initialize(IZCanReceiver* cancmder) { REGFN(pipette_zmotor_move_by); REGFN(pipette_zmotor_move_to); + REGFN(liquid_operation_clear_params); + REGFN(liquid_operation_set_gun_runparams); + REGFN(liquid_operation_set_zmotor_runparams); + REGFN(liquid_operation_enable_lld_record); + REGFN(liquid_operation_fresh_params); + REGFN(pipette_init_device); REGFN(pipette_put_tip); REGFN(pipette_pump_move_to); @@ -861,6 +847,31 @@ int32_t ZCanProtocolParser::pipette_zmotor_move_to(cmdcontxt_t* cxt) { return module->pipette_zmotor_move_to(cxt->params[0]); } +int32_t ZCanProtocolParser::liquid_operation_clear_params(cmdcontxt_t* cxt) { + CHECK_AND_GET_MODULE(0); + return module->liquid_operation_clear_params(); +} + +int32_t ZCanProtocolParser::liquid_operation_set_gun_runparams(cmdcontxt_t* cxt) { + CHECK_AND_GET_MODULE(5); + return module->liquid_operation_set_gun_runparams(cxt->params[0], cxt->params[1], cxt->params[2], cxt->params[3], cxt->params[4]); +} + +int32_t ZCanProtocolParser::liquid_operation_set_zmotor_runparams(cmdcontxt_t* cxt) { + CHECK_AND_GET_MODULE(3); + return module->liquid_operation_set_zmotor_runparams(cxt->params[0], cxt->params[1], cxt->params[2]); +} + +int32_t ZCanProtocolParser::liquid_operation_enable_lld_record(cmdcontxt_t* cxt) { + CHECK_AND_GET_MODULE(0); + return module->liquid_operation_enable_lld_record(); +} + +int32_t ZCanProtocolParser::liquid_operation_fresh_params(cmdcontxt_t* cxt) { + CHECK_AND_GET_MODULE(0); + return module->liquid_operation_fresh_params(); +} + int32_t ZCanProtocolParser::pipette_init_device(cmdcontxt_t* cxt) { CHECK_AND_GET_MODULE(0); return module->pipette_init_device(); @@ -870,24 +881,24 @@ int32_t ZCanProtocolParser::pipette_put_tip(cmdcontxt_t* cxt) { return module->pipette_put_tip(); } int32_t ZCanProtocolParser::pipette_pump_move_to(cmdcontxt_t* cxt) { - CHECK_AND_GET_MODULE(2); - return module->pipette_pump_move_to(cxt->params[0], cxt->params[1]); + CHECK_AND_GET_MODULE(1); + return module->pipette_pump_move_to(cxt->params[0]); } int32_t ZCanProtocolParser::pipette_lld(cmdcontxt_t* cxt) { - CHECK_AND_GET_MODULE(4); - return module->pipette_lld(cxt->params[0], cxt->params[1], cxt->params[2], cxt->params[3]); + CHECK_AND_GET_MODULE(3); + return module->pipette_lld(cxt->params[0], cxt->params[1], cxt->params[2]); } int32_t ZCanProtocolParser::pipette_aspirate(cmdcontxt_t* cxt) { - CHECK_AND_GET_MODULE(4); - return module->pipette_aspirate(cxt->params[0], cxt->params[1], cxt->params[2], cxt->params[3]); + CHECK_AND_GET_MODULE(1); + return module->pipette_aspirate(cxt->params[0]); } int32_t ZCanProtocolParser::pipette_distribu(cmdcontxt_t* cxt) { - CHECK_AND_GET_MODULE(3); - return module->pipette_distribu(cxt->params[0], cxt->params[1], cxt->params[2]); + CHECK_AND_GET_MODULE(1); + return module->pipette_distribu(cxt->params[0]); } int32_t ZCanProtocolParser::pipette_shake_up(cmdcontxt_t* cxt) { - CHECK_AND_GET_MODULE(5); - return module->pipette_shake_up(cxt->params[0], cxt->params[1], cxt->params[2], cxt->params[3], cxt->params[4]); + CHECK_AND_GET_MODULE(2); + return module->pipette_shake_up(cxt->params[0], cxt->params[1]); } /*********************************************************************************************************************** diff --git a/sdk/components/zcancmder/zcan_protocol_parser.hpp b/sdk/components/zcancmder/zcan_protocol_parser.hpp index bc13bd4..674bf7b 100644 --- a/sdk/components/zcancmder/zcan_protocol_parser.hpp +++ b/sdk/components/zcancmder/zcan_protocol_parser.hpp @@ -173,6 +173,14 @@ class ZCanProtocolParser : public IZCanReceiverListener { CMDFN(pipette_zmotor_move_by); CMDFN(pipette_zmotor_move_to); + + + CMDFN(liquid_operation_clear_params); + CMDFN(liquid_operation_set_gun_runparams); + CMDFN(liquid_operation_set_zmotor_runparams); + CMDFN(liquid_operation_enable_lld_record); + CMDFN(liquid_operation_fresh_params); + CMDFN(pipette_init_device); CMDFN(pipette_put_tip); CMDFN(pipette_pump_move_to); diff --git a/sdk/os/zoslogger.hpp b/sdk/os/zoslogger.hpp index 64e3897..782afec 100644 --- a/sdk/os/zoslogger.hpp +++ b/sdk/os/zoslogger.hpp @@ -11,11 +11,11 @@ extern bool g_enable_log; #define ZLOG_RELEASE(TAG, fmt, ...) \ if (g_enable_log) { \ - zos_log(TAG "" fmt "\n", ##__VA_ARGS__); \ + zos_log(TAG "" fmt "\r\n", ##__VA_ARGS__); \ } #define ZLOGI(TAG, fmt, ...) \ if (g_enable_log) { \ - zos_log("%08lu INFO [%-10s] " fmt "\n", zchip_clock_get_ticket(), TAG, ##__VA_ARGS__); \ + zos_log("%08lu INFO [%-10s] " fmt "\r\n", zchip_clock_get_ticket(), TAG, ##__VA_ARGS__); \ } #define ZLOGI_NOT_END_LINE(TAG, fmt, ...) \ if (g_enable_log) { \ @@ -24,16 +24,16 @@ extern bool g_enable_log; #define ZLOGD(TAG, fmt, ...) \ if (g_enable_log) { \ - zos_log("%08lu DEBU [%-10s] " fmt "\n", zchip_clock_get_ticket(), TAG, ##__VA_ARGS__); \ + zos_log("%08lu DEBU [%-10s] " fmt "\r\n", zchip_clock_get_ticket(), TAG, ##__VA_ARGS__); \ } #define ZLOGE(TAG, fmt, ...) \ if (g_enable_log) { \ - zos_log("%08lu ERRO [%-10s] " fmt "\n", zchip_clock_get_ticket(), TAG, ##__VA_ARGS__); \ + zos_log("%08lu ERRO [%-10s] " fmt "\r\n", zchip_clock_get_ticket(), TAG, ##__VA_ARGS__); \ } #define ZLOGW(TAG, fmt, ...) \ if (g_enable_log) { \ - zos_log("%08lu WARN [%-10s] " fmt "\n", zchip_clock_get_ticket(), TAG, ##__VA_ARGS__); \ + zos_log("%08lu WARN [%-10s] " fmt "\r\n", zchip_clock_get_ticket(), TAG, ##__VA_ARGS__); \ } #define ZASSERT(cond) \ diff --git a/usrc/project_configs.h b/usrc/project_configs.h index 5edb9df..c1c2517 100644 --- a/usrc/project_configs.h +++ b/usrc/project_configs.h @@ -1,5 +1,5 @@ #pragma once -#define PC_VERSION 604 +#define PC_VERSION 605 #define PC_MANUFACTURER "http://www.iflytop.com/" #define PC_PROJECT_NAME "a8000_subboard" #define PC_IFLYTOP_ENABLE_OS 1 diff --git a/usrc/sysmgr/sys_mgr.cpp b/usrc/sysmgr/sys_mgr.cpp index ea8a87e..8a8e1c2 100644 --- a/usrc/sysmgr/sys_mgr.cpp +++ b/usrc/sysmgr/sys_mgr.cpp @@ -16,13 +16,13 @@ extern "C" { * STM32_CODE_ERROR * ***********************************************************************************************************************/ void SysMgr_on_Error_Handler() { - ZLOGE(TAG, "Error_Handler\n"); + ZLOGE(TAG, "Error_Handler\r\n"); while (1) { } } void SysMgr_on_assert_failed(uint8_t* file, uint32_t line) { - ZLOGE(TAG, "ASSERT: %s [%s:%d]\n", file, line); + ZLOGE(TAG, "ASSERT: %s [%s:%d]\r\n", file, line); while (1) { } } @@ -40,13 +40,13 @@ void SysMgr_on_UsageFault_Handler(void) { ZLOGI(TAG, "on UsageFault_Handler"); } * FREERTOS_ERROR * ***********************************************************************************************************************/ void vApplicationStackOverflowHook(xTaskHandle xTask, signed char* pcTaskName) { - ZLOGE(TAG, "StackOverflowHook: %s\n", pcTaskName); + ZLOGE(TAG, "StackOverflowHook: %s\r\n", pcTaskName); __disable_irq(); while (1) { } } void vApplicationMallocFailedHook(void) { - ZLOGE(TAG, "MallocFailedHook\n"); + ZLOGE(TAG, "MallocFailedHook\r\n"); __disable_irq(); while (1) { } @@ -80,18 +80,18 @@ size_t SysMgr::osGetTotalHeapSize() { return configTOTAL_HEAP_SIZE; } int32_t SysMgr::getTaskNum() { return m_ntask; } void SysMgr::dumpSysInfo() { - zos_log("---------------Heap Info--------------\n"); - zos_log("MinimumEverFreeHeapSize: %d\n", osGetMinimumEverFreeHeapSize()); - zos_log("FreeHeapSize : %d\n", osGetFreeHeapSize()); - zos_log("TotalHeapSize : %d\n", osGetTotalHeapSize()); + zos_log("---------------Heap Info--------------\r\n"); + zos_log("MinimumEverFreeHeapSize: %d\r\n", osGetMinimumEverFreeHeapSize()); + zos_log("FreeHeapSize : %d\r\n", osGetFreeHeapSize()); + zos_log("TotalHeapSize : %d\r\n", osGetTotalHeapSize()); zos_log(""); - zos_log("---------------Task Info--------------\n"); + zos_log("---------------Task Info--------------\r\n"); static char buf[40 * SDK_MAX_TASK]; // 40一个任务,最多支持10个任务 vTaskList(buf); - zos_log("Name State Priority Stack Num\n"); + zos_log("Name State Priority Stack Num\r\n"); zlog_raw(buf); - zos_log("- TaskInfoEnd -\n"); + zos_log("- TaskInfoEnd -\r\n"); } uint32_t SysMgr::osTaskStackRemainingSize(osThreadId id) { return uxTaskGetStackHighWaterMark(id); }