diff options
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/Control/control.c')
| -rw-r--r-- | Software/Embedded_SW/Embedded/Modules/Control/control.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Control/control.c b/Software/Embedded_SW/Embedded/Modules/Control/control.c index e02bd8191..e6da43178 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/control.c +++ b/Software/Embedded_SW/Embedded/Modules/Control/control.c @@ -83,6 +83,7 @@ typedef struct DataReadCBFunction ControlDataReadPtr; ControlCBFunction ControlCallbackPtr; uint32_t ControlTiming; + uint32_t LastCalled; char *Name; }ControlDeviceStruc; @@ -613,10 +614,13 @@ uint32_t ControlLowLoop(uint32_t tick) { if (tick - ControlArray[ControlLowDevice_i].StartTick<=skipped_ticks) continue; + if (tick - ControlArray[ControlLowDevice_i].LastCalled<=skipped_ticks) + continue; if (ControlArray[ControlLowDevice_i].ControlTiming == eOneMillisecond) continue; if (ControlArray[ControlLowDevice_i].StartTick == tick) continue; + ControlArray[ControlLowDevice_i].LastCalled = tick; if (((tick - ControlArray[ControlLowDevice_i].StartTick)%ControlArray[ControlLowDevice_i].ControlTiming)<=skipped_ticks) // run the control on exact intervals { |
