You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -124,11 +128,6 @@ int tsdrplugin_init(const char * params) {
124
128
outbuf_size=1;
125
129
}
126
130
127
-
if (running==NULL) {
128
-
running= (mutex_t*) malloc(sizeof(mutex_t));
129
-
mutex_init(running);
130
-
}
131
-
132
131
// if an extio was already initialized before, now change
133
132
if (source!=NULL)
134
133
closeextio();
@@ -147,9 +146,16 @@ int tsdrplugin_init(const char * params) {
147
146
RETURN_EXCEPTION("The sample format of the ExtIO plugin is not supported.", TSDR_CANNOT_OPEN_DEVICE);
148
147
}
149
148
150
-
if (source->OpenHW())
151
-
RETURN_OK()
152
-
else {
149
+
if (source->OpenHW()) {
150
+
// list attenuators
151
+
if (source->GetAttenuators!=NULL) {
152
+
max_att_id=0;
153
+
floatatt;
154
+
while (source->GetAttenuators(max_att_id++,&att) ==0) {};
155
+
}
156
+
157
+
RETURN_OK();
158
+
} else {
153
159
closeextio();
154
160
RETURN_EXCEPTION("The ExtIO driver failed to open a device. Make sure your device is plugged in and its drivers are installed correctly.", TSDR_CANNOT_OPEN_DEVICE);
155
161
}
@@ -164,6 +170,15 @@ int tsdrplugin_init(const char * params) {
0 commit comments