1
0
mirror of git://projects.qi-hardware.com/iris.git synced 2025-04-21 12:27:27 +03:00

lists and bugfixes

This commit is contained in:
Bas Wijnen
2011-01-15 02:10:46 +01:00
parent 7e8cc1d25e
commit f4cac9b3a5
11 changed files with 199 additions and 93 deletions

View File

@@ -225,6 +225,7 @@ struct client : public shevek::server <client, data *>::connection:
disconnect ()
void data::request (requests r, unsigned data):
std::cerr << shevek::ostring ("requesting %08x with data %08x\n", r, data)
if usb_control_msg (handle, USB_ENDPOINT_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, r, (data >> 16) & 0xffff, data & 0xffff, NULL, 0, timeout) < 0:
std::cerr << "unable to send control message to NanoNote: " << usb_strerror () << ".\n"
usb_release_interface (handle, 0)
@@ -232,6 +233,7 @@ void data::request (requests r, unsigned data):
handle = NULL
void data::send_file (unsigned address, unsigned size, char const *data):
std::cerr << shevek::ostring ("setting data address to 0x%08x\n", address)
request (VR_SET_DATA_ADDRESS, address)
char const *ptr = data
while ptr - data < size:
@@ -292,7 +294,6 @@ void data::boot (std::string const &filename, unsigned load, unsigned entry):
request (VR_PROGRAM_START1, STAGE1_ENTRY)
usleep (100)
std::ostringstream stage2
usb_release_interface (handle, 0)
file.close ()
file.open (filename.c_str ())
stage2 << file.rdbuf ()