Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FMC TDC 1ns 5cha - 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 TDC 1ns 5cha - Software
Commits
67cfcfa7
Commit
67cfcfa7
authored
Sep 11, 2012
by
Miguel Gómez Sexto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tdc: store channel activation in the library structure
Signed-off-by:
Miguel Gomez
<
magomez@igalia.com
>
parent
b4a073d2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
0 deletions
+6
-0
libtdc.c
lib/libtdc.c
+5
-0
libtdc.h
lib/libtdc.h
+1
-0
No files found.
lib/libtdc.c
View file @
67cfcfa7
...
...
@@ -94,9 +94,11 @@ int tdc_init(void)
for
(
j
=
0
;
j
<
ARRAY_SIZE
(
b
->
ctrl
);
j
++
)
{
b
->
ctrl
[
j
]
=
-
1
;
b
->
data
[
j
]
=
-
1
;
b
->
enabled
[
j
]
=
0
;
}
printf
(
"Found device %s
\n
"
,
b
->
sysbase
);
}
globfree
(
&
glob_dev
);
globfree
(
&
glob_sys
);
...
...
@@ -120,6 +122,7 @@ void tdc_exit(void)
b
->
data
[
j
]
=
-
1
;
err
++
;
}
b
->
enabled
[
j
]
=
0
;
}
if
(
err
)
fprintf
(
stderr
,
"%s: device %s was still open
\n
"
,
...
...
@@ -259,8 +262,10 @@ int tdc_set_active_channels(struct tdc_board *b, uint32_t config)
sprintf
(
file
,
"tdc-cset%i/enable"
,
i
);
if
(
config
&
(
1
<<
i
))
{
res
=
tdc_sysfs_set
(
b
,
file
,
1
);
b
->
enabled
[
i
]
=
1
;
}
else
{
res
=
tdc_sysfs_set
(
b
,
file
,
0
);
b
->
enabled
[
i
]
=
0
;
}
if
(
res
)
{
printf
(
"Error setting ZIO chan config in cset %i
\n
"
,
i
);
...
...
lib/libtdc.h
View file @
67cfcfa7
...
...
@@ -9,6 +9,7 @@ struct tdc_board {
char
*
sysbase
;
int
ctrl
[
5
];
/* The 5 control channels */
int
data
[
5
];
/* The 5 data channels */
int
enabled
[
5
];
/* channel activation */
};
struct
tdc_time
{
...
...
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