use COMMAND_HANDLER macro to define all commands
[openocd.git] / src / flash / flash.c
index 1a04e123f9db4e07a285bc16c8a9d307fe9660ef..d3889b9bf42cbd223f594b10f4a8b218a724b552 100644 (file)
@@ -215,7 +215,7 @@ int flash_command_get_bank_by_num(
 }
 
 
-static int handle_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_flash_bank_command)
 {
        int retval;
        int i;
@@ -295,7 +295,7 @@ static int handle_flash_bank_command(struct command_context_s *cmd_ctx, char *cm
        return ERROR_OK;
 }
 
-static int handle_flash_info_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_flash_info_command)
 {
        flash_bank_t *p;
        uint32_t i = 0;
@@ -357,7 +357,7 @@ static int handle_flash_info_command(struct command_context_s *cmd_ctx, char *cm
        return ERROR_OK;
 }
 
-static int handle_flash_probe_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_flash_probe_command)
 {
        int retval;
 
@@ -394,7 +394,7 @@ static int handle_flash_probe_command(struct command_context_s *cmd_ctx, char *c
        return ERROR_OK;
 }
 
-static int handle_flash_erase_check_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_flash_erase_check_command)
 {
        if (argc != 1)
        {
@@ -440,7 +440,7 @@ static int handle_flash_erase_check_command(struct command_context_s *cmd_ctx, c
        return ERROR_OK;
 }
 
-static int handle_flash_erase_address_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_flash_erase_address_command)
 {
        flash_bank_t *p;
        int retval;
@@ -484,7 +484,7 @@ static int handle_flash_erase_address_command(struct command_context_s *cmd_ctx,
        return retval;
 }
 
-static int handle_flash_protect_check_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_flash_protect_check_command)
 {
        if (argc != 1)
                return ERROR_COMMAND_SYNTAX_ERROR;
@@ -528,8 +528,7 @@ static int flash_check_sector_parameters(struct command_context_s *cmd_ctx,
        return ERROR_OK;
 }
 
-static int handle_flash_erase_command(struct command_context_s *cmd_ctx,
-               char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_flash_erase_command)
 {
        if (argc != 2)
                return ERROR_COMMAND_SYNTAX_ERROR;
@@ -569,8 +568,7 @@ static int handle_flash_erase_command(struct command_context_s *cmd_ctx,
        return ERROR_OK;
 }
 
-static int handle_flash_protect_command(struct command_context_s *cmd_ctx,
-               char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_flash_protect_command)
 {
        if (argc != 3)
                return ERROR_COMMAND_SYNTAX_ERROR;
@@ -614,7 +612,7 @@ static int handle_flash_protect_command(struct command_context_s *cmd_ctx,
        return ERROR_OK;
 }
 
-static int handle_flash_write_image_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_flash_write_image_command)
 {
        target_t *target = get_current_target(cmd_ctx);
 
@@ -704,7 +702,7 @@ static int handle_flash_write_image_command(struct command_context_s *cmd_ctx, c
        return retval;
 }
 
-static int handle_flash_fill_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_flash_fill_command)
 {
        int err = ERROR_OK;
        uint32_t address;
@@ -808,7 +806,7 @@ static int handle_flash_fill_command(struct command_context_s *cmd_ctx, char *cm
        return ERROR_OK;
 }
 
-static int handle_flash_write_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+COMMAND_HANDLER(handle_flash_write_bank_command)
 {
        uint32_t offset;
        uint8_t *buffer;

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)