From 19a463f47d00a983e23cfd1c0e769f88667f04f8 Mon Sep 17 00:00:00 2001 From: Leo C Date: Fri, 15 Apr 2016 15:25:28 +0200 Subject: [PATCH] Bufix mstep command: take the right arg for parameter count. --- avr/cmd_boot.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/avr/cmd_boot.c b/avr/cmd_boot.c index b8799aa..ce280ac 100644 --- a/avr/cmd_boot.c +++ b/avr/cmd_boot.c @@ -4,7 +4,7 @@ * (C) Copyright 2000-2003 * Wolfgang Denk, DENX Software Engineering, wd@denx.de. * - * SPDX-License-Identifier: GPL-2.0+ + * SPDX-License-Identifier: GPL-2.0 */ /* @@ -83,7 +83,7 @@ command_ret_t do_busreq_pulse(cmd_tbl_t *cmdtp, int flag, int argc, char * const } if (argc > 1) - count = (uint16_t) strtoul(argv[2], NULL, 16); + count = (uint16_t) strtoul(argv[1], NULL, 16); z80_bus_cmd(Request); while (count--) @@ -118,11 +118,9 @@ command_ret_t do_go(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) if (addr != 0) { uint8_t tmp[3]; - uint_fast8_t i; z80_bus_cmd(Request); - for (i = 0; i < 3; i++) - tmp[i] = z80_read(i); + z80_read_block (tmp, 0, 3); z80_write(0, 0xc3); z80_write(1, addr); z80_write(2, (addr >> 8)); @@ -130,8 +128,7 @@ command_ret_t do_go(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) z80_bus_cmd(Run); z80_bus_cmd(M_Cycle); z80_bus_cmd(M_Cycle); - for (i = 0; i < 3; i++) - z80_write(i, tmp[i]); + z80_write_block(tmp, 0, 3); } else z80_bus_cmd(Run); -- 2.39.2