changeset 266:dfbee05fe464

Fix beatnote sign measurement Breakage was caused by the change of the LO, HG, SR, enum values to use them as array indexes assigning to LO value 0 and thus flase in boolean context.
author Daniele Nicolodi <daniele.nicolodi@obspm.fr>
date Thu, 09 Jul 2015 23:05:43 +0200
parents da38cbbc7ec8
children 1de805d2d37a
files FXAnalyse.c
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/FXAnalyse.c	Sun Jun 21 14:44:33 2015 +0200
+++ b/FXAnalyse.c	Thu Jul 09 23:05:43 2015 +0200
@@ -257,7 +257,9 @@
 
 
 enum {
-	LO,
+	NONE = -1,
+	LO = 0,
+	MICROWAVE = LO,
 	HG,
 	SR,
 	_N_BEATS,
@@ -335,7 +337,7 @@
 };
 
 struct beatsign beatsign = {
-	.measure = 0,
+	.measure = NONE,
 };
 
 
@@ -1493,7 +1495,7 @@
 				}
 				
 				// beatnote sign determination				
-				if ((beatsign.measure) && 
+				if ((beatsign.measure != NONE) && 
 				    (utc > beatsign.t0 + 2.0)) {
 
 					int f_beat_sign, f_rep_sign = 0; 
@@ -1523,7 +1525,7 @@
 					SetCtrlVal(MainPanel, PANEL_DDS1, ad9912.frequency[0]);
 
 					// measurement done
-					beatsign.measure = 0;
+					beatsign.measure = NONE;
 						
 					// in the case of the optical beatnotes sign measurement
 					// we induce fairly small steps in f_rep therefore it is