diff options
Diffstat (limited to 'src/survive_data.c')
-rw-r--r-- | src/survive_data.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/survive_data.c b/src/survive_data.c index 1d8b028..fae75f5 100644 --- a/src/survive_data.c +++ b/src/survive_data.c @@ -163,7 +163,7 @@ static void handle_watchman( struct SurviveObject * w, uint8_t * readdata ) } #endif -#if 0 +#if 1 printf( "POST %d: %4d %02x (%02x%02x) - ", propset, qty, type, time1, time2 ); for( i = 0; i < qty; i++ ) { @@ -247,14 +247,24 @@ void survive_data_cb( struct SurviveUSBInterface * si ) case USB_IF_LIGHTHOUSE: { int i; + //printf( "%d -> ", size ); for( i = 0; i < 3; i++ ) { //handle_lightdata( (struct LightpulseStructure *)readdata ); int16_t * acceldata = (int16_t*)readdata; readdata += 12; uint32_t timecode = POP4; - survive_imu_process( &ctx->headset, acceldata, timecode, POP1 ); + uint8_t code = POP1; + //printf( "%d ", code ); + int8_t cd = code - ctx->oldcode; + + if( cd > 0 ) + { + ctx->oldcode = code; + survive_imu_process( &ctx->headset, acceldata, timecode, code ); + } } + //printf("\n" ); break; } case USB_IF_WATCHMAN1: |