diff options
author | cnlohr <lohr85@gmail.com> | 2017-02-14 10:03:18 -0500 |
---|---|---|
committer | cnlohr <lohr85@gmail.com> | 2017-02-14 10:03:18 -0500 |
commit | 119a205619632076c7b258eaa6c28dd7bcd2c294 (patch) | |
tree | d99f9611314c7a565190570e2c337f8ffc6ae9c3 /src/survive_cal.c | |
parent | 1f760c1341cd170f3cf519b5b01c1fa8c5b9c610 (diff) | |
download | libsurvive-119a205619632076c7b258eaa6c28dd7bcd2c294.tar.gz libsurvive-119a205619632076c7b258eaa6c28dd7bcd2c294.tar.bz2 |
integrate josh's new work. It works! #19 is just about solved!
Diffstat (limited to 'src/survive_cal.c')
-rw-r--r-- | src/survive_cal.c | 12 |
1 files changed, 8 insertions, 4 deletions
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 ); } } |