How many times to fix it?

This commit is contained in:
Hakan Bastedt
2024-01-23 17:51:44 +01:00
parent ddffbe5f8b
commit f8cec1ac69

View File

@@ -56,7 +56,6 @@ void handleStepper(void)
Step2.handleStepper(); Step2.handleStepper();
} }
uint32_t prevTim = 0;
void cb_get_inputs(void) // Set Master inputs, slave outputs, last operation void cb_get_inputs(void) // Set Master inputs, slave outputs, last operation
{ {
Obj.IndexStatus = Encoder1.indexHappened(); Obj.IndexStatus = Encoder1.indexHappened();
@@ -125,8 +124,8 @@ void loop(void)
serveIRQ = 0; serveIRQ = 0;
ESCvar.PrevTime = ESCvar.Time; ESCvar.PrevTime = ESCvar.Time;
} }
uint64_t superNow=micros(); uint32_t dTime=micros()-nowTime;
if (superNow - nowTime < 500 || superNow - nowTime > 1500) // Don't run ecat_slv_poll when expecting to server interrupt if ((dTime > 100 && dTime < 800) || dTime > 1500) // Don't run ecat_slv_poll when expecting to server interrupt
ecat_slv_poll(); ecat_slv_poll();
} }