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
b8653944
Commit
b8653944
authored
May 08, 2014
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tools: use per device pipe
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
4e9bc047
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
4 deletions
+13
-4
fald-acq.c
libtools/fald-acq.c
+3
-2
fald-trg-cfg.c
libtools/fald-trg-cfg.c
+10
-2
No files found.
libtools/fald-acq.c
View file @
b8653944
...
...
@@ -105,6 +105,7 @@ static struct option options[] = {
/* variables shared between threads */
static
struct
fmcadc_dev
*
adc
;
unsigned
int
devid
=
0
;
static
pthread_mutex_t
mtx
;
static
pthread_cond_t
readyToPollCondVar
;
static
pthread_cond_t
readyToReadOrCfgCondVar
;
...
...
@@ -427,11 +428,12 @@ void *adc_wait_thread(void *arg)
void
*
change_config_thread
(
void
*
arg
)
{
int
fd
,
ret
;
char
*
adcfifo
=
"/tmp/adcfifo"
;
char
adcfifo
[
128
]
;
char
*
s
,
*
t
;
char
buf
[
MAX_BUF
];
if
(
access
(
adcfifo
,
F_OK
)
==
-
1
)
{
sprintf
(
adcfifo
,
"/tmp/adcfifo-%04x"
,
devid
);
/* create the FIFO (named pipe) */
mkfifo
(
adcfifo
,
0666
);
}
...
...
@@ -509,7 +511,6 @@ int main(int argc, char *argv[])
{
struct
fmcadc_buffer
*
buf
;
int
i
,
err
;
unsigned
int
devid
=
0
;
FILE
*
f
=
NULL
;
char
fname
[
PATH_MAX
];
char
cmd
[
256
];
...
...
libtools/fald-trg-cfg.c
View file @
b8653944
...
...
@@ -7,13 +7,21 @@
#include <string.h>
#include <errno.h>
int
main
()
int
main
(
int
argc
,
char
*
argv
[]
)
{
int
fd
;
char
*
adcfifo
=
"/tmp/adcfifo"
;
char
adcfifo
[
128
]
;
char
msg
[
512
],
*
ptr
;
unsigned
int
devid
;
if
(
argc
<
2
)
{
fprintf
(
stderr
,
"
\n
Usage:
\n
fald-trg-cfg <dev_id> [options]
\n
"
);
return
-
1
;
}
sscanf
(
argv
[
1
],
"%x"
,
&
devid
);
if
(
access
(
adcfifo
,
F_OK
)
==
-
1
)
{
sprintf
(
adcfifo
,
"/tmp/adcfifo-%04x"
,
devid
);
/* create the FIFO (named pipe) */
mkfifo
(
adcfifo
,
0666
);
}
...
...
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