| 354 | } |
| 355 | |
| 356 | error_t flash_decoder_close(void) |
| 357 | { |
| 358 | error_t status = ERROR_SUCCESS; |
| 359 | decoder_state_t prev_state = state; |
| 360 | flash_decoder_printf("flash_decoder_close()\r\n"); |
| 361 | |
| 362 | if (DECODER_STATE_CLOSED == state) { |
| 363 | util_assert(0); |
| 364 | return ERROR_INTERNAL; |
| 365 | } |
| 366 | |
| 367 | state = DECODER_STATE_CLOSED; |
| 368 | |
| 369 | if (flash_initialized) { |
| 370 | status = flash_manager_uninit(); |
| 371 | flash_decoder_printf(" flash_manager_uninit ret %i\r\n", status); |
| 372 | } |
| 373 | |
| 374 | if ((DECODER_STATE_DONE != prev_state) && |
| 375 | (flash_type != FLASH_DECODER_TYPE_TARGET) && |
| 376 | (status == ERROR_SUCCESS)) { |
| 377 | status = ERROR_IAP_UPDT_INCOMPLETE; |
| 378 | } |
| 379 | |
| 380 | return status; |
| 381 | } |
| 382 | |
| 383 | static bool flash_decoder_is_at_end(uint32_t addr, const uint8_t *data, uint32_t size) |
| 384 | { |
no test coverage detected