Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
Software for White Rabbit PTP Core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
32
Issues
32
List
Board
Labels
Milestones
Merge Requests
6
Merge Requests
6
CI / CD
CI / CD
Pipelines
Schedules
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
Software for White Rabbit PTP Core
Commits
b81ccb99
Commit
b81ccb99
authored
Apr 06, 2020
by
Tomasz Wlostowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dev/storage: fix 2 trivial bugs in calibration parameter code
parent
7f8d1c2d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
4 deletions
+9
-4
storage.c
dev/storage.c
+7
-2
storage.h
include/storage.h
+2
-2
No files found.
dev/storage.c
View file @
b81ccb99
...
...
@@ -709,6 +709,9 @@ int storage_set_calibration_parameter( int id, uint32_t val )
cal_data
.
params
[
cal_data
.
param_count
].
id
=
id
;
cal_data
.
params
[
cal_data
.
param_count
].
value
=
val
;
cal_data
.
param_count
++
;
return
storage_save_calibration
();
}
wrc_cal_data_t
*
storage_get_calibration_data
(
void
)
...
...
@@ -752,6 +755,9 @@ int storage_load_calibration(void)
goto
out_close
;
}
storage_dbg
(
"Loaded %d calibration params, checksum = 0x%x
\n
"
,
cal_data
.
param_count
,
cal_data
.
checksum
);
out_close:
sdbfs_close
(
&
wrc_sdbfs
);
return
ret
;
...
...
@@ -788,7 +794,7 @@ int storage_phtrans(uint32_t *valp, uint8_t write)
if
(
!
write
)
return
storage_get_calibration_parameter
(
CAL_PARAM_T24P
,
valp
);
else
return
storage_set_calibration_parameter
(
CAL_PARAM_T24P
,
valp
);
return
storage_set_calibration_parameter
(
CAL_PARAM_T24P
,
*
valp
);
}
...
...
@@ -907,7 +913,6 @@ static int sdbfs_read_callback(struct sdbfs *fs, int offset, void *buf, int coun
static
int
sdbfs_write_callback
(
struct
sdbfs
*
fs
,
int
offset
,
void
*
buf
,
int
count
)
{
struct
storage_device
*
dev
=
(
struct
storage_device
*
)
fs
->
drvdata
;
pp_printf
(
"write %x %d
\n
"
,
offset
,
count
);
return
dev
->
rwops
->
write
(
dev
,
offset
,
buf
,
count
);
}
...
...
include/storage.h
View file @
b81ccb99
...
...
@@ -18,11 +18,11 @@
#define ASCII_TO_U32(a, b, c, d) ((((uint32_t)(a)&0xff) << 24) | \
(((uint32_t)(b)&0xff) << 16) | \
(((uint32_t)(c)&0xff) << 8) | \
(((uint32_t)(d)&0xff) <<
16
))
(((uint32_t)(d)&0xff) <<
0
))
#define CAL_PARAM_T24P ASCII_TO_U32('t', '2', '4', 'p')
#define CAL_PARAM_PHY_TARGET_TX_PHASE ASCII_TO_U32('l', 'p', 't', 'p')
#define CAL_PARAM_DDS_LO_IOUPDATE_DELAY_PS ASCII_TO_U32('e', '1', '4', '0')
#define CAL_PARAM_DDS_LO_IOUPDATE_DELAY_PS ASCII_TO_U32('e', '1', '4', '0')
#define CAL_PARAM_DDS_REF_IOUPDATE_DELAY_PS ASCII_TO_U32('e', '1', '4', '1')
#define CAL_PARAM_CLKA_SYNC_DELAY_PS ASCII_TO_U32('e', '1', '4', '2')
#define CAL_PARAM_CLKB_SYNC_DELAY_PS ASCII_TO_U32('e', '1', '4', '3')
...
...
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