From 3953957df5bf9f765edfcba6a7a380b69914be2d Mon Sep 17 00:00:00 2001 From: murmur Date: Sat, 4 Jan 2025 16:22:36 +0800 Subject: [PATCH] reset timeout --- protocol.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/protocol.c b/protocol.c index ededcf2..e3dae6b 100644 --- a/protocol.c +++ b/protocol.c @@ -365,7 +365,7 @@ uint32_t ReadPump2Reg(uint8_t id, uint16_t reg) { uint8_t rxBuf[30] = {0}; uint16_t rxLen = 9; - uint8_t ret = readDataFromMotorValve(rxBuf, rxLen, READ_ACK_TIMEOUT*10); + uint8_t ret = readDataFromMotorValve(rxBuf, rxLen, READ_ACK_TIMEOUT); if(memcmp(rxBuf,data,2) != 0) { elog_hexdump("writeCMD", 16, data, sizeof(data)); log_e("READ ACK ERROR:[%s]", ackError[ret]); @@ -904,7 +904,7 @@ uint32_t ReadValve2InputReg(uint8_t id, uint16_t reg) uint8_t rxBuf[30] = {0}; uint16_t rxLen = 9; - uint8_t hrst = readDataFromMotorValve(rxBuf, rxLen, READ_ACK_TIMEOUT*2); + uint8_t hrst = readDataFromMotorValve(rxBuf, rxLen, READ_ACK_TIMEOUT); if(memcmp(rxBuf, data, 2) != 0) { elog_hexdump("writeCMD", 16, data, sizeof(data)); log_e("READ ACK ERROR:[%s]", ackError[hrst]); @@ -1409,7 +1409,7 @@ void updateSystemStatus(void) updateVPInfo(); updatePumpStatus(); updateValveStatus(); - // dumpSystemStatus(); + dumpSystemStatus(); } /** @@ -1503,6 +1503,7 @@ static uint8_t HandleInit(void) { // 3.协议要求内容为:2个三通阀步进电机堵转找原点,重复至少2次。 + initBubbleSensor(); systemStatus.ds->initStatus = INIT_IN_PROGRESS; systemStatus.rst = 0; @@ -1686,6 +1687,7 @@ static uint8_t HandlePumpStepControl(uint8_t *Buff, uint8_t len) { uint8_t rst = systemStatus.rst; int32_t step = (Buff[index*4]<<24) | (Buff[index*4+1]<<16) | (Buff[index*4+2]<<8) | Buff[index*4+3]; log_d("泵步进设置: %d[%d], %d",index, dp.pump[index].id, step); + StopPump(index); SetPumpStepTarget(index, step); StartPumpRelativeMove(index); if(rst != systemStatus.rst) {