diff code_part1/OSTC_code_asm_part1/menu_reset.asm @ 355:f49d6f0fc870

Allow negatif CF: * CF reset table encodes signed -128/+127 values. Upates CF48. * Display & check signed min/max bounds in cf menu. * Adapt CF alarm for signed values.
author JeanDo
date Tue, 07 Jun 2011 03:55:30 +0200
parents 2144f19fa1eb
children 88660a400338
line wrap: on
line diff
--- a/code_part1/OSTC_code_asm_part1/menu_reset.asm	Tue Jun 07 03:55:27 2011 +0200
+++ b/code_part1/OSTC_code_asm_part1/menu_reset.asm	Tue Jun 07 03:55:30 2011 +0200
@@ -65,10 +65,16 @@
     	if HIGH(default) > 0
     		error CF#v(CFn) "8bit default too big: ", default
     	endif
-    	if HIGH(min) > 0
-    		error CF#v(CFn) "8bit min too big: ", min
-    	endif
-    	if HIGH(max) > 0
+        if type & CF_NEG
+        	if HIGH(-min) != 0
+        		error CF#v(CFn) "8bit negativ min too big: ", min
+        	endif
+        else
+        	if HIGH(min) != 0
+        		error CF#v(CFn) "8bit min too big: ", min
+        	endif
+        endif
+    	if HIGH(max) != 0
     		error CF#v(CFn) "8bit max too big: ", max
     	endif
     	if ((type)==CF_BOOL) && ( (default)>1 )
@@ -83,7 +89,7 @@
     	else
             local typeFlags
 typeFlags   set type
-            if (min)>0
+            if (min)!=0
 typeFlags       set type + CF_MIN
             endif
             if (max)>(min)
@@ -163,7 +169,7 @@
 	CF_DEFAULT    CF_CENTI,     d'161', d'100', d'161'  ; color_warn_ppo2_cbar		ppO2 warn
 
 	CF_DEFAULT    CF_INT8,	    d'15',  d'7',   d'20'	; color_warn_celocity_mmin	warn at xx m/min
-	CF_DEFAULT    CF_SEC,	    d'42',  d'0',   d'240'  ; time_correction_value_default	Adds to Seconds on Midnight
+	CF_DEFAULT    CF_SEC+CF_NEG,d'42',  -d'120',d'120'  ; time_correction_value_default	Adds to Seconds on Midnight
 	CF_DEFAULT    CF_BOOL,      d'0',   0,      0 		; CF#49 Show Altimeter in surface mode
 	CF_DEFAULT    CF_BOOL,     	d'0',   0,      0       ; CF50 Show Log-Marker
 	CF_DEFAULT    CF_BOOL,	    d'1',   0,      0 		; CF51 Show Stopwatch