@@ -429,6 +429,7 @@ a good modem here and providing a result when it is received.
429
429
430
430
#define PREAMBLE_AND_BARKER_CODE 0x55555712
431
431
#define EOTD_MAX_LEN 8
432
+ #define DUMMY_BIT_HACK
432
433
433
434
static void eotd_rec_bit (int chan , int subchan , int slice , int raw , int future_use )
434
435
{
@@ -439,8 +440,8 @@ static void eotd_rec_bit (int chan, int subchan, int slice, int raw, int future_
439
440
*/
440
441
H = & hdlc_state [chan ][subchan ][slice ];
441
442
442
- #ifdef DETDEBUG
443
- fprintf (stderr , "chan=%d subchan=%d slice=%d raw=%d\n" , chan , subchan , slice , raw );
443
+ #ifdef EOTD_DEBUG
444
+ dw_printf (stderr , "chan=%d subchan=%d slice=%d raw=%d\n" , chan , subchan , slice , raw );
444
445
#endif
445
446
//dw_printf ("slice %d = %d\n", slice, raw);
446
447
@@ -452,23 +453,23 @@ fprintf(stderr, "chan=%d subchan=%d slice=%d raw=%d\n", chan, subchan, slice, ra
452
453
int done = 0 ;
453
454
454
455
if (!H -> eotd_gathering && H -> eotd_acc == PREAMBLE_AND_BARKER_CODE ) {
456
+ #ifdef EOTD_DEBUG
455
457
dw_printf ("Barker Code Found\n" );
458
+ #endif
456
459
H -> olen = 0 ;
457
460
H -> eotd_gathering = 1 ;
458
461
H -> frame_len = 0 ;
459
462
}
460
463
else if (H -> eotd_gathering ) {
461
464
H -> olen ++ ;
462
465
466
+ #ifdef DUMMY_BIT_HACK
463
467
/* Hack to skip 'dummy' 64th bit */
464
468
if (H -> olen == 7 && H -> frame_len == 7 ) {
465
- #ifdef DETDEBUG
466
- fprintf (stderr , "Special case!\n" );
467
- #endif
468
469
H -> eotd_acc <<= 1 ;
469
470
H -> olen ++ ;
470
471
}
471
-
472
+ #endif
472
473
if (H -> olen == 8 ) {
473
474
H -> olen = 0 ;
474
475
char ch = H -> eotd_acc & 0xff ;
@@ -478,8 +479,8 @@ fprintf(stderr, "Special case!\n");
478
479
479
480
if (H -> frame_len == EOTD_MAX_LEN ) { // FIXME: look for other places with max length
480
481
done = 1 ;
481
- #ifdef DETDEBUG
482
- for (int ii = 0 ; ii < EOTD_MAX_LEN ; ii ++ ) {fprintf ( stderr , "%02x " , H -> frame_buf [ii ]); } fprintf ( stderr , "\n" );
482
+ #ifdef EOTD_DEBUG
483
+ for (int ii = 0 ; ii < EOTD_MAX_LEN ; ii ++ ) {dw_printf ( "%02x " , H -> frame_buf [ii ]); } dw_printf ( "\n" );
483
484
#endif
484
485
}
485
486
}
0 commit comments