* 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 *
#include "flash.h"
#include "image.h"
#include "time_support.h"
-#include "at91sam3.h"
/* command handlers */
static int handle_flash_bank_command(struct command_context_s *cmd_ctx, char *cmd, char **args, int argc);
/* flash drivers
*/
extern flash_driver_t lpc2000_flash;
+extern flash_driver_t lpc288x_flash;
+extern flash_driver_t lpc2900_flash;
extern flash_driver_t cfi_flash;
+extern flash_driver_t at91sam3_flash;
extern flash_driver_t at91sam7_flash;
extern flash_driver_t str7x_flash;
extern flash_driver_t str9x_flash;
extern flash_driver_t stm32x_flash;
extern flash_driver_t tms470_flash;
extern flash_driver_t ecosflash_flash;
-extern flash_driver_t lpc288x_flash;
extern flash_driver_t ocl_flash;
extern flash_driver_t pic32mx_flash;
extern flash_driver_t avr_flash;
flash_driver_t *flash_drivers[] = {
&lpc2000_flash,
+ &lpc288x_flash,
+ &lpc2900_flash,
&cfi_flash,
&at91sam7_flash,
&at91sam3_flash,
&stm32x_flash,
&tms470_flash,
&ecosflash_flash,
- &lpc288x_flash,
&ocl_flash,
&pic32mx_flash,
&avr_flash,
image_close(&image);
return retvaltemp;
}
- if (retval == ERROR_OK)
- {
- command_print(cmd_ctx,
- "wrote %" PRIu32 " byte from file %s in %s (%f kb/s)",
- written,
- args[0],
- duration_text,
- (float)written / 1024.0 / ((float)duration.duration.tv_sec + ((float)duration.duration.tv_usec / 1000000.0)));
- }
+
+ float speed;
+
+ speed = written / 1024.0;
+ speed /= ((float)duration.duration.tv_sec
+ + ((float)duration.duration.tv_usec / 1000000.0));
+ command_print(cmd_ctx,
+ "wrote %" PRIu32 " byte from file %s in %s (%f kb/s)",
+ written, args[0], duration_text, speed);
+
free(duration_text);
image_close(&image);
return retval;
}
- if (err == ERROR_OK)
- {
- float speed;
- speed = wrote / 1024.0;
- speed/=((float)duration.duration.tv_sec + ((float)duration.duration.tv_usec / 1000000.0));
- command_print(cmd_ctx,
- "wrote %" PRId32 " bytes to 0x%8.8" PRIx32 " in %s (%f kb/s)",
- count*wordsize,
- address,
- duration_text,
- speed);
- }
+ float speed;
+
+ speed = wrote / 1024.0;
+ speed /= ((float)duration.duration.tv_sec
+ + ((float)duration.duration.tv_usec / 1000000.0));
+ command_print(cmd_ctx,
+ "wrote %" PRIu32 " bytes to 0x%8.8" PRIx32 " in %s (%f kb/s)",
+ wrote, address, duration_text, speed);
+
free(duration_text);
return ERROR_OK;
}