X-Git-Url: http://cloudbase.mooo.com/gitweb/z180-stamp.git/blobdiff_plain/1157e75889d3d6d23d1e2514f401cd5b354bd149..9461ecf31e8c701160059af2836337f79fc837b3:/avr/cmd_boot.c diff --git a/avr/cmd_boot.c b/avr/cmd_boot.c index b8799aa..73f2cf3 100644 --- a/avr/cmd_boot.c +++ b/avr/cmd_boot.c @@ -1,10 +1,10 @@ /* - * (C) Copyright 2014 Leo C. + * (C) Copyright 2014-2016 Leo C. * * (C) Copyright 2000-2003 * Wolfgang Denk, DENX Software Engineering, wd@denx.de. * - * SPDX-License-Identifier: GPL-2.0+ + * SPDX-License-Identifier: GPL-2.0 */ /* @@ -16,12 +16,12 @@ #include #include "command.h" -#include "cli_readline.h" -#include "cli.h" +#include "cli_readline.h" /* console_buffer[] */ +#include "cli.h" /* run_command() */ #include "env.h" #include "con-utils.h" #include "z80-if.h" -#include "z180-serv.h" +#include "z180-serv.h" /* restart_z180_serv() */ #include "debug.h" /* ugly hack to get Z180 loadfile into flash memory */ @@ -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); @@ -244,7 +241,7 @@ command_ret_t do_console(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv case ':': putchar('\n'); - int cmdlen = cli_readline(PSTR(": ")); + int cmdlen = cli_readline(PSTR(": "), 1); if (cmdlen > 0) run_command(console_buffer, 0); break;