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
c9fb1743
Commit
c9fb1743
authored
May 14, 2020
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lib: add strerror function
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
dfedced2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
0 deletions
+20
-0
fdelay-init.c
lib/fdelay-init.c
+14
-0
fdelay-lib.h
lib/fdelay-lib.h
+6
-0
No files found.
lib/fdelay-init.c
View file @
c9fb1743
...
...
@@ -229,3 +229,17 @@ float fdelay_read_temperature(struct fdelay_board *userb)
fdelay_sysfs_get
(
b
,
"temperature"
,
&
t
);
return
(
float
)
t
/
16
.
0
;
}
static
const
char
*
fdelay_error_string
[]
=
{
};
/**
* It returns the error message associated to the given error code
* @param[in] err error code
*/
const
char
*
fdelay_strerror
(
int
err
)
{
if
(
err
<
__FDELAY_ERR_MIN
||
err
>
__FDELAY_ERR_MAX
)
return
strerror
(
err
);
return
fdelay_error_string
[
err
-
__FDELAY_ERR_MIN
];
}
lib/fdelay-lib.h
View file @
c9fb1743
...
...
@@ -22,6 +22,11 @@ extern "C" {
#include <stdint.h>
#include "fine-delay.h"
#define __FDELAY_ERR_MIN 4096
enum
fmctdc_error_numbers
{
__FDELAY_ERR_MAX
=
__FDELAY_ERR_MIN
,
};
/* Convenience macro for converting the physical output connector
numbers (as seen on the mezzanine's front panel) to convention used
by the drive (0..3). We keep 0..3 indexing to maintain library
...
...
@@ -67,6 +72,7 @@ struct fdelay_pulse_ps {
extern
int
fdelay_init
(
void
);
extern
void
fdelay_exit
(
void
);
extern
const
char
*
fdelay_strerror
(
int
err
);
extern
struct
fdelay_board
*
fdelay_open
(
int
offset
,
int
dev_id
);
extern
struct
fdelay_board
*
fdelay_open_by_lun
(
int
lun
);
...
...
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