X-Git-Url: http://cloudbase.mooo.com/gitweb/z180-stamp.git/blobdiff_plain/b35fcb2f65a9c2dd17faae5b513eecca8032461b..e9d96859cfcfe170c0025e427fd9934728395dc2:/avr/cmd_boot.c diff --git a/avr/cmd_boot.c b/avr/cmd_boot.c index a1afe77..600bad3 100644 --- a/avr/cmd_boot.c +++ b/avr/cmd_boot.c @@ -60,16 +60,9 @@ static void z80_load_mem(int_fast8_t verbosity, command_ret_t do_loadf(cmd_tbl_t *cmdtp UNUSED, uint_fast8_t flag UNUSED, int argc UNUSED, char * const argv[] UNUSED) { - ERRNUM res = ESUCCESS; - - if (z80_bus_state() & ZST_RUNNING) { - res = ERUNNING; - } else if (!(z80_bus_cmd(Request) & ZST_ACQUIRED)) { - res = EBUSTO; - } - if (res != ESUCCESS) - cmd_error(CMD_RET_FAILURE, res, NULL); - + if (z80_bus_state() & ZST_RUNNING) + cmd_error(CMD_RET_FAILURE, ERUNNING, NULL); + z80_bus_request_or_exit(); z80_load_mem(2, hdrom, &hdrom_sections, hdrom_address, @@ -210,14 +203,9 @@ command_ret_t do_bootcf(cmd_tbl_t *cmdtp UNUSED, uint_fast8_t flag UNUSED, int a return CMD_RET_FAILURE; } - if (z80_bus_state() & ZST_RUNNING) { - res = ERUNNING; - } else if (!(z80_bus_cmd(Request) & ZST_ACQUIRED)) { - res = EBUSTO; - } - if (res != ESUCCESS) - cmd_error(CMD_RET_FAILURE, res, NULL); - + if (z80_bus_state() & ZST_RUNNING) + cmd_error(CMD_RET_FAILURE, ERUNNING, NULL); + z80_bus_request_or_exit(); z80_load_mem(verbosity, cfboot, &cfboot_sections, cfboot_address,