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
6d60afcc
Commit
6d60afcc
authored
Apr 25, 2014
by
Michel Arruat
Committed by
Federico Vaga
Apr 30, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fald-acq: use status flags
parent
aa93b886
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
fald-acq.c
libtools/fald-acq.c
+7
-6
No files found.
libtools/fald-acq.c
View file @
6d60afcc
...
...
@@ -110,8 +110,8 @@ static char *basefile;
static
char
buf_fifo
[
MAX_BUF
];
static
char
*
_argv
[
16
];
static
int
_argc
;
#define
START_ACQ 1
#define
START_CHANGE_CFG 2
#define
ADC_STATE_START_ACQ (1 << 0)
#define
ADC_STATE_CHANGE_CFG (1 << 1)
#define START_POLL 1
/* default is 1 V*/
...
...
@@ -413,7 +413,7 @@ void *adc_wait_thread(void *arg)
}
fprintf
(
stdout
,
"%s fmc-adc_poll ends normally, send signal to readyToReadOrCfgCondVar requesting to read data
\n
"
,
__func__
);
pthread_mutex_lock
(
&
mtx
);
adc_state
=
START_ACQ
;
/* means start acquisition */
adc_state
|=
ADC_STATE_
START_ACQ
;
/* means start acquisition */
pthread_mutex_unlock
(
&
mtx
);
// Wake up the change config thread
pthread_cond_signal
(
&
readyToReadOrCfgCondVar
);
...
...
@@ -583,8 +583,9 @@ int main(int argc, char *argv[])
pthread_cond_wait
(
&
readyToReadOrCfgCondVar
,
&
mtx
);
//fprintf(stdout, "mainThread: waked up adc_state:%d\n", adc_state);
}
//fprintf(stdout, "mainThread: wakeup readyToReadOrCfgCondVar with adc_state: %s\n", ((adc_state==1)?"Read data":"Change trigger config"));
if
(
adc_state
==
START_CHANGE_CFG
)
{
/* change trigger config */
if
(
adc_state
&
ADC_STATE_CHANGE_CFG
)
{
/* change trigger config */
/* ack all even a START_ACQ because we will stop/start adc */
adc_state
=
0
;
/* ack */
pthread_mutex_unlock
(
&
mtx
);
fprintf
(
stdout
,
"mainThread: Change trig config starts .............
\n
"
);
...
...
@@ -603,7 +604,7 @@ int main(int argc, char *argv[])
continue
;
}
/* time to acquire data */
adc_state
=
0
;
/* ack it's
time to acquire data */
adc_state
&=
~
ADC_STATE_START_ACQ
;
/* ack
time to acquire data */
pthread_mutex_unlock
(
&
mtx
);
if
(
buf
==
NULL
)
{
/* buf has been released due to a change of trig config */
...
...
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