fix: 去除3秒内只能射箭一次的限制

This commit is contained in:
2026-08-28 17:11:51 +08:00
parent d30c432143
commit 0c8ab1508f
4 changed files with 14 additions and 10 deletions
+3 -3
View File
@@ -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
+1 -1
View File
@@ -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
+9 -5
View File
@@ -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:
+1 -1
View File
@@ -4,6 +4,6 @@
应用版本号
每次 OTA 更新时,只需要更新这个文件中的版本号
"""
VERSION = '2.17.4'
VERSION = '2.17.14'