#include <stdio.h>
#include <assert.h>
#include "midas.h"
#include "msystem.h"
Go to the source code of this file.
◆ device_driver()
Definition at line 153 of file device_driver.cxx.
154{
155 va_list argptr;
158 float value, *pvalue;
160
161 va_start(argptr, cmd);
163
164
167
168 switch (cmd) {
171
176
178
183
184
187
188
192
193
197
198
202 }
203
208 }
209 } else {
213 }
214 break;
215
218
220 }
221 break;
222
224
227 break;
228
233
234
235 for (
i = 0;
i < 1000;
i++) {
237 break;
239 }
240
241
244
248 }
249 break;
250
253 break;
254
257 label = va_arg(argptr, char *);
259 break;
260
263 name = va_arg(argptr,
char *);
265 break;
266
267 default:
268
270
271
273 value = (float) va_arg(argptr,
double);
279 } else {
281 }
282
284
285
287 pvalue = va_arg(argptr, float *);
295 } else
297
298 } else {
299
300
302 pvalue = va_arg(argptr, float *);
304 }
305
306 break;
307 }
308
309 va_end(argptr);
311}
static int sc_thread(void *info)
#define FE_PARTIALLY_DISABLED
INT ss_mutex_release(MUTEX_T *mutex)
INT ss_thread_kill(midas_thread_t thread_id)
INT ss_mutex_delete(MUTEX_T *mutex)
INT ss_mutex_create(MUTEX_T **mutex, BOOL recursive)
midas_thread_t ss_thread_create(INT(*thread_func)(void *), void *param)
INT ss_sleep(INT millisec)
INT ss_mutex_wait_for(MUTEX_T *mutex, INT timeout)
float variable[CMD_GET_LAST+1]
◆ sc_thread()
| static int sc_thread |
( |
void * |
info | ) |
|
|
static |
Definition at line 15 of file device_driver.cxx.
16{
19 int current_channel = 0;
20 int current_priority_channel = 0;
22 int *last_update;
23 unsigned int current_time;
25
27
28 last_update = (
int*)calloc(device_drv->
channels,
sizeof(
int));
32
33
35
36
39
41 do {
42
43
45
46
47
48
52 } else {
55 }
56 }
57
62
67 }
69 }
70
71
72 current_channel = (current_channel + 1) % device_drv->
channels;
73
74
77 i = (current_priority_channel + 1) % device_drv->
channels;
78 while (!(current_time - last_update[
i] < 10000)) {
80 if (
i == current_priority_channel) {
81
82 break;
83 }
84 }
85
86
87 if (current_time - last_update[
i] < 10000) {
88 current_priority_channel =
i;
89
92
97 }
98 }
99 }
100
101
103
109
115 }
116 }
117 }
118 }
119
120
122
129
134 }
135 }
136 }
137 }
138
140
142
143 free(last_update);
144
145
147
149}
INT EXPRT ss_thread_set_name(std::string name)
static char * skip(char **buf, const char *delimiters)
std::string * pequipment_name
EQUIPMENT_INFO * pequipment