From fb94645d9fbf5fdfd2a8d5f890a525900e7ee697 Mon Sep 17 00:00:00 2001 From: air <30444667+sszdot@users.noreply.github.com> Date: Wed, 14 May 2025 18:18:06 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E7=B1=BB=20=20=E5=9E=8B=E3=80=91?= =?UTF-8?q?=EF=BC=9Afix=20=E3=80=90=E5=8E=9F=20=20=E5=9B=A0=E3=80=91?= =?UTF-8?q?=EF=BC=9A=E6=97=A5=E5=BF=97=E6=8A=A5=E6=9C=89=E9=87=8D=E9=87=8F?= =?UTF-8?q?=E4=BD=86=E6=8A=A5=20=E6=97=A0=E8=B4=A7=E7=89=A9=20=E3=80=90?= =?UTF-8?q?=E8=BF=87=20=20=E7=A8=8B=E3=80=91=EF=BC=9A=E6=A3=80=E6=B5=8B?= =?UTF-8?q?=E6=98=AF=E5=90=A6=E8=B6=85=E9=87=8D=20=E2=80=9C=E5=88=B0?= =?UTF-8?q?=E9=A1=B6=E9=83=A8=E9=94=81=E5=AE=9A=E7=8A=B6=E6=80=81=EF=BC=8C?= =?UTF-8?q?=E6=9C=89=E5=90=91=E4=B8=8A=E7=9A=84=E5=8E=8B=E5=8A=9B=EF=BC=8C?= =?UTF-8?q?=E9=87=8D=E9=87=8F=E4=B8=8D=E5=87=86=EF=BC=8C=E4=B8=8D=E8=83=BD?= =?UTF-8?q?=E6=A3=80=E6=B5=8B=E2=80=9D=20=E6=AD=A4=E5=A4=84=E9=80=80?= =?UTF-8?q?=E5=87=BA=20=E3=80=90=E5=BD=B1=20=20=E5=93=8D=E3=80=91=EF=BC=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/config.h | 2 +- src/main.cpp | 10 +++++----- src/motocontrol.cpp | 3 +++ 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/config.h b/src/config.h index f057190..685af4e 100644 --- a/src/config.h +++ b/src/config.h @@ -38,7 +38,7 @@ #define SERIAL_REPORT_RX 18 ///// // #define WEIGHT_SCALE 41 // //A通道是165,B通道是41 -#define TM_INSTORE_WEIGHT_DELAY 270 // 200 // 入仓动力延时关闭时间 ms +#define TM_INSTORE_WEIGHT_DELAY 200 // 200 // 入仓动力延时关闭时间 ms #define TM_INSTORE_DELAY_WEIGHT 200 // 入仓动力延时关闭时间生效的重量(g),免得空钩也延时关闭导致线拉紧 ms #define TM_INSTORE_NOWEIGHT_DELAY 50 // 空钩完全不延时也可能顶部按键按不下去,加一点延时 ms diff --git a/src/main.cpp b/src/main.cpp index b65d380..f384270 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -100,7 +100,7 @@ void setup() preferences.begin("PullupDev", false); wei_offset = preferences.getLong("wei_offset", 0); // ESP_LOGD(MOUDLENAME, "wei_offset:%d", wei_offset); - addLogMessage("wei_offset: " + String(wei_offset)); + // addLogMessage("wei_offset: " + String(wei_offset)); // 初始化按钮 button_up.attachClick(upbtn_click); @@ -231,7 +231,7 @@ void showinfo() void begin_tare() { // ESP_LOGD(MOUDLENAME, "begin_tare"); - addLogMessage("begin_tare,校准称重"); + // addLogMessage("begin_tare,校准称重"); _weightalign_status = WAS_Aligning; _needweightalign = true; _weightalign_begintm = millis(); @@ -259,7 +259,7 @@ bool check_tare() preferences.putLong("wei_offset", wei_offset); motocontrol.weightalign(true); // ESP_LOGD(MOUDLENAME, "check_tare ok: %d,offset:%d", pullweight, wei_offset); - addLogMessage("check_tare ok: " + String(pullweight) + ", offset: " + String(wei_offset)); + // addLogMessage("check_tare ok: " + String(pullweight) + ", offset: " + String(wei_offset)); return true; } else @@ -269,7 +269,7 @@ bool check_tare() { // 没成功继续校准 // ESP_LOGD(MOUDLENAME, "weight not zero: %d", pullweight); - addLogMessage("weight not zero: " + String(pullweight)); + // addLogMessage("weight not zero: " + String(pullweight)); _needweightalign = true; pullweightoktimes = 0; } @@ -296,7 +296,7 @@ void checkinited() { // 开始自动慢速上升,直到顶部按钮按下 // ESP_LOGD(MOUDLENAME, "IS_Start: startup wait locked"); - addLogMessage("IS_Start: startup wait locked"); + // addLogMessage("IS_Start: startup wait locked"); motocontrol.setspeed(SPEED_BTN_SLOW); motocontrol.moto_run(MotoStatus::MS_Up); initstatus = IS_Wait_Locked; diff --git a/src/motocontrol.cpp b/src/motocontrol.cpp index 6c1b066..cfc2173 100644 --- a/src/motocontrol.cpp +++ b/src/motocontrol.cpp @@ -105,7 +105,10 @@ void Motocontrol::checkgoods() // 检测是否超重 { // 到顶部锁定状态,有向上的压力,重量不准,不能检测 if (_controlstatus.is_toplocked) + { + addLogMessage("is_toplocked"); return; + } // 检查是否超重 if (_pullweight > HOOK_WEIHT_MAX)