]> cloudbase.mooo.com Git - z180-stamp.git/blobdiff - avr/cmd_boot.c
z80_bus_request_or_exit()
[z180-stamp.git] / avr / cmd_boot.c
index a1afe7703a686fe119be7e19d9e04e2244535ee3..600bad3fffcf20fa144c80ca61e7624ea2c3617a 100644 (file)
@@ -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,