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
2f4f2de6
Commit
2f4f2de6
authored
Oct 21, 2020
by
Miguel Jimenez Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
irq-demo: Add a new mode to only use the last timestamp for the stats
parent
a2b5e1a7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
5 deletions
+16
-5
irq-demo-private.h
sw/irq-demo/irq-demo-private.h
+1
-1
irq-demo.c
sw/irq-demo/irq-demo.c
+15
-4
No files found.
sw/irq-demo/irq-demo-private.h
View file @
2f4f2de6
...
@@ -33,7 +33,7 @@ typedef struct _user_args * user_args;
...
@@ -33,7 +33,7 @@ typedef struct _user_args * user_args;
static
void
demo_irq_process_loop
(
fmc_dio_device
fmc_dev
,
stats_engine
engine
,
static
void
demo_irq_process_loop
(
fmc_dio_device
fmc_dev
,
stats_engine
engine
,
unsigned
int
sleep_us
);
unsigned
int
sleep_us
);
static
void
process_timestamps_to_engine
(
stats_engine
engine
,
struct
usr_timestamp
*
ts
,
static
void
process_timestamps_to_engine
(
stats_engine
engine
,
struct
usr_timestamp
*
ts
,
unsigned
int
nts
);
unsigned
int
nts
,
int
last_only
);
static
user_args
create_user_arguments
(
void
);
static
user_args
create_user_arguments
(
void
);
static
int
parse_user_arguments
(
int
argc
,
char
*
argv
[],
user_args
parsed_args
);
static
int
parse_user_arguments
(
int
argc
,
char
*
argv
[],
user_args
parsed_args
);
...
...
sw/irq-demo/irq-demo.c
View file @
2f4f2de6
...
@@ -167,18 +167,29 @@ static void demo_irq_process_loop(fmc_dio_device fmc_dev, stats_engine engine,
...
@@ -167,18 +167,29 @@ static void demo_irq_process_loop(fmc_dio_device fmc_dev, stats_engine engine,
*/
*/
do
{
do
{
ret
=
get_utc_ts_from_fmc_dio_device
(
fmc_dev
,
TEST_FMC_DIO_CH
,
&
ts
,
&
nts
);
ret
=
get_utc_ts_from_fmc_dio_device
(
fmc_dev
,
TEST_FMC_DIO_CH
,
&
ts
,
&
nts
);
process_timestamps_to_engine
(
engine
,
ts
,
nts
);
if
(
!
ret
)
{
// Use only the last TS for stats
process_timestamps_to_engine
(
engine
,
ts
,
nts
,
1
);
}
usleep
(
sleep_us
);
usleep
(
sleep_us
);
user_stop
=
check_user_stop
();
user_stop
=
check_user_stop
();
}
while
(
!
user_stop
);
}
while
(
!
user_stop
);
}
}
static
void
process_timestamps_to_engine
(
stats_engine
engine
,
struct
usr_timestamp
*
ts
,
static
void
process_timestamps_to_engine
(
stats_engine
engine
,
struct
usr_timestamp
*
ts
,
unsigned
int
nts
)
unsigned
int
nts
,
int
last_only
)
{
{
for
(
int
i
=
0
;
i
<
nts
;
i
++
)
{
struct
usr_timestamp
*
ts_to_process
=
ts
;
unsigned
int
nts_to_process
=
nts
;
if
(
last_only
)
{
ts_to_process
=
&
ts
[
nts
-
1
];
nts_to_process
=
1
;
}
for
(
int
i
=
0
;
i
<
nts_to_process
;
i
++
)
{
/* Pass a timestamp to stats engine */
/* Pass a timestamp to stats engine */
add_usr_timestamp_to_stats_engine
(
engine
,
&
ts
[
i
]);
add_usr_timestamp_to_stats_engine
(
engine
,
&
ts
_to_process
[
i
]);
/* Compute stats taking into consideration all the timestamps inside the engine */
/* Compute stats taking into consideration all the timestamps inside the engine */
run_stats_engine
(
engine
,
verbose_mode
);
run_stats_engine
(
engine
,
verbose_mode
);
}
}
...
...
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