Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FMC ADC 100M 14b 4cha - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
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 ADC 100M 14b 4cha - Software
Commits
0ea7e550
Commit
0ea7e550
authored
Dec 01, 2015
by
Adam Wujek
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tools: add printing version of programs
with -V switch Signed-off-by:
Adam Wujek
<
adam.wujek@cern.ch
>
parent
fc911276
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
45 additions
and
5 deletions
+45
-5
Makefile
tools/Makefile
+2
-0
fau-acq-time.c
tools/fau-acq-time.c
+17
-4
fau-trg-config.c
tools/fau-trg-config.c
+13
-1
parport-burst.c
tools/parport-burst.c
+13
-0
No files found.
tools/Makefile
View file @
0ea7e550
...
...
@@ -10,7 +10,9 @@ REPO_PARENT=../..
# user-space tools for spec-fine-delay
DESTDIR
?=
/usr/local
GIT_VERSION
:=
$(
shell
git describe
--dirty
--long
--tags
)
CFLAGS
+=
-I
../kernel
-Wno-trigraphs
-Wall
-ggdb
-O2
$(EXTRACFLAGS)
CFLAGS
+=
-DGIT_VERSION
=
"
\"
$(GIT_VERSION)
\"
"
CC
?=
$(CROSS_COMPILE)
gcc
...
...
tools/fau-acq-time.c
View file @
0ea7e550
...
...
@@ -15,6 +15,8 @@
#include <fcntl.h>
#include <errno.h>
static
char
git_version
[]
=
"version: "
GIT_VERSION
;
#define buf_len 50
/* user will edit by adding the device name */
char
basepath
[
40
]
=
"/sys/bus/zio/devices/"
;
...
...
@@ -102,9 +104,15 @@ static void fau_help()
{
printf
(
"
\n
fau-acq-time [OPTIONS] <DEVICE>
\n\n
"
);
printf
(
" <DEVICE>: ZIO name of the device to use
\n
"
);
printf
(
" --last|-l : time between the last trigger and the acquisition end
\n\n
"
);
printf
(
" --full|-f : time between the acquisition start and the acquisition end
\n\n
"
);
printf
(
" --help|-h: show this help
\n\n
"
);
printf
(
" --last|-l : time between the last trigger and the acquisition end
\n
"
);
printf
(
" --full|-f : time between the acquisition start and the acquisition end
\n
"
);
printf
(
" --version|-V : print version information
\n
"
);
printf
(
" --help|-h : show this help
\n\n
"
);
}
static
void
print_version
(
char
*
pname
)
{
printf
(
"%s %s
\n
"
,
pname
,
git_version
);
}
int
main
(
int
argc
,
char
*
argv
[])
...
...
@@ -114,6 +122,7 @@ int main(int argc, char *argv[])
static
struct
option
options
[]
=
{
{
"last"
,
no_argument
,
&
last
,
1
},
{
"full"
,
no_argument
,
&
full
,
1
},
{
"version"
,
no_argument
,
0
,
'V'
},
{
"help"
,
no_argument
,
0
,
'h'
},
{
0
,
0
,
0
,
0
}
};
...
...
@@ -126,12 +135,16 @@ int main(int argc, char *argv[])
exit
(
1
);
}
while
(
(
c
=
getopt_long
(
argc
,
argv
,
"lfh"
,
options
,
&
opt_index
))
>=
0
){
while
(
(
c
=
getopt_long
(
argc
,
argv
,
"lf
V
h"
,
options
,
&
opt_index
))
>=
0
){
if
(
c
==
'h'
)
{
fau_help
();
exit
(
1
);
break
;
}
if
(
c
==
'V'
)
{
print_version
(
argv
[
0
]);
exit
(
1
);
}
}
if
(
optind
!=
argc
-
1
)
{
...
...
tools/fau-trg-config.c
View file @
0ea7e550
...
...
@@ -17,6 +17,8 @@
#include <fcntl.h>
#include <errno.h>
static
char
git_version
[]
=
"version: "
GIT_VERSION
;
#define buf_len 50
/* user will edit by adding the device name */
char
basepath
[
40
]
=
"/sys/bus/zio/devices/"
;
...
...
@@ -89,11 +91,17 @@ static void fau_help()
printf
(
" --disable-hw-trg: disable the hardware trigger. By default "
"is enabled
\n
"
);
printf
(
" --force: force all attribute to the program default
\n
"
);
printf
(
" --version|-V: print version information
\n
"
);
printf
(
" --help|-h: show this help
\n\n
"
);
printf
(
"NOTE: The software trigger works only if also hardware trigger "
"is enabled
\n\n
"
);
}
static
void
print_version
(
char
*
pname
)
{
printf
(
"%s %s
\n
"
,
pname
,
git_version
);
}
int
main
(
int
argc
,
char
*
argv
[])
{
/* default attribute */
...
...
@@ -113,6 +121,7 @@ int main(int argc, char *argv[])
{
"enable-sw-trg"
,
no_argument
,
&
attrval
[
FAU_SW_TRG_EN
],
1
},
{
"disable-hw-trg"
,
no_argument
,
&
attrval
[
FAU_TRG_EN
],
0
},
{
"force"
,
no_argument
,
&
force
,
1
},
{
"version"
,
no_argument
,
0
,
'V'
},
{
"help"
,
no_argument
,
0
,
'h'
},
{
0
,
0
,
0
,
0
}
};
...
...
@@ -124,7 +133,7 @@ int main(int argc, char *argv[])
exit
(
1
);
}
while
(
(
c
=
getopt_long
(
argc
,
argv
,
"p:P:n:d:t:c:h"
,
while
(
(
c
=
getopt_long
(
argc
,
argv
,
"p:P:n:d:t:c:
V
h"
,
options
,
&
opt_index
))
>=
0
){
switch
(
c
){
case
'p'
:
...
...
@@ -145,6 +154,9 @@ int main(int argc, char *argv[])
case
'c'
:
attrval
[
FAU_TRG_CHN
]
=
atoi
(
optarg
);
break
;
case
'V'
:
print_version
(
argv
[
0
]);
exit
(
1
);
case
'h'
:
fau_help
();
exit
(
1
);
...
...
tools/parport-burst.c
View file @
0ea7e550
...
...
@@ -21,6 +21,8 @@
#include <sys/stat.h>
#include <sys/time.h>
static
char
git_version
[]
=
"version: "
GIT_VERSION
;
/* Returns the numer of microsecond timer ticks (Tomasz Wlostowski) */
static
int64_t
get_tics
()
{
...
...
@@ -36,11 +38,22 @@ static void delay_to(int64_t until)
;
}
static
void
print_version
(
char
*
pname
)
{
printf
(
"%s %s
\n
"
,
pname
,
git_version
);
}
int
main
(
int
argc
,
char
**
argv
)
{
int
fd
,
addr
,
count
,
usec
;
int64_t
tics
;
if
((
argc
==
2
)
&&
(
!
strcmp
(
argv
[
1
],
"-V"
)
||
!
strcmp
(
argv
[
1
],
"--version"
)))
{
print_version
(
argv
[
0
]);
exit
(
0
);
}
if
(
argc
!=
4
)
{
fprintf
(
stderr
,
"%s: Use
\"
%s <hexaddr> <count> <period-usec>
\"\n
"
,
...
...
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