X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=src%2Fflash%2Fflash.h;h=05c4b2c48f70b81c2b4d862e0b3982c348131dd8;hb=2689f58f2a0afa296a29ab301a4c1665b914caab;hp=655474438ebfd2d9b322fcadb8d74ea3fd934ead;hpb=48b3b3afba52924bbb0373a4577e27058774b6f5;p=openocd diff --git a/src/flash/flash.h b/src/flash/flash.h index 65547443..05c4b2c4 100644 --- a/src/flash/flash.h +++ b/src/flash/flash.h @@ -2,7 +2,7 @@ * Copyright (C) 2005 by Dominic Rath * * Dominic.Rath@gmx.de * * * - * Copyright (C) 2007,2008 Øyvind Harboe * + * Copyright (C) 2007,2008 Øyvind Harboe * * oyvind.harboe@zylin.com * * * * Copyright (C) 2008 by Spencer Oliver * @@ -313,6 +313,16 @@ extern int default_flash_mem_blank_check(struct flash_bank_s *bank); * @returns A flash_bank_t for flash bank @a num, or NULL */ extern flash_bank_t *get_flash_bank_by_num(int num); +/** + * Retreives @a bank from a command argument, reporting errors parsing + * the bank identifier or retreiving the specified bank. + * @param cmd_ctx The command context for reporting errors. + * @param str The string containing the bank identifier. + * @param bank On output, contians a pointer to the bank or NULL. + * @returns ERROR_OK on success, or an error indicating the problem. + */ +int flash_command_get_bank_by_num( + struct command_context_s *cmd_ctx, char *str, flash_bank_t **bank); /** * Returns the flash bank like get_flash_bank_by_num(), without probing. * @param num The flash bank number.