Fixed off-by-one error in flash erase

This commit is contained in:
Pavel Zakopaylo 2023-11-30 17:54:44 +11:00
parent c30287e49d
commit 87174b7682
No known key found for this signature in database
GPG Key ID: 9D4130BD5891F5CB

View File

@ -42,7 +42,7 @@ blisp_return_t blisp_single_download() {
printf("Erasing the area, this might take a while...\n");
ret = blisp_device_flash_erase(
&device, *single_download_location->ival,
*single_download_location->ival + data_file_size + 1);
*single_download_location->ival + data_file_size - 1);
if (ret != BLISP_OK) {
fprintf(stderr, "Failed to erase.\n");
goto exit2;