From 40602c22354a988b7edc688e0672ab0ce479bf12 Mon Sep 17 00:00:00 2001 From: Wolfgang Spraul Date: Fri, 21 Aug 2009 17:00:33 +0800 Subject: [PATCH] added 0x for hex --- xbboot/host-app/host_main.c | 10 ++++++++-- xbboot/scripts/boot-echo.sh | 8 ++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/xbboot/host-app/host_main.c b/xbboot/host-app/host_main.c index 2ed0fbb..2997444 100644 --- a/xbboot/host-app/host_main.c +++ b/xbboot/host-app/host_main.c @@ -203,7 +203,10 @@ int main(int argc, char** argv) fprintf(stderr, "Error - number of %s parameters %i\n", argv[1], argc); goto xout_xburst_interface; } - u32_param = strtoul(argv[2], 0 /* endptr */, 16 /* base */); + if (argv[2][0] == '0' && argv[2][1] == 'x') + u32_param = strtoul(&argv[2][2], 0 /* endptr */, 16 /* base */); + else + u32_param = strtoul(argv[2], 0 /* endptr */, 10 /* base */); usb_status = usb_control_msg(xburst_h, /* requesttype */ USB_ENDPOINT_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE, @@ -244,7 +247,10 @@ int main(int argc, char** argv) fprintf(stderr, "Error - number of %s parameters %i\n", argv[1], argc); goto xout_xburst_interface; } - read_len = strtol(argv[2], 0 /* endptr */, 16 /* base */); + if (argv[2][0] == '0' && argv[2][1] == 'x') + read_len = strtol(&argv[2][2], 0 /* endptr */, 16 /* base */); + else + read_len = strtol(argv[2], 0 /* endptr */, 10 /* base */); read_buf = (char*) malloc(read_len); if (!read_buf) { fprintf(stderr, "Error - cannot allocate %i bytes read buffer.\n", read_len); diff --git a/xbboot/scripts/boot-echo.sh b/xbboot/scripts/boot-echo.sh index 7d65de9..5d2ebd3 100755 --- a/xbboot/scripts/boot-echo.sh +++ b/xbboot/scripts/boot-echo.sh @@ -1,8 +1,8 @@ #!/bin/bash -../host-app/xbboot set_addr 80002000 +../host-app/xbboot set_addr 0x80002000 ../host-app/xbboot bulk_write ../target-stage1/stage1.bin -../host-app/xbboot start1 80002000 -../host-app/xbboot set_addr 81c00000 +../host-app/xbboot start1 0x80002000 +../host-app/xbboot set_addr 0x81c00000 ../host-app/xbboot bulk_write ../target-echokernel/echo-kernel.bin ../host-app/xbboot flush_cache -../host-app/xbboot start2 81c00000 +../host-app/xbboot start2 0x81c00000