From f8cec1ac6918a6e6f09e0038126144b58e9c1ba6 Mon Sep 17 00:00:00 2001 From: Hakan Bastedt Date: Tue, 23 Jan 2024 17:51:44 +0100 Subject: [PATCH] How many times to fix it? --- Firmware/src/main.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Firmware/src/main.cpp b/Firmware/src/main.cpp index 6605728..cc41a62 100755 --- a/Firmware/src/main.cpp +++ b/Firmware/src/main.cpp @@ -56,7 +56,6 @@ void handleStepper(void) Step2.handleStepper(); } -uint32_t prevTim = 0; void cb_get_inputs(void) // Set Master inputs, slave outputs, last operation { Obj.IndexStatus = Encoder1.indexHappened(); @@ -125,8 +124,8 @@ void loop(void) serveIRQ = 0; ESCvar.PrevTime = ESCvar.Time; } - uint64_t superNow=micros(); - if (superNow - nowTime < 500 || superNow - nowTime > 1500) // Don't run ecat_slv_poll when expecting to server interrupt + uint32_t dTime=micros()-nowTime; + if ((dTime > 100 && dTime < 800) || dTime > 1500) // Don't run ecat_slv_poll when expecting to server interrupt ecat_slv_poll(); }