X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=blobdiff_plain;f=src%2Fflash%2Fnor%2Fpsoc6.c;h=a929d33043379332349accf395eb8385982ddea8;hp=931404e3eab5eac75dcd4c3cef0c653383bc0977;hb=c4e6034e26b40cc440356eb35b3372b220806e5e;hpb=608299484d52a60082bb7ff5bcde5249f9a3a1de diff --git a/src/flash/nor/psoc6.c b/src/flash/nor/psoc6.c index 931404e3ea..a929d33043 100644 --- a/src/flash/nor/psoc6.c +++ b/src/flash/nor/psoc6.c @@ -24,6 +24,7 @@ #include #include "imp.h" +#include #include "target/target.h" #include "target/cortex_m.h" #include "target/breakpoints.h" @@ -495,7 +496,7 @@ static const char *protection_to_str(uint8_t protection) * @param buf_size size of the buffer * @return ERROR_OK in case of success, ERROR_XXX code otherwise *************************************************************************************************/ -static int psoc6_get_info(struct flash_bank *bank, char *buf, int buf_size) +static int psoc6_get_info(struct flash_bank *bank, struct command_invocation *cmd) { struct psoc6_target_info *psoc6_info = bank->driver_priv; @@ -506,7 +507,7 @@ static int psoc6_get_info(struct flash_bank *bank, char *buf, int buf_size) if (hr != ERROR_OK) return hr; - snprintf(buf, buf_size, + command_print_sameline(cmd, "PSoC6 Silicon ID: 0x%08" PRIX32 "\n" "Protection: %s\n" "Main Flash size: %" PRIu32 " kB\n" @@ -744,9 +745,6 @@ static int psoc6_erase(struct flash_bank *bank, unsigned int first, if (hr != ERROR_OK) goto exit_free_wa; - for (unsigned int i = first; i < first + rows_in_sector; i++) - bank->sectors[i].is_erased = 1; - first += rows_in_sector; } else { /* Perform Row Erase otherwise */ @@ -754,7 +752,6 @@ static int psoc6_erase(struct flash_bank *bank, unsigned int first, if (hr != ERROR_OK) goto exit_free_wa; - bank->sectors[first].is_erased = 1; first += 1; } } @@ -873,7 +870,6 @@ exit: /** *********************************************************************************************** * @brief Performs Mass Erase operation - * @param bank flash bank index to erase * @return ERROR_OK in case of success, ERROR_XXX code otherwise *************************************************************************************************/ COMMAND_HANDLER(psoc6_handle_mass_erase_command)