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
f9c88b31
Commit
f9c88b31
authored
Nov 12, 2020
by
Miguel Jimenez Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
irq-demo: Add a basic error reporting mechanism in the main() function
parent
63201f33
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
irq-demo.c
sw/irq-demo/irq-demo.c
+7
-2
No files found.
sw/irq-demo/irq-demo.c
View file @
f9c88b31
...
...
@@ -53,7 +53,7 @@ int main(int argc, char *argv[])
log_device
gen_log
;
log_device
stats_log
;
user_args
user_arguments
;
log_device
logs
[
2
];
log_device
logs
[
2
]
,
err_log
;
unsigned
int
n_logs
=
2
;
stats_engine
sengine
;
int
ret
=
0
;
...
...
@@ -68,14 +68,17 @@ int main(int argc, char *argv[])
/* Loggers are stored in array:
* -[0]: General logger for stdout
* -[1]: File logger for stats
* -err_log: General logger to report main errors
*/
logs
[
0
]
=
gen_log
;
logs
[
1
]
=
stats_log
;
err_log
=
gen_log
;
/* Parse user arguments (FMC DIO dev entry path and optionally irq period) */
user_arguments
=
create_user_arguments
();
if
(
parse_user_arguments
(
argc
,
argv
,
user_arguments
))
{
/* In case of failure, show the help message and exit */
/* In case of failure, exit */
send_to_log_device
(
err_log
,
"Error parsing user arguments
\n
"
);
ret
=
1
;
goto
out_log
;
}
...
...
@@ -87,6 +90,7 @@ int main(int argc, char *argv[])
sengine
=
create_stats_engine
();
if
(
check_stats_engine
(
sengine
))
{
/* In case of failure, exit */
send_to_log_device
(
err_log
,
"Error initializing stats engine
\n
"
);
ret
=
1
;
goto
out_user_args
;
}
...
...
@@ -101,6 +105,7 @@ int main(int argc, char *argv[])
dev
=
create_fmc_dio_device
(
user_arguments
->
fmc_dev_path
);
if
(
open_fmc_dio_device
(
dev
))
{
/* In case of failure, exit */
send_to_log_device
(
err_log
,
"Error opening FMC DIO device
\n
"
);
ret
=
1
;
goto
out_stats_engine
;
}
...
...
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