Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
M
mock-turtle
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
hdl-core-lib
mock-turtle
Commits
d59628cd
Commit
d59628cd
authored
Aug 27, 2018
by
Tristan Gingold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add trtl_fw_ping_timeout.
parent
d8d70096
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
4 deletions
+25
-4
libmockturtle-rt-msg.c
software/lib/libmockturtle-rt-msg.c
+21
-4
libmockturtle.h
software/lib/libmockturtle.h
+4
-0
No files found.
software/lib/libmockturtle-rt-msg.c
View file @
d59628cd
...
...
@@ -55,11 +55,13 @@ int trtl_fw_version(struct trtl_dev *trtl,
* @param[in] trtl device token
* @param[in] idx_cpu CPU index
* @param[in] idx_hmq HMQ index
* @param[in] timeout_ms timeout
* @return 0 on success, -1 on error and errno is set appropriately
*/
int
trtl_fw_ping
(
struct
trtl_dev
*
trtl
,
unsigned
int
idx_cpu
,
unsigned
int
idx_hmq
)
int
trtl_fw_ping_timeout
(
struct
trtl_dev
*
trtl
,
unsigned
int
idx_cpu
,
unsigned
int
idx_hmq
,
int
timeout_ms
)
{
struct
trtl_desc
*
wdesc
=
(
struct
trtl_desc
*
)
trtl
;
struct
trtl_msg
msg
;
...
...
@@ -72,7 +74,7 @@ int trtl_fw_ping(struct trtl_dev *trtl,
msg
.
hdr
.
flags
=
TRTL_HMQ_HEADER_FLAG_RPC
;
err
=
trtl_msg_sync
(
trtl
,
idx_cpu
,
idx_hmq
,
&
msg
,
&
msg
,
t
rtl_default_t
imeout_ms
);
timeout_ms
);
if
(
err
<
0
)
return
-
1
;
if
(
msg
.
hdr
.
msg_id
!=
TRTL_MSG_ID_PING
)
{
...
...
@@ -83,6 +85,21 @@ int trtl_fw_ping(struct trtl_dev *trtl,
return
0
;
}
/**
* It checks if firmware core is running and answering to messages
* @param[in] trtl device token
* @param[in] idx_cpu CPU index
* @param[in] idx_hmq HMQ index
* @return 0 on success, -1 on error and errno is set appropriately
*/
int
trtl_fw_ping
(
struct
trtl_dev
*
trtl
,
unsigned
int
idx_cpu
,
unsigned
int
idx_hmq
)
{
return
trtl_fw_ping_timeout
(
trtl
,
idx_cpu
,
idx_hmq
,
trtl_default_timeout_ms
);
}
static
int
__trtl_fw_variable
(
struct
trtl_dev
*
trtl
,
unsigned
int
idx_cpu
,
unsigned
int
idx_hmq
,
...
...
software/lib/libmockturtle.h
View file @
d59628cd
...
...
@@ -205,6 +205,10 @@ extern int trtl_fw_version(struct trtl_dev *trtl,
unsigned
int
idx_cpu
,
unsigned
int
idx_hmq
,
struct
trtl_fw_version
*
version
);
extern
int
trtl_fw_ping_timeout
(
struct
trtl_dev
*
trtl
,
unsigned
int
idx_cpu
,
unsigned
int
idx_hmq
,
int
timeout_ms
);
extern
int
trtl_fw_ping
(
struct
trtl_dev
*
trtl
,
unsigned
int
idx_cpu
,
unsigned
int
idx_hmq
);
...
...
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