From: Øyvind Harboe Date: Fri, 5 Feb 2010 13:38:26 +0000 (+0100) Subject: zy1000: complete zy1000_uart to jim command switch X-Git-Tag: v0.4.0-rc2~13 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=41d0901115903cb02b42249690b33cf616e133b5;p=openocd zy1000: complete zy1000_uart to jim command switch Signed-off-by: Øyvind Harboe --- diff --git a/src/ecosboard.c b/src/ecosboard.c index 2e73585d..f7523545 100644 --- a/src/ecosboard.c +++ b/src/ecosboard.c @@ -847,7 +847,7 @@ static int zylinjtag_Jim_Command_uart(Jim_Interp *interp, int argc, static int current_baud = 38400; if (argc == 1) { - command_print(cmd_ctx, "%d", current_baud); + Jim_SetResult(interp, Jim_NewIntObj(interp, current_baud)); return JIM_OK; } else if (argc != 2) @@ -883,8 +883,8 @@ static int zylinjtag_Jim_Command_uart(Jim_Interp *interp, int argc, baud = CYGNUM_SERIAL_BAUD_230400; break; default: - command_print(cmd_ctx, "unsupported baudrate"); - return ERROR_INVALID_ARGUMENTS; + Jim_SetResult(interp, Jim_NewStringObj(interp, "unsupported baudrate", -1)); + return JIM_ERR; } cyg_serial_info_t buf; @@ -897,7 +897,7 @@ static int zylinjtag_Jim_Command_uart(Jim_Interp *interp, int argc, err = cyg_io_lookup(ZY1000_SER_DEV, &serial_handle); if (err != ENOERR) { - LOG_ERROR("Could not open serial port\n"); + Jim_SetResult(interp, Jim_NewStringObj(interp, "Could not open serial port", -1)); return JIM_ERR; } @@ -907,7 +907,7 @@ static int zylinjtag_Jim_Command_uart(Jim_Interp *interp, int argc, &len); if (err != ENOERR) { - LOG_ERROR("Failed to get serial port settings %d", err); + Jim_SetResult(interp, Jim_NewStringObj(interp, "Failed to get serial port settings", -1)); return JIM_ERR; } buf.baud = baud; @@ -916,7 +916,7 @@ static int zylinjtag_Jim_Command_uart(Jim_Interp *interp, int argc, &len); if (err != ENOERR) { - LOG_ERROR("Failed to set serial port settings %d", err); + Jim_SetResult(interp, Jim_NewStringObj(interp, "Failed to set serial port settings", -1)); return JIM_ERR; }