Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FMC DEL 1ns 4cha - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
FMC DEL 1ns 4cha - Software
Commits
0bd77f5f
Commit
0bd77f5f
authored
Jul 05, 2012
by
Juan David González Cobas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test: add a silly test program for fdelay_open_by_lun
take it or drop it
parent
50459535
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
0 deletions
+49
-0
Makefile
lib/Makefile
+1
-0
fdelay-open-by-lun.c
lib/fdelay-open-by-lun.c
+48
-0
No files found.
lib/Makefile
View file @
0bd77f5f
...
...
@@ -15,6 +15,7 @@ DEMOSRC += fdelay-term.c
DEMOSRC
+=
fdelay-read.c
DEMOSRC
+=
fdelay-fread.c
DEMOSRC
+=
fdelay-pulse.c
DEMOSRC
+=
fdelay-open-by-lun.c
DEMOS
:=
$
(
DEMOSRC:.c
=)
...
...
lib/fdelay-open-by-lun.c
0 → 100644
View file @
0bd77f5f
/* Silly thing that lists installed fine-delay boards */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#define FDELAY_INTERNAL
/* hack... */
#include "fdelay-lib.h"
int
main
(
int
argc
,
char
**
argv
)
{
int
i
;
struct
__fdelay_board
*
b
;
struct
fdelay_board
*
ub
;
int
lun
;
char
*
endptr
;
if
(
argc
!=
2
)
goto
usage
;
lun
=
strtol
(
argv
[
1
],
&
endptr
,
0
);
if
(
*
endptr
!=
0
)
goto
usage
;
i
=
fdelay_init
();
if
(
i
<
0
)
{
fprintf
(
stderr
,
"%s: fdelay_init(): %s
\n
"
,
argv
[
0
],
strerror
(
errno
));
exit
(
1
);
}
printf
(
"%s: found %i boards
\n
"
,
argv
[
0
],
i
);
ub
=
fdelay_open_by_lun
(
lun
);
if
(
ub
==
NULL
)
{
fprintf
(
stderr
,
"could not open lun %d
\n
"
,
lun
);
exit
(
1
);
}
b
=
(
typeof
(
b
))
ub
;
printf
(
"lun:%d dev_id %04x, %s, %s
\n
"
,
lun
,
b
->
dev_id
,
b
->
devbase
,
b
->
sysbase
);
fdelay_exit
();
return
0
;
usage:
printf
(
"usage: %s lun
\n
"
,
argv
[
0
]);
return
-
1
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment