mirror of https://github.com/wb2osz/direwolf.git
				
				
				
			More debug code.
This commit is contained in:
		
							parent
							
								
									257d2e3544
								
							
						
					
					
						commit
						b77762780f
					
				|  | @ -25,6 +25,8 @@ | ||||||
| // #define DEBUG4 1	/* capture AFSK demodulator output to log files */
 | // #define DEBUG4 1	/* capture AFSK demodulator output to log files */
 | ||||||
| 			/* Can be used to make nice plots. */ | 			/* Can be used to make nice plots. */ | ||||||
| 
 | 
 | ||||||
|  | // #define DEBUG5 1	// Write just demodulated bit stream to file. */
 | ||||||
|  | 
 | ||||||
| 
 | 
 | ||||||
| /*------------------------------------------------------------------
 | /*------------------------------------------------------------------
 | ||||||
|  * |  * | ||||||
|  | @ -875,6 +877,24 @@ static void nudge_pll (int chan, int subchan, int slice, float demod_out, struct | ||||||
| 	  int quality = fabsf(demod_out) * 100.0f / amplitude; | 	  int quality = fabsf(demod_out) * 100.0f / amplitude; | ||||||
| 	  if (quality > 100) quality = 100; | 	  if (quality > 100) quality = 100; | ||||||
| 
 | 
 | ||||||
|  | #if DEBUG5 | ||||||
|  | 	  // Write bit stream to a file.
 | ||||||
|  | 
 | ||||||
|  | 	  static FILE *bsfp = NULL; | ||||||
|  | 	  static int bcount = 0; | ||||||
|  | 	  if (chan == 0 && subchan == 0 && slice == 0) { | ||||||
|  | 	    if (bsfp == NULL) { | ||||||
|  | 	       bsfp = fopen ("bitstream.txt", "w"); | ||||||
|  | 	    } | ||||||
|  | 	    fprintf (bsfp, "%d", demod_out > 0); | ||||||
|  | 	    bcount++; | ||||||
|  | 	    if (bcount % 64 == 0) { | ||||||
|  | 	      fprintf (bsfp, "\n"); | ||||||
|  | 	    } | ||||||
|  | 	  } | ||||||
|  | 
 | ||||||
|  | #endif | ||||||
|  | 
 | ||||||
| 	  hdlc_rec_bit (chan, subchan, slice, demod_out > 0, 0, quality); | 	  hdlc_rec_bit (chan, subchan, slice, demod_out > 0, 0, quality); | ||||||
| 	  pll_dcd_each_symbol2 (D, chan, subchan, slice); | 	  pll_dcd_each_symbol2 (D, chan, subchan, slice); | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue