summaryrefslogtreecommitdiff
path: root/sci-electronics/xoscope/files/xoscope-2.0-comedi_compile.patch
blob: 75d3820dad81a8e854812f77e16b5fc4ea43602e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
--- xoscope-2.0/comedi.c
+++ xoscope-2.0/comedi.c
@@ -27,7 +27,7 @@
 #include <sys/ioctl.h>
 #include <sys/time.h>
 #include <sys/poll.h>
-#include <asm/page.h>
+//#include <asm/page.h>
 #include <comedilib.h>
 #include "oscope.h"		/* program defaults */
 #include "func.h"
@@ -184,7 +184,9 @@
      * avoid the bug.  This is the only reason we need <asm/page.h> in
      * our include list.
      */
-    comedi_bufsize = (comedi_bufsize + PAGE_SIZE - 1) & PAGE_MASK;
+    //comedi_bufsize = (comedi_bufsize + PAGE_SIZE - 1) & PAGE_MASK;
+    comedi_bufsize = (comedi_bufsize + sysconf(_SC_PAGE_SIZE) - 1) &
+    (sysconf(_SC_PAGE_SIZE) - 1);
     ret = comedi_set_buffer_size(comedi_dev, comedi_subdevice, comedi_bufsize);
     if (ret < 0) {
       comedi_error = comedi_errno();
@@ -505,7 +507,7 @@
     unsigned int chan;
     int ret;
 
-    ret = comedi_get_cmd_generic_timed(comedi_dev, comedi_subdevice, &cmd, 0);
+    ret = comedi_get_cmd_generic_timed(comedi_dev, comedi_subdevice, &cmd, 0, 1);
 
     if (ret >= 0) {
       chan = CR_PACK(4,0,AREF_DIFF);