Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FMC DEL 1ns 4cha
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
2
Issues
2
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 DEL 1ns 4cha
Commits
b2ca0d8d
Commit
b2ca0d8d
authored
May 08, 2012
by
Alessandro Rubini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lib: added fdelay_has_triggered()
parent
ca808c14
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
2 deletions
+14
-2
fdelay-lib.h
lib/fdelay-lib.h
+1
-0
fdelay-output.c
lib/fdelay-output.c
+13
-2
No files found.
lib/fdelay-lib.h
View file @
b2ca0d8d
...
...
@@ -75,6 +75,7 @@ extern int fdelay_config_pulse(struct fdelay_board *b,
int
channel
,
struct
fdelay_pulse
*
pulse
);
extern
int
fdelay_config_pulse_ps
(
struct
fdelay_board
*
b
,
int
channel
,
struct
fdelay_pulse_ps
*
ps
);
extern
int
fdelay_has_triggered
(
struct
fdelay_board
*
b
,
int
channel
);
extern
int
fdelay_wr_mode
(
struct
fdelay_board
*
b
,
int
on
);
extern
int
fdelay_check_wr_mode
(
struct
fdelay_board
*
b
);
...
...
lib/fdelay-output.c
View file @
b2ca0d8d
...
...
@@ -113,7 +113,7 @@ extern int fdelay_config_pulse(struct fdelay_board *userb,
}
/* The "pulse_ps" function relies on the previous one */
int
fdelay_config_pulse_ps
(
struct
fdelay_board
*
b
,
int
fdelay_config_pulse_ps
(
struct
fdelay_board
*
user
b
,
int
channel
,
struct
fdelay_pulse_ps
*
ps
)
{
struct
fdelay_pulse
p
;
...
...
@@ -124,8 +124,19 @@ int fdelay_config_pulse_ps(struct fdelay_board *b,
p
.
end
=
ps
->
start
;
// fdelay_add_ps(&p.end, ps->length);
fdelay_pico_to_time
(
&
ps
->
period
,
&
p
.
loop
);
return
fdelay_config_pulse
(
b
,
channel
,
&
p
);
return
fdelay_config_pulse
(
user
b
,
channel
,
&
p
);
}
int
fdelay_has_triggered
(
struct
fdelay_board
*
userb
,
int
channel
)
{
__define_board
(
b
,
userb
);
char
s
[
32
];
uint32_t
mode
;
sprintf
(
s
,
"fd-ch%i/mode"
,
channel
+
1
);
if
(
fdelay_sysfs_get
(
b
,
s
,
&
mode
)
<
0
)
return
-
1
;
/* errno already set */
return
(
mode
&
0x80
)
!=
0
;
}
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