1
0
mirror of git://projects.qi-hardware.com/xburst-tools.git synced 2024-11-25 20:55:01 +02:00

let strtoul auto deal '0x' and decimal string

correct the request type in usb_control_msg should USB_ENDPOINT_IN

Signed-off-by: Xiangfu Liu <xiangfu.z@gmail.com>
This commit is contained in:
Xiangfu Liu 2009-08-21 18:07:08 +08:00
parent 77c50470f6
commit efed24a9a2
2 changed files with 4 additions and 6 deletions

View File

@ -203,13 +203,10 @@ int main(int argc, char** argv)
fprintf(stderr, "Error - number of %s parameters %i\n", argv[1], argc);
goto xout_xburst_interface;
}
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 */);
u32_param = strtoul(argv[2], 0 /* endptr */, 0 /* base */);
usb_status = usb_control_msg(xburst_h,
/* requesttype */ USB_ENDPOINT_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
/* requesttype */ USB_ENDPOINT_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
/* request */ request_type,
/* value */ HIWORD(u32_param),
/* index */ LOWORD(u32_param),
@ -225,7 +222,7 @@ int main(int argc, char** argv)
}
case VR_FLUSH_CACHES: {
usb_status = usb_control_msg(xburst_h,
/* requesttype */ USB_ENDPOINT_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
/* requesttype */ USB_ENDPOINT_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
/* request */ VR_FLUSH_CACHES,
/* value */ 0,
/* index */ 0,

View File

@ -2,6 +2,7 @@
../host-app/xbboot set_addr 0x80002000
../host-app/xbboot bulk_write ../target-stage1/stage1.bin
../host-app/xbboot start1 0x80002000
../host-app/xbboot get_info
../host-app/xbboot set_addr 0x81c00000
../host-app/xbboot bulk_write ../target-echokernel/echo-kernel.bin
../host-app/xbboot flush_cache