From 67bd1bd46814d56b3774b36fed6a300c2027ad71 Mon Sep 17 00:00:00 2001 From: Pavel Zakopaylo Date: Thu, 30 Nov 2023 19:57:47 +1100 Subject: [PATCH] Minor fix: blisp_device_flash_erase errors were ignored --- lib/blisp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/blisp.c b/lib/blisp.c index b3d8f42..3ae2777 100644 --- a/lib/blisp.c +++ b/lib/blisp.c @@ -360,13 +360,13 @@ blisp_return_t blisp_device_flash_erase(struct blisp_device* device, *(uint32_t*)(payload + 4) = end_address; blisp_return_t ret = blisp_send_command(device, 0x30, payload, 8, true); - if (ret < 0) + if (ret != BLISP_OK) return ret; do { ret = blisp_receive_response(device, false); } while (ret == BLISP_ERR_PENDING); - return 0; + return ret; } blisp_return_t blisp_device_flash_write(struct blisp_device* device, @@ -414,4 +414,4 @@ blisp_return_t blisp_device_reset(struct blisp_device* device) { void blisp_device_close(struct blisp_device* device) { struct sp_port* serial_port = device->serial_port; sp_close(serial_port); -} \ No newline at end of file +}