LPC: Cleanup regs_size (in bytes).
Also use sizeof() to make it clear why we multiple and divide by 4.
This commit is contained in:
parent
df9c19f071
commit
487252150f
|
@ -131,7 +131,7 @@ void arm7tdmi_jtag_handler(jtag_dev_t *dev)
|
||||||
t->mem_write_words = (void *)do_nothing;
|
t->mem_write_words = (void *)do_nothing;
|
||||||
t->mem_read_bytes = (void *)do_nothing;
|
t->mem_read_bytes = (void *)do_nothing;
|
||||||
t->mem_write_bytes = (void *)do_nothing;
|
t->mem_write_bytes = (void *)do_nothing;
|
||||||
t->regs_size = 16 * 4;
|
t->regs_size = 16 * sizeof(uint32_t);
|
||||||
t->regs_read = (void *)arm7_regs_read;
|
t->regs_read = (void *)arm7_regs_read;
|
||||||
t->regs_write = (void *)arm7_regs_write;
|
t->regs_write = (void *)arm7_regs_write;
|
||||||
t->pc_write = (void *)do_nothing;
|
t->pc_write = (void *)do_nothing;
|
||||||
|
|
|
@ -116,7 +116,7 @@ lpc11xx_probe(struct target_s *target)
|
||||||
static void
|
static void
|
||||||
lpc11x_iap_call(struct target_s *target, struct flash_param *param, unsigned param_len)
|
lpc11x_iap_call(struct target_s *target, struct flash_param *param, unsigned param_len)
|
||||||
{
|
{
|
||||||
uint32_t regs[target->regs_size / 4];
|
uint32_t regs[target->regs_size / sizeof(uint32_t)];
|
||||||
|
|
||||||
/* fill out the remainder of the parameters and copy the structure to RAM */
|
/* fill out the remainder of the parameters and copy the structure to RAM */
|
||||||
param->opcodes[0] = 0xbe00;
|
param->opcodes[0] = 0xbe00;
|
||||||
|
|
|
@ -331,7 +331,7 @@ static int32_t sector_number(uint32_t addr)
|
||||||
|
|
||||||
static void lpc43xx_iap_call(struct target_s *target, struct flash_param *param, unsigned param_len)
|
static void lpc43xx_iap_call(struct target_s *target, struct flash_param *param, unsigned param_len)
|
||||||
{
|
{
|
||||||
uint32_t regs[target->regs_size / 4];
|
uint32_t regs[target->regs_size / sizeof(uint32_t)];
|
||||||
uint32_t iap_entry;
|
uint32_t iap_entry;
|
||||||
|
|
||||||
target_mem_read_words(target, &iap_entry, IAP_ENTRYPOINT_LOCATION, sizeof(iap_entry));
|
target_mem_read_words(target, &iap_entry, IAP_ENTRYPOINT_LOCATION, sizeof(iap_entry));
|
||||||
|
|
Loading…
Reference in New Issue