From a5fde6c76b7c98c482d5fc069c371da5480c0bdf Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Thu, 21 Feb 2019 14:24:23 +0200 Subject: Version 1.3.7.5 (careful!) control saves real time - main loop runs to the highest number of active control requests --- .../Embedded_SW/Embedded/Modules/Control/control.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules/Control') diff --git a/Software/Embedded_SW/Embedded/Modules/Control/control.c b/Software/Embedded_SW/Embedded/Modules/Control/control.c index e4abc5e3c..52b52d93b 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/control.c +++ b/Software/Embedded_SW/Embedded/Modules/Control/control.c @@ -232,8 +232,8 @@ uint32_t AddControlCallback( ControlCBFunction Callback, CTRL_TIMING_ENUM CtrlF uint32_t device_i; uint32_t deviceId = 0xFF; - //if (CtrlFrequency == eOneMillisecond) - //{ + if (CtrlFrequency == eOneMillisecond) + { for(device_i = 0;device_i < MAX_TANGO_CONTROL_DEVICES;device_i++) { if (ControlArray[device_i].ControlActive == false) @@ -242,7 +242,7 @@ uint32_t AddControlCallback( ControlCBFunction Callback, CTRL_TIMING_ENUM CtrlF break; } } -/* if (MaxHighDevices == 0xFF) + if (MaxHighDevices == 0xFF) MaxHighDevices = deviceId; else { @@ -252,7 +252,7 @@ uint32_t AddControlCallback( ControlCBFunction Callback, CTRL_TIMING_ENUM CtrlF } else { - for(device_i = MAX_TANGO_CONTROL_DEVICES-1;device_i >=0;device_i--) + for(device_i = MAX_TANGO_CONTROL_DEVICES-1;device_i > 0;device_i--) { if (ControlArray[device_i].ControlActive == false) { @@ -260,7 +260,7 @@ uint32_t AddControlCallback( ControlCBFunction Callback, CTRL_TIMING_ENUM CtrlF break; } } - }*/ + } if (deviceId == 0xFF) { @@ -399,10 +399,10 @@ uint32_t GetControlLowDevice_i(void) } uint32_t ControlLoop(uint32_t tick) { - //if (MaxHighDevices == 0xFF) - // return OK; - //for (ControlDevice_i = 0; ControlDevice_i <= MaxHighDevices;ControlDevice_i++) - for (ControlDevice_i = 0; ControlDevice_i < MAX_TANGO_CONTROL_DEVICES;ControlDevice_i++) + if (MaxHighDevices == 0xFF) + return OK; + for (ControlDevice_i = 0; ControlDevice_i <= MaxHighDevices;ControlDevice_i++) + //for (ControlDevice_i = 0; ControlDevice_i < MAX_TANGO_CONTROL_DEVICES;ControlDevice_i++) { if (ControlArray[ControlDevice_i].ControlActive) { -- cgit v1.3.1