command_handler: change to 'argc' to CMD_ARGC
[openocd.git] / src / flash / ecos.c
index da3540731ca00552627471956808fbbc2283a97f..8d2d3eecf4754c2e46e9e1bbe382914e12cb4237 100644 (file)
 #include "flash.h"
 #include "embeddedice.h"
 #include "image.h"
+#include "algorithm.h"
 
 
 #if 0
 static uint32_t ecosflash_get_flash_status(struct flash_bank *bank);
 static void ecosflash_set_flash_mode(struct flash_bank *bank,int mode);
 static uint32_t ecosflash_wait_status_busy(struct flash_bank *bank, uint32_t waitbits, int timeout);
-static int ecosflash_handle_gpnvm_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
+static int ecosflash_handle_gpnvm_command(struct command_context *cmd_ctx, char *cmd, char **args, int argc);
 #endif
 
 struct ecosflash_flash_bank
@@ -108,7 +109,7 @@ FLASH_BANK_COMMAND_HANDLER(ecosflash_flash_bank_command)
 {
        struct ecosflash_flash_bank *info;
 
-       if (argc < 7)
+       if (CMD_ARGC < 7)
        {
                LOG_WARNING("incomplete flash_bank ecosflash configuration");
                return ERROR_FLASH_BANK_INVALID;
@@ -151,8 +152,8 @@ FLASH_BANK_COMMAND_HANDLER(ecosflash_flash_bank_command)
 
 static int loadDriver(struct ecosflash_flash_bank *info)
 {
-       uint32_t buf_cnt;
-       uint32_t image_size;
+       size_t buf_cnt;
+       size_t image_size;
        struct image image;
 
        image.base_address_set = 0;
@@ -181,7 +182,8 @@ static int loadDriver(struct ecosflash_flash_bank *info)
                }
                target_write_buffer(target, image.sections[i].base_address, buf_cnt, buffer);
                image_size += buf_cnt;
-               LOG_DEBUG("%" PRIu32 " byte written at address 0x%8.8" PRIx32 "", buf_cnt, image.sections[i].base_address);
+               LOG_DEBUG("%zu bytes written at address 0x%8.8" PRIx32 "",
+                               buf_cnt, image.sections[i].base_address);
 
                free(buffer);
        }
@@ -334,7 +336,7 @@ static int ecosflash_probe(struct flash_bank *bank)
        return ERROR_OK;
 }
 
-static int ecosflash_register_commands(struct command_context_s *cmd_ctx)
+static int ecosflash_register_commands(struct command_context *cmd_ctx)
 {
        register_command(cmd_ctx, NULL, "ecosflash", NULL, COMMAND_ANY, NULL);
 
@@ -429,7 +431,7 @@ static uint32_t ecosflash_wait_status_busy(struct flash_bank *bank, uint32_t wai
        return ERROR_OK;
 }
 
-static int ecosflash_handle_gpnvm_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc)
+static int ecosflash_handle_gpnvm_command(struct command_context *cmd_ctx, char *cmd, char **args, int argc)
 {
        return ERROR_OK;
 }

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)