Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FMC DIO 5ch TTL a
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
6
Issues
6
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 DIO 5ch TTL a
Commits
acce51e1
Commit
acce51e1
authored
Nov 23, 2020
by
Jorge Machado
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
irq-demo: Add argument to select clock type
parent
91bc15aa
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
2 deletions
+16
-2
irq-demo-private.h
sw/irq-demo/irq-demo-private.h
+7
-0
irq-demo.c
sw/irq-demo/irq-demo.c
+9
-2
No files found.
sw/irq-demo/irq-demo-private.h
View file @
acce51e1
...
...
@@ -21,11 +21,18 @@
#define STATS_LOG_PATH "./.irq-demo.log"
#define MAX_FMC_DIO_PATH 100
typedef
enum
{
MONOTONIC
,
REALTIME
}
clock_type
;
struct
_user_args
{
char
fmc_dev_path
[
MAX_FMC_DIO_PATH
];
unsigned
int
irq_period
;
int
verbose
;
clock_type
clock
;
};
typedef
struct
_user_args
*
user_args
;
static
void
demo_irq_process_loop
(
fmc_dio_device
fmc_dev
,
stats_engine
engine
);
...
...
sw/irq-demo/irq-demo.c
View file @
acce51e1
...
...
@@ -227,7 +227,7 @@ static int parse_user_arguments(int argc, char *argv[], user_args parsed_args)
return
1
;
}
while
((
opt
=
getopt
(
argc
,
argv
,
"hvf:p:"
))
!=
-
1
)
{
while
((
opt
=
getopt
(
argc
,
argv
,
"hvf:p:
c:
"
))
!=
-
1
)
{
switch
(
opt
)
{
case
'f'
:
strncpy
(
parsed_args
->
fmc_dev_path
,
optarg
,
MAX_FMC_DIO_PATH
-
1
);
...
...
@@ -235,9 +235,15 @@ static int parse_user_arguments(int argc, char *argv[], user_args parsed_args)
case
'p'
:
sscanf
(
optarg
,
"%d"
,
&
parsed_args
->
irq_period
);
break
;
case
'v'
:
case
'v'
:
parsed_args
->
verbose
=
1
;
break
;
case
'c'
:
if
(
strcmp
(
optarg
,
"REALTIME"
)
==
0
)
parsed_args
->
clock
=
REALTIME
;
else
parsed_args
->
clock
=
MONOTONIC
;
break
;
case
'h'
:
default:
show_help
();
...
...
@@ -265,6 +271,7 @@ static void show_help(void)
printf
(
"%s -f <FMC DIO device path> [options]
\n
"
,
PROG_NAME
);
printf
(
"
\t
-f <path>
\t
Set FMC DIO device path
\n
"
);
printf
(
"
\t
-p <period>
\t
Set IRQ period (in nanoseconds)
\n
"
);
printf
(
"
\t
-c <MONOTONIC/REALTIME>
\t
Set the clock mode
\n
"
);
printf
(
"
\t
-v
\t\t
Enable verbose mode
\n
"
);
printf
(
"
\t
-h
\t\t
Show this help message
\n
"
);
printf
(
"Please, press 'q' key + ENTER or CNTRL+C to exit from the demo tool
\n
"
);
...
...
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