Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
FMC ADC 100M 14b 4cha
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
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 ADC 100M 14b 4cha
Commits
ead4dcbf
Commit
ead4dcbf
authored
Jul 05, 2021
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sw: follow cppcheck suggestion about endianess conversion
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
e6c895c4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
16 deletions
+9
-16
fau-calibration.c
software/tools/fau-calibration.c
+9
-16
No files found.
software/tools/fau-calibration.c
View file @
ead4dcbf
...
...
@@ -69,17 +69,17 @@ static int fau_calibration_read(char *path, struct fa_calib *calib,
static
void
fau_calibration_dump_stanza
(
const
struct
fa_calib_stanza
*
stanza
)
{
fprintf
(
stdout
,
" temperature: %f C
\n
"
,
stanza
->
temperature
*
0
.
01
);
le16toh
(
stanza
->
temperature
)
*
0
.
01
);
fprintf
(
stdout
,
" gain: [0x%04"
PRIx16
", 0x%04"
PRIx16
", 0x%04"
PRIx16
", 0x%04"
PRIx16
"]
\n
"
,
stanza
->
gain
[
0
]
,
stanza
->
gain
[
1
]
,
stanza
->
gain
[
2
]
,
stanza
->
gain
[
3
]
);
le16toh
(
stanza
->
gain
[
0
])
,
le16toh
(
stanza
->
gain
[
1
])
,
le16toh
(
stanza
->
gain
[
2
])
,
le16toh
(
stanza
->
gain
[
3
])
);
fprintf
(
stdout
,
" offset: [0x%04"
PRIx16
", 0x%04"
PRIx16
", 0x%04"
PRIx16
", 0x%04"
PRIx16
"]
\n
"
,
stanza
->
offset
[
0
]
,
stanza
->
offset
[
1
]
,
stanza
->
offset
[
2
]
,
stanza
->
offset
[
3
]
);
le16toh
(
stanza
->
offset
[
0
])
,
le16toh
(
stanza
->
offset
[
1
])
,
le16toh
(
stanza
->
offset
[
2
])
,
le16toh
(
stanza
->
offset
[
3
])
);
}
/**
...
...
@@ -88,13 +88,6 @@ static void fau_calibration_dump_stanza(const struct fa_calib_stanza *stanza)
*/
static
void
fau_calibration_dump_human
(
const
struct
fa_calib
*
calib
)
{
uint16_t
*
data16
=
(
uint16_t
*
)
calib
;
int
i
;
/* Fix endianess */
for
(
i
=
0
;
i
<
sizeof
(
*
calib
)
/
sizeof
(
uint16_t
);
++
i
)
data16
[
i
]
=
le16toh
(
data16
[
i
]);
fputs
(
"ADC Range 100mV
\n
"
,
stdout
);
fau_calibration_dump_stanza
(
&
calib
->
adc
[
FA100M14B4C_RANGE_100mV
]);
fputs
(
"DAC Range 100mV
\n
"
,
stdout
);
...
...
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