aboutsummaryrefslogtreecommitdiff
path: root/src/survive_usb.c
diff options
context:
space:
mode:
authorcnlohr <lohr85@gmail.com>2016-12-03 21:16:13 -0500
committercnlohr <lohr85@gmail.com>2016-12-03 21:16:13 -0500
commit368f4dcca9f8fdadfee527345b59f7a7ba6d6367 (patch)
treeeaf7b4f4a281cd892dee7159df9ca7b4ff2c7cf8 /src/survive_usb.c
parent684b109e8cd3246c93fdec3e63157bbd11bb359a (diff)
downloadlibsurvive-368f4dcca9f8fdadfee527345b59f7a7ba6d6367.tar.gz
libsurvive-368f4dcca9f8fdadfee527345b59f7a7ba6d6367.tar.bz2
Update tools encode a 2.5 MHz signal with the AVR.
Diffstat (limited to 'src/survive_usb.c')
-rw-r--r--src/survive_usb.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/survive_usb.c b/src/survive_usb.c
index e7472a4..cfcef17 100644
--- a/src/survive_usb.c
+++ b/src/survive_usb.c
@@ -65,7 +65,7 @@ static int AttachInterface( struct SurviveContext * ctx, int which_interface_am_
iface->hname = hname;
struct libusb_transfer * tx = iface->transfer = libusb_alloc_transfer(0);
iface->cb = cb;
- printf( "%p %d %p %p\n", iface, which_interface_am_i, tx, devh );
+ //printf( "%p %d %p %p\n", iface, which_interface_am_i, tx, devh );
if (!iface->transfer)
{
@@ -125,7 +125,7 @@ static inline int hid_get_feature_report_timeout(libusb_device_handle* device, u
for (unsigned i = 0; i < 100; i++)
{
ret = getupdate_feature_report(device, interface, buf, len);
- printf( "HUD: %d/%d %02x %02x %02x\n", ret, len, buf[0], buf[1], buf[2] );
+ //printf( "HUD: %d/%d %02x %02x %02x\n", ret, len, buf[0], buf[1], buf[2] );
if( ret != -1 || errno != EPIPE ) return ret;
usleep( 1000 );
}
@@ -298,7 +298,8 @@ int survive_usb_poll( struct SurviveContext * ctx )
return r;
}
-
+#if 0
+//XXX THIS DOES NOT WORK!!! WHY???
int survive_get_config( char ** config, struct SurviveContext * ctx, int devno, int iface )
{
int i, ret, count = 0, size = 0;
@@ -307,6 +308,7 @@ int survive_get_config( char ** config, struct SurviveContext * ctx, int devno,
uint8_t uncompressed_data[65536];
struct libusb_device_handle * dev = ctx->udev[devno];
+ cfgbuff[1] = 0xaa;
cfgbuff[0] = 0x10;
if( ( ret = hid_get_feature_report_timeout( dev, iface, cfgbuff, sizeof( cfgbuff ) ) ) < 0 )
{
@@ -314,6 +316,7 @@ int survive_get_config( char ** config, struct SurviveContext * ctx, int devno,
return -1;
}
+ cfgbuff[1] = 0xaa;
cfgbuff[0] = 0x11;
do
{
@@ -366,7 +369,7 @@ int survive_get_config( char ** config, struct SurviveContext * ctx, int devno,
memcpy( config, uncompressed_data, len );
return len;
}
-
+#endif