From 368f4dcca9f8fdadfee527345b59f7a7ba6d6367 Mon Sep 17 00:00:00 2001 From: cnlohr Date: Sat, 3 Dec 2016 21:16:13 -0500 Subject: Update tools encode a 2.5 MHz signal with the AVR. --- src/survive.c | 7 ++++--- src/survive_data.c | 4 ++-- src/survive_usb.c | 11 +++++++---- 3 files changed, 13 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/survive.c b/src/survive.c index 3712537..726e237 100644 --- a/src/survive.c +++ b/src/survive.c @@ -35,12 +35,13 @@ struct SurviveContext * survive_init( void(*ff)( struct SurviveContext * ctx, co return 0; } +#if 0 //Next, pull out the config stuff. -/* char * ct0conf; - int len = survive_get_config( &ct0conf, ctx, 1, 0 ); + char * ct0conf; + int len = survive_get_config( &ct0conf, ctx, 0, 0 ); printf( "%d\n", len ); puts( ct0conf ); -*/ +#endif //ctx->headset->photos = malloc( ctx->headset->sensors * sizeof(struct SurvivePhoto) ); return ctx; diff --git a/src/survive_data.c b/src/survive_data.c index 52c7c12..caa6eeb 100644 --- a/src/survive_data.c +++ b/src/survive_data.c @@ -83,7 +83,7 @@ static void handle_watchman( struct SurviveObject * w, uint8_t * readdata ) uint8_t startread[29]; memcpy( startread, readdata, 29 ); -#if 1 +#if 0 printf( "DAT: " ); for( i = 0; i < 29; i++ ) { @@ -209,7 +209,7 @@ static void handle_watchman( struct SurviveObject * w, uint8_t * readdata ) int mytime = (time1<<24)|(time2<<16)|(readdata[4]<<8)|(readdata[5]); int diff = mytime - lasttime; lasttime = mytime; - printf( "POST %d: %4d (%02x%02x) (%9d)- ", propset, qty, time1, time2, diff ); + printf( "POST %d: %4d (%02x%02x) - ", propset, qty, time1, time2 ); for( i = 0; i < qty + 4; i++ ) { printf( "%02x ", readdata[i] ); 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 -- cgit v1.2.3