Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 236041
b: refs/heads/master
c: 96df979
h: refs/heads/master
i:
  236039: 95cb10f
v: v3
  • Loading branch information
Jonathan Cameron authored and Greg Kroah-Hartman committed Feb 18, 2011
1 parent aecdd7e commit ffe34de
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 30268a3da9325a2267cfc99efae7c192fa88199f
refs/heads/master: 96df9799a4dd62aab7566165d887ea40b1c8aa00
22 changes: 17 additions & 5 deletions trunk/drivers/staging/iio/Documentation/generic_buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@
#include <string.h>
#include "iio_utils.h"

const int buf_len = 128;
const int num_loops = 2;

/**
* size_from_channelarray() - calculate the storage size of a scan
* @channels: the channel info array
Expand Down Expand Up @@ -119,6 +116,11 @@ void process_scan(char *data,

int main(int argc, char **argv)
{
unsigned long num_loops = 2;
unsigned long timedelay = 1000000;
unsigned long buf_len = 128;


int ret, c, i, j, toread;

FILE *fp_ev;
Expand All @@ -136,10 +138,11 @@ int main(int argc, char **argv)
char *buffer_access, *buffer_event;
int scan_size;
int noevents = 0;
char *dummy;

struct iio_channel_info *infoarray;

while ((c = getopt(argc, argv, "et:n:")) != -1) {
while ((c = getopt(argc, argv, "l:w:c:et:n:")) != -1) {
switch (c) {
case 'n':
device_name = optarg;
Expand All @@ -151,6 +154,15 @@ int main(int argc, char **argv)
case 'e':
noevents = 1;
break;
case 'c':
num_loops = strtoul(optarg, &dummy, 10);
break;
case 'w':
timedelay = strtoul(optarg, &dummy, 10);
break;
case 'l':
buf_len = strtoul(optarg, &dummy, 10);
break;
case '?':
return -1;
}
Expand Down Expand Up @@ -285,7 +297,7 @@ int main(int argc, char **argv)
continue;
}
} else {
usleep(1000);
usleep(timedelay);
toread = 64;
}

Expand Down

0 comments on commit ffe34de

Please sign in to comment.