--- a/me8100_test_dio/rtest.c Thu Jan 17 20:25:34 2002 +0100
+++ b/me8100_test_dio/rtest.c Fri Jan 18 20:22:52 2002 +0100
@@ -23,6 +23,8 @@
#include "me8100.h"
+#define USE_READ
+
int main(void){
int err = 0;
static int file_handle = -1;
@@ -30,6 +32,9 @@
unsigned short value_a;
printf("Read test, PID: %d\n", getpid());
+#ifdef USE_READ
+ printf("Using read()\n");
+#endif
file_handle = open("/dev/me8100_0a", O_RDONLY, 0);
if(file_handle < 0){
@@ -38,7 +43,11 @@
}
for (;;) {
+#ifdef USE_READ
+ read(file_handle, &value_a, sizeof(value_a));
+#else
ioctl(file_handle, ME8100_READ_DI_A, &value_a);
+#endif
printf("Read %04x\n", value_a);
sleep(1);
}