aboutsummaryrefslogtreecommitdiff
path: root/hal_io_fmc.c
diff options
context:
space:
mode:
authorPaul Selkirk <paul@psgd.org>2018-08-15 17:30:14 -0400
committerPaul Selkirk <paul@psgd.org>2018-08-15 17:30:14 -0400
commit255ebc59bf1000af6715217679bc82d5bc4d536b (patch)
treedc2250e980c5aea753b781fc3b7641f898e000ad /hal_io_fmc.c
parenta0940d97b4aa3d45c77fbec95092829ca90b1eaf (diff)
Add support for Joachim's keywrap core.
Diffstat (limited to 'hal_io_fmc.c')
-rw-r--r--hal_io_fmc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/hal_io_fmc.c b/hal_io_fmc.c
index 8a32921..07f9352 100644
--- a/hal_io_fmc.c
+++ b/hal_io_fmc.c
@@ -114,7 +114,8 @@ hal_error_t hal_io_write(const hal_core_t *core, hal_addr_t offset, const uint8_
for (; len > 0; offset += 4, buf += 4, len -= 4) {
uint32_t val;
val = htonl(*(uint32_t *)buf);
- fmc_write_32(offset, val);
+ if (fmc_write_32(offset, val) != 0)
+ return HAL_ERROR_IO_TIMEOUT;
}
return HAL_OK;
@@ -140,7 +141,8 @@ hal_error_t hal_io_read(const hal_core_t *core, hal_addr_t offset, uint8_t *buf,
offset = fmc_offset(offset + hal_core_base(core));
for (; rlen > 0; offset += 4, rbuf += 4, rlen -= 4) {
uint32_t val;
- fmc_read_32(offset, &val);
+ if (fmc_read_32(offset, &val) != 0)
+ return HAL_ERROR_IO_TIMEOUT;
*(uint32_t *)rbuf = ntohl(val);
}