Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FMC ADC 100M 14b 4cha
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 ADC 100M 14b 4cha
Commits
ea517d8b
Commit
ea517d8b
authored
Apr 22, 2014
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lib: bugfix: disable trigger _only_ when writing config
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
983a1ad3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
10 deletions
+12
-10
config-zio.c
lib/config-zio.c
+12
-10
No files found.
lib/config-zio.c
View file @
ea517d8b
...
...
@@ -330,15 +330,17 @@ static int fmcadc_zio_config(struct __fmcadc_dev_zio *fa, unsigned int flags,
int
err
,
i
;
uint32_t
enabled
;
err
=
fa_zio_sysfs_get
(
fa
,
"cset0/trigger/enable"
,
&
enabled
);
if
(
err
)
return
err
;
if
(
enabled
)
{
/* disable the trigger before changing config */
enabled
=
0
;
err
=
fa_zio_sysfs_set
(
fa
,
"cset0/trigger/enable"
,
&
enabled
);
/* restore the initial value */
enabled
=
1
;
/* Disabling the trigger before changing configuration */
if
(
direction
)
{
err
=
fa_zio_sysfs_get
(
fa
,
"cset0/trigger/enable"
,
&
enabled
);
if
(
err
)
return
err
;
if
(
enabled
)
{
enabled
=
0
;
err
=
fa_zio_sysfs_set
(
fa
,
"cset0/trigger/enable"
,
&
enabled
);
/* restore the initial value */
enabled
=
1
;
}
}
for
(
i
=
0
;
i
<
__FMCADC_CONF_LEN
;
++
i
)
{
...
...
@@ -377,7 +379,7 @@ static int fmcadc_zio_config(struct __fmcadc_dev_zio *fa, unsigned int flags,
}
/* if the trigger was enabled restore it */
if
(
enabled
)
if
(
direction
&&
enabled
)
err
|=
fa_zio_sysfs_set
(
fa
,
"cset0/trigger/enable"
,
&
enabled
);
return
err
;
}
...
...
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