aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Modules/Control/control.c
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2019-02-19 11:19:21 +0200
committerShlomo Hecht <shlomo@twine-s.com>2019-02-19 11:19:21 +0200
commit93e6a6bfa7238826dcdea989e279ec3450067f83 (patch)
tree212b5023935862346a7de311e37cf1ef727efcd5 /Software/Embedded_SW/Embedded/Modules/Control/control.c
parente99efd9d9b7b67a76db82a9a40525f96bcf064c0 (diff)
parent3fcd0dbc6650749421f0390a60154c52254682e6 (diff)
downloadTango-93e6a6bfa7238826dcdea989e279ec3450067f83.tar.gz
Tango-93e6a6bfa7238826dcdea989e279ec3450067f83.zip
Merge branch 'master' of https://twinetfs.visualstudio.com/Tango/_git/Tango
Diffstat (limited to 'Software/Embedded_SW/Embedded/Modules/Control/control.c')
-rw-r--r--Software/Embedded_SW/Embedded/Modules/Control/control.c37
1 files changed, 36 insertions, 1 deletions
diff --git a/Software/Embedded_SW/Embedded/Modules/Control/control.c b/Software/Embedded_SW/Embedded/Modules/Control/control.c
index b7521d796..e4abc5e3c 100644
--- a/Software/Embedded_SW/Embedded/Modules/Control/control.c
+++ b/Software/Embedded_SW/Embedded/Modules/Control/control.c
@@ -56,7 +56,6 @@
#include "control.h"
#include "MillisecTask.h"
/******************** Definitions ********************************************/
-#define INVALID_MSG_ID 0xFFFF
#define MAX_TANGO_CONTROL_DEVICES 100
/******************** STRUCTURES AND ENUMs ********************************************/
@@ -282,6 +281,42 @@ uint32_t AddControlCallback( ControlCBFunction Callback, CTRL_TIMING_ENUM CtrlF
return deviceId;
}
+int SafeRemoveHighControlCallback(uint32_t deviceId , ControlCBFunction Callback)
+{
+ if (RemoveControlCallback(deviceId, Callback )!=OK)
+ {
+ Report("Fixing Remove control ",__FILE__,__LINE__,(int)GetControlDevice_i(),RpWarning,(int)deviceId,0);
+ if (RemoveControlCallback(GetControlDevice_i(),Callback)==OK)
+ {
+ Report("Remove control callback fixed",__FILE__,__LINE__,(int)GetControlDevice_i(),RpWarning,(int)deviceId,0);
+ }
+ else
+ {
+ Report("Remove control callback failed",__FILE__,__LINE__,(int)GetControlDevice_i(),RpWarning,(int)deviceId,0);
+ return ERROR;
+ }
+ }
+ return OK;
+}
+
+int SafeRemoveControlCallback(uint32_t deviceId , ControlCBFunction Callback)
+{
+ if (RemoveControlCallback(deviceId, Callback )!=OK)
+ {
+ Report("Fixing Remove control ",__FILE__,__LINE__,(int)GetControlLowDevice_i(),RpWarning,(int)deviceId,0);
+ if (RemoveControlCallback(GetControlLowDevice_i(),Callback)==OK)
+ {
+ Report("Remove control callback fixed",__FILE__,__LINE__,(int)GetControlLowDevice_i(),RpWarning,(int)deviceId,0);
+ }
+ else
+ {
+ Report("Remove control callback failed",__FILE__,__LINE__,(int)GetControlLowDevice_i(),RpWarning,(int)deviceId,0);
+ return ERROR;
+ }
+ }
+ return OK;
+}
+
int RemoveControlCallback(uint32_t deviceId , ControlCBFunction Callback)
{
if (deviceId == 0xFF)