comparison data-provider.h @ 91:4102fe614df2

Fix timestamping. Cleanup data providers
author Daniele Nicolodi <daniele.nicolodi@obspm.fr>
date Fri, 22 Mar 2013 16:32:15 +0100
parents
children 99cbe2b57530
comparison
equal deleted inserted replaced
90:c9aec93005a4 91:4102fe614df2
1 #ifndef __DATA_PROVIDER_H__
2 #define __DATA_PROVIDER_H__
3
4 #include <future.h>
5
6 /* data acquisition flag */
7 extern int acquiring;
8
9 /* data queue */
10 extern CmtTSQHandle dataQueue;
11
12 /* callback receiving messages in the main thread */
13 void CVICALLBACK MessageCB (void *callbackData);
14
15 /* data acquisition event */
16 struct event {
17 struct timeval time;
18 double data[4];
19 };
20
21 /* message */
22 static char message[1024];
23
24 #define SendMessage(threadId, ...) \
25 do { \
26 snprintf(message, sizeof(message) - 1, ##__VA_ARGS__); \
27 PostDeferredCallToThread(MessageCB, message, threadId); \
28 } while (0)
29
30
31 #endif