diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2019-02-10 18:37:18 +0200 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2019-02-10 18:37:18 +0200 |
| commit | 699adb89985c13a9d168d67b4d4e30984730daf6 (patch) | |
| tree | bd5353182edc8b379b84c4c61e01034e2cb6923b /Software/Embedded_SW/Embedded/Modules/Control/control.c | |
| parent | a65868d1d77b1929b855abd0c19bdc08bc9cee9d (diff) | |
| download | Tango-699adb89985c13a9d168d67b4d4e30984730daf6.tar.gz Tango-699adb89985c13a9d168d67b4d4e30984730daf6.zip | |
experimental code for improved control - not tested yet (commented out)
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/Control/control.c')
| -rw-r--r-- | Software/Embedded_SW/Embedded/Modules/Control/control.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Control/control.c b/Software/Embedded_SW/Embedded/Modules/Control/control.c index 69820e306..b7521d796 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/control.c +++ b/Software/Embedded_SW/Embedded/Modules/Control/control.c @@ -99,7 +99,7 @@ uint32_t ControlDatalog[MAX_TANGO_CONTROL_DEVICES]; uint16_t ControlBacklog[MAX_BACKLOG_SIZE]={0}; uint16_t backlogindex = 0; uint32_t Control_timerBase = TIMER0_BASE; //Timer handle -uint32_t MaxHighDevices = 0; +uint32_t MaxHighDevices = 0xFF; /******************** Functions ********************************************/ void OneMilliSecondFunction(UArg arg0); @@ -125,7 +125,7 @@ void ControlInit(void) ControlRestart = false; memset(ControlDatalog,0,sizeof(uint32_t)*MAX_TANGO_CONTROL_DEVICES); - MaxHighDevices = 0; + MaxHighDevices = 0xFF; for (Device_i = 0; Device_i < MAX_TANGO_CONTROL_DEVICES; Device_i++) { ControlArray[Device_i].ControlActive = false; @@ -243,8 +243,13 @@ uint32_t AddControlCallback( ControlCBFunction Callback, CTRL_TIMING_ENUM CtrlF break; } } - /* if ((deviceId!=0xFF )&&(deviceId> MaxHighDevices)) - // MaxHighDevices = deviceId; +/* if (MaxHighDevices == 0xFF) + MaxHighDevices = deviceId; + else + { + if ((deviceId!=0xFF )&&(deviceId> MaxHighDevices)) + MaxHighDevices = deviceId; + } } else { @@ -359,7 +364,9 @@ uint32_t GetControlLowDevice_i(void) } uint32_t ControlLoop(uint32_t tick) { - //for (ControlDevice_i = 0; ControlDevice_i < MaxHighDevices;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) |
