#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
{
struct ecosflash_flash_bank *info;
- if (argc < 7)
+ if (CMD_ARGC < 7)
{
LOG_WARNING("incomplete flash_bank ecosflash configuration");
return ERROR_FLASH_BANK_INVALID;
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;
}
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);
}
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);
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;
}