diff options
| author | Avi Levkovich <avi@twine-s.com> | 2020-12-10 12:20:55 +0200 |
|---|---|---|
| committer | Avi Levkovich <avi@twine-s.com> | 2020-12-10 12:20:55 +0200 |
| commit | afaee9a1cc07c5578aa9630963d895380d64f51b (patch) | |
| tree | 1c69fd2188f53ca3d0266ab68f3d79f83d0987d5 /Software/Embedded_SW/Embedded/Modules/Control/control.c | |
| parent | 322073a52f4afc5c09903a92dd1c12bd111cd040 (diff) | |
| download | Tango-afaee9a1cc07c5578aa9630963d895380d64f51b.tar.gz Tango-afaee9a1cc07c5578aa9630963d895380d64f51b.zip | |
fix idle and timing in control. remove error file for release
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 { |
