Commit 992f1c11 authored by Tristan Gingold's avatar Tristan Gingold

Merge branch '3-implement-reset' into 'master'

libwrtd.c: handle reset argument

Closes #3

See merge request be-cem-edl/chronos/wrtd!3
parents 9b999661 1c14f5da
......@@ -117,7 +117,7 @@ wrtd_status wrtd_get_node_id(uint32_t index, uint32_t *node_id)
* Initialize the WRTD Node and obtain the WRTD device token.
*
* @param[in] node_id WRTD Node ID
* @param[in] reset Reserved for future use.
* @param[in] reset Reset node.
* @param[in] options_str Reserved for future use.
* @param[out] wrtd Pointer to WRTD device token.
* @return #wrtd_status
......@@ -138,7 +138,7 @@ wrtd_status wrtd_init(uint32_t node_id,
trtl = trtl_open_by_id(node_id);
if (trtl == NULL)
if (trtl == NULL)
return WRTD_ERROR_RESOURCE_UNKNOWN;
wrtd_dev *res;
......@@ -180,6 +180,12 @@ wrtd_status wrtd_init(uint32_t node_id,
*wrtd = res;
if (reset) {
status = wrtd_reset(res);
if (status != WRTD_SUCCESS)
return status;
}
return WRTD_SUCCESS;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment