From 0c8ab1508f5bfed4b008916356382b5d844a2044 Mon Sep 17 00:00:00 2001 From: linyimin <18316471919@139.com> Date: Fri, 28 Aug 2026 17:11:51 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=8E=BB=E9=99=A43=E7=A7=92=E5=86=85?= =?UTF-8?q?=E5=8F=AA=E8=83=BD=E5=B0=84=E7=AE=AD=E4=B8=80=E6=AC=A1=E7=9A=84?= =?UTF-8?q?=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.yaml | 6 +++--- config.py | 2 +- main.py | 14 +++++++++----- version.py | 2 +- 4 files changed, 14 insertions(+), 10 deletions(-) diff --git a/app.yaml b/app.yaml index 67d4e23..0f84772 100644 --- a/app.yaml +++ b/app.yaml @@ -1,6 +1,6 @@ id: t11 name: t11 -version: 2.17.0 +version: 2.17.14 author: t11 icon: '' desc: t11 @@ -18,8 +18,8 @@ files: - laser_manager.py - logger_manager.py - main.py - - model_317211.cvimodel - - model_317211.mud + - model_317828.cvimodel + - model_317828.mud - network.py - ota_curl.sh - ota_manager.py diff --git a/config.py b/config.py index 8f3ffce..c1ec5ec 100644 --- a/config.py +++ b/config.py @@ -264,7 +264,7 @@ TRIANGLE_YOLO_PRELOAD_ON_BOOT = False # YOLO target size classification: class 0=20cm, class 1=40cm. TARGET_CLASS_YOLO_ENABLE = True -TARGET_CLASS_YOLO_MODEL_PATH = APP_DIR + "/model_317704.mud" +TARGET_CLASS_YOLO_MODEL_PATH = APP_DIR + "/model_317828.mud" TARGET_CLASS_YOLO_LABELS = (20, 40) TARGET_CLASS_YOLO_CONF_TH = 0.66 TARGET_CLASS_YOLO_IOU_TH = 0.45 diff --git a/main.py b/main.py index 607bd0f..5b62775 100644 --- a/main.py +++ b/main.py @@ -289,7 +289,9 @@ def cmd_str(): logger.info("系统准备完成...") last_adc_trigger = 0 + trigger_adc_val = 0 # 触发时的气压值,气压需降回此值以下才能再次触发 # 读取一次ADC初始值,防止开机时传感器已有压力导致误触发 + enable_check = True try: last_adc_val = hardware_manager.adc_obj.read() except Exception: @@ -384,13 +386,15 @@ def cmd_str(): if len(pressure_buf) >= PRESSURE_BATCH_SIZE: _flush_pressure_buf("batch") # 突变增量检测:压力增量大于300时触发 - if (adc_val - last_adc_val) > 300: + # 触发后需等气压降到触发值以下才重新检测增量 + if adc_val < trigger_adc_val : + enable_check = True + if (adc_val - last_adc_val) > 500 and enable_check: hardware_manager.start_idle_timer() # 重新计时 - diff_ms = current_time - last_adc_trigger - if diff_ms < 3000: - time.sleep_ms(5) - continue last_adc_trigger = current_time + trigger_adc_val = adc_val # 记录触发时的气压值 + last_adc_val = adc_val # 更新基准值,防止连续增量误触发 + enable_check = False _flush_pressure_buf("before_trigger") try: diff --git a/version.py b/version.py index d1b7756..6aa75c9 100644 --- a/version.py +++ b/version.py @@ -4,6 +4,6 @@ 应用版本号 每次 OTA 更新时,只需要更新这个文件中的版本号 """ -VERSION = '2.17.4' +VERSION = '2.17.14'