diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2018-11-15 14:54:51 +0200 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2018-11-15 14:54:51 +0200 |
| commit | aeacbdabd448b2e7455e16460b996c8090731d9d (patch) | |
| tree | 1264b75395afc05b955c5fc205ebe63fa7fc7321 /Software/Embedded_SW/Embedded/Modules/Control | |
| parent | e615d14fb0f47ae0ec44766b51d1009c12332a4f (diff) | |
| download | Tango-aeacbdabd448b2e7455e16460b996c8090731d9d.tar.gz Tango-aeacbdabd448b2e7455e16460b996c8090731d9d.zip | |
many logs. improve job handling and IDS. NEW WINDER ALGORITHM (Interrupts)
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/Control')
| -rw-r--r-- | Software/Embedded_SW/Embedded/Modules/Control/control.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Control/control.c b/Software/Embedded_SW/Embedded/Modules/Control/control.c index 78cdd5324..2110029e4 100644 --- a/Software/Embedded_SW/Embedded/Modules/Control/control.c +++ b/Software/Embedded_SW/Embedded/Modules/Control/control.c @@ -202,7 +202,7 @@ uint32_t AddControlCallback( ControlCBFunction Callback, CTRL_TIMING_ENUM CtrlF unsigned int key; uint32_t device_i; - uint32_t deviceId = 0xFFFFFFFF; + uint32_t deviceId = 0xFF; for(device_i = 0;device_i < MAX_TANGO_CONTROL_DEVICES;device_i++) { if (ControlArray[device_i].ControlActive == false) @@ -211,8 +211,8 @@ uint32_t AddControlCallback( ControlCBFunction Callback, CTRL_TIMING_ENUM CtrlF break; } } - if (deviceId == 0xFFFFFFFF) - return 0xFFFFFFFF; + if (deviceId == 0xFF) + return 0xFF; key = GateMutex_enter(gateControlDB); ControlArray[deviceId].ControlTiming = CtrlFrequency; ControlArray[deviceId].ControlCallbackPtr = Callback; @@ -221,6 +221,7 @@ uint32_t AddControlCallback( ControlCBFunction Callback, CTRL_TIMING_ENUM CtrlF ControlArray[deviceId].Parameter1 = Parameter1; ControlArray[deviceId].IfIndex = IfIndex; GateMutex_leave(gateControlDB, key); + //LOG_ERROR(deviceId, "Add Callback"); return deviceId; @@ -239,11 +240,17 @@ int RemoveControlCallback(uint32_t deviceId , ControlCBFunction Callback) ControlArray[deviceId].ControlCallbackPtr = NULL; ControlArray[deviceId].ControlDataReadPtr = NULL; ControlArray[deviceId].ControlActive = false; + ControlArray[deviceId].Parameter1 = 0; + ControlArray[deviceId].IfIndex = 0; + //LOG_ERROR(deviceId, "Remove Callback "); GateMutex_leave(gateControlDB, key); return OK; } else + { + LOG_ERROR(deviceId, "Remove Callback failed"); return ERROR; + } } |
