aboutsummaryrefslogtreecommitdiff
path: root/stm-fpgacfg.c
diff options
context:
space:
mode:
authorPaul Selkirk <paul@psgd.org>2017-10-15 21:34:00 -0400
committerPaul Selkirk <paul@psgd.org>2017-10-15 21:34:00 -0400
commit5af4a915edf3e77705fa2625081200b61f8dda26 (patch)
tree46d8e3cc6e27627e9f3e78c5a0b4a3573d1b1de3 /stm-fpgacfg.c
parentb159bf0bb24a99c7d3ff1b3855f840add63198e5 (diff)
Cleanup: All drivers return HAL_StatusTypeDef rather than magic values.
Note: This affects libhal/ks_token.c, which uses the keystore driver directly.
Diffstat (limited to 'stm-fpgacfg.c')
-rw-r--r--stm-fpgacfg.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/stm-fpgacfg.c b/stm-fpgacfg.c
index b2f09d0..54342bf 100644
--- a/stm-fpgacfg.c
+++ b/stm-fpgacfg.c
@@ -68,12 +68,12 @@ void fpgacfg_init(void)
HAL_SPI_Init(&hspi_fpgacfg);
}
-int fpgacfg_check_id(void)
+HAL_StatusTypeDef fpgacfg_check_id(void)
{
return n25q128_check_id(&fpgacfg_ctx);
}
-int fpgacfg_write_data(uint32_t offset, const uint8_t *buf, const uint32_t len)
+HAL_StatusTypeDef fpgacfg_write_data(uint32_t offset, const uint8_t *buf, const uint32_t len)
{
return n25q128_write_data(&fpgacfg_ctx, offset, buf, len);
}
@@ -113,13 +113,12 @@ void fpgacfg_reset_fpga(enum fpgacfg_reset reset)
}
}
-int fpgacfg_check_done(void)
+HAL_StatusTypeDef fpgacfg_check_done(void)
{
- GPIO_PinState status = HAL_GPIO_ReadPin(FPGA_DONE_Port, FPGA_DONE_Pin);
- return (status == GPIO_PIN_SET);
+ return (HAL_GPIO_ReadPin(FPGA_DONE_Port, FPGA_DONE_Pin) == GPIO_PIN_SET) ? HAL_OK : HAL_ERROR;
}
-int fpgacfg_erase_sector(uint32_t sector_offset)
+HAL_StatusTypeDef fpgacfg_erase_sector(uint32_t sector_offset)
{
return n25q128_erase_sector(&fpgacfg_ctx, sector_offset);
}