From 119a205619632076c7b258eaa6c28dd7bcd2c294 Mon Sep 17 00:00:00 2001 From: cnlohr Date: Tue, 14 Feb 2017 10:03:18 -0500 Subject: integrate josh's new work. It works! #19 is just about solved! --- src/survive_cal.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/survive_cal.c') diff --git a/src/survive_cal.c b/src/survive_cal.c index 4223e70..adcb7bc 100644 --- a/src/survive_cal.c +++ b/src/survive_cal.c @@ -13,6 +13,10 @@ void ootx_packet_clbk_d(ootx_decoder_context *ct, ootx_packet* packet) int id = ct->user1; printf( "Got OOTX packet %d %p\n", id, cd ); + + lighthouse_info_v6 v6; + init_lighthouse_info_v6(&v6, packet->data); + print_lighthouse_info_v6(&v6); } @@ -54,11 +58,11 @@ void survive_cal_light( struct SurviveObject * so, int sensor_id, int acode, int if( sensor_id < 0 ) { int lhid = -sensor_id-1; - if( lhid >= NUM_LIGHTHOUSES-1 && so->codename[0] == 'H' ) + if( lhid < NUM_LIGHTHOUSES && so->codename[0] == 'H' ) { - uint8_t dbit = (acode & 2)?0xff:0x00; - printf( "%s %d %d %d\n", so->codename, lhid, acode, dbit ); - ootx_process_bit( &cd->ootx_decoders[lhid], dbit ); + uint8_t dbit = (acode & 2)>>1; + //printf( "%s %d %d %d\n", so->codename, lhid, acode, dbit ); + ootx_pump_bit( &cd->ootx_decoders[lhid], dbit ); } } -- cgit v1.2.3