comparison code_part1/OSTC_code_asm_part1/menu_reset.asm @ 99:39d325b2a5f9

FIX bad warning for 15bits CF values
author JeanDo
date Sun, 12 Dec 2010 16:47:32 +0100
parents 6f8e3a08011e
children db4a20b413df
comparison
equal deleted inserted replaced
98:6f8e3a08011e 99:39d325b2a5f9
33 33
34 ; Macro to check values, and construct PROM CF default table. 34 ; Macro to check values, and construct PROM CF default table.
35 ; If in types mode, set flags into hi. If not, clear it. 35 ; If in types mode, set flags into hi. If not, clear it.
36 CF_DEFAULT macro type, default, min, max 36 CF_DEFAULT macro type, default, min, max
37 noexpand 37 noexpand
38 CFn set 1+CFn
38 if (type) == CF_INT15 39 if (type) == CF_INT15
39 if (HIGH (default)) > .127 40 if HIGH (default) > .127
40 error "CF# 15bit default too big:", value 41 error CF#v(CFn) "15bit default too big: ", default
41 endif 42 endif
42 if (min)>0 && (max>min) 43 if (min)>0 && (max>min)
43 error "CF# 15bit defaults cannot have both MIN & MAX flags" 44 error CF#v(CFn) "15bit defaults cannot have both MIN & MAX flags"
45 endif
46 if HIGH(min) > .127
47 error CF#v(CFn) "15bit MIN value too big: ", min
48 endif
49 if HIGH(max) > .127
50 error CF#v(CFn) "15bit MAX value too big: ", max
44 endif 51 endif
45 52
46 ifdef NO_CF_TYPES 53 ifdef NO_CF_TYPES
47 DB LOW (default), HIGH(default) + 0x80 54 DB LOW (default), HIGH(default) + 0x80
48 else 55 else
49 DB LOW (default), HIGH(default) + 0x80 56 DB LOW (default), HIGH(default) + 0x80
50 if (min) > 0 57 if (max) > (min)
58 DB LOW(max), HIGH(max) + 0x80
59 else
51 DB LOW(min), HIGH(min) 60 DB LOW(min), HIGH(min)
52 else
53 DB LOW(min), HIGH(min) + 0x80
54 endif 61 endif
55 endif 62 endif
56 else 63 else
57 ; Basic sanity check for 8bit values: 64 ; Basic sanity check for 8bit values:
58 if HIGH(default) > 0 65 if HIGH(default) > 0
59 error "CF# 8bit default too big:", (default) 66 error CF#v(CFn) "8bit default too big: ", default
60 endif 67 endif
61 if HIGH(min) > 0 68 if HIGH(min) > 0
62 error "CF# 8bit min too big:", (min) 69 error CF#v(CFn) "8bit min too big: ", min
63 endif 70 endif
64 if HIGH(max) > 0 71 if HIGH(max) > 0
65 error "CF# 8bit max too big:", (max) 72 error CF#v(CFn) "8bit max too big: ", max
66 endif 73 endif
67 if ((type)==CF_BOOL) && ( (default)>1 ) 74 if ((type)==CF_BOOL) && ( (default)>1 )
68 error "CF# BOOL default too big:", (default) 75 error CF#v(CFn) "BOOL default too big: ", default
69 endif 76 endif
70 if ((type)==CF_BOOL) && ( (min)>0 || (max)>0 ) 77 if ((type)==CF_BOOL) && ( (min)>0 || (max)>0 )
71 error "CF# BOOL cannot have min/max" 78 error CF#v(CFn) "BOOL cannot have min/max"
72 endif 79 endif
73 80
74 ifdef NO_CF_TYPES 81 ifdef NO_CF_TYPES
75 DB LOW(default), 0 82 DB LOW(default), 0
76 else 83 else
87 endif 94 endif
88 expand 95 expand
89 endm 96 endm
90 97
91 ; Starting at CF0 98 ; Starting at CF0
92 CF_NUMBER set -1 99 CFn set -1
93 100
94 ; resets all customfunctions to the following default values 101 ; resets all customfunctions to the following default values
95 cf_default_table0: 102 cf_default_table0:
96 ;---- BANK0 custom function defaults ------------------------------------- 103 ;---- BANK0 custom function defaults -------------------------------------
97 ; DEFAULT MIN MAX 104 ; DEFAULT MIN MAX
140 CF_DEFAULT CF_PERCENT, d'30', d'10', d'90' ; GF_low_default 30% 147 CF_DEFAULT CF_PERCENT, d'30', d'10', d'90' ; GF_low_default 30%
141 CF_DEFAULT CF_PERCENT, d'90', d'30', d'95' ; GF_high_default 90% 148 CF_DEFAULT CF_PERCENT, d'90', d'30', d'95' ; GF_high_default 90%
142 CF_DEFAULT CF_COLOR, d'199', 0, 0 ; color_battery_surface Color Battery sign: Deep blue 149 CF_DEFAULT CF_COLOR, d'199', 0, 0 ; color_battery_surface Color Battery sign: Deep blue
143 CF_DEFAULT CF_COLOR, d'255', 0, 0 ; color_standard1 Color Standard: White 150 CF_DEFAULT CF_COLOR, d'255', 0, 0 ; color_standard1 Color Standard: White
144 CF_DEFAULT CF_COLOR, d'62', 0, 0 ; color_divemask Color Divemask: Light green 151 CF_DEFAULT CF_COLOR, d'62', 0, 0 ; color_divemask Color Divemask: Light green
152
145 CF_DEFAULT CF_COLOR, d'224', 0, 0 ; color_warnings Color Warnings: Red 153 CF_DEFAULT CF_COLOR, d'224', 0, 0 ; color_warnings Color Warnings: Red
146
147 CF_DEFAULT CF_BOOL, d'0', 0, 0 ; show_seconds_divemode =1 Show the seconds in Divemode 154 CF_DEFAULT CF_BOOL, d'0', 0, 0 ; show_seconds_divemode =1 Show the seconds in Divemode
148 CF_DEFAULT CF_INT15, 0, 0, 0 ; UNUSED 155 CF_DEFAULT CF_INT15, 0, 0, 0 ; UNUSED
149 CF_DEFAULT CF_BOOL, d'1', 0, 0 ; warn_ceiling_divemode =1 Warn ceiling violation in divemode 156 CF_DEFAULT CF_BOOL, d'1', 0, 0 ; warn_ceiling_divemode =1 Warn ceiling violation in divemode
150 CF_DEFAULT CF_BOOL, d'0', 0, 0 ; start_with_stopwatch =1 start with stopwatch 157 CF_DEFAULT CF_BOOL, d'0', 0, 0 ; start_with_stopwatch =1 start with stopwatch
158
151 CF_DEFAULT CF_BOOL, d'0', 0, 0 ; blink_gas_divemode =1 Show (resetable) average Depth instead of temperature 159 CF_DEFAULT CF_BOOL, d'0', 0, 0 ; blink_gas_divemode =1 Show (resetable) average Depth instead of temperature
152
153 CF_DEFAULT CF_INT15, d'13000', 0, 0 ; color_warn_depth_mBar Warn depths 160 CF_DEFAULT CF_INT15, d'13000', 0, 0 ; color_warn_depth_mBar Warn depths
154 CF_DEFAULT CF_PERCENT, d'101', d'50', d'101' ; color_warn_cns_percent Warn-% 161 CF_DEFAULT CF_PERCENT, d'101', d'50', d'101' ; color_warn_cns_percent Warn-%
155 CF_DEFAULT CF_PERCENT, d'101', d'50', d'101' ; color_warn_gf_percent Warn-% 162 CF_DEFAULT CF_PERCENT, d'101', d'50', d'101' ; color_warn_gf_percent Warn-%
156 CF_DEFAULT CF_CENTI, d'161', d'100', d'161' ; color_warn_ppo2_cbar ppO2 warn 163 CF_DEFAULT CF_CENTI, d'161', d'100', d'161' ; color_warn_ppo2_cbar ppO2 warn
164
157 CF_DEFAULT CF_INT8, d'15', d'7', d'20' ; color_warn_celocity_mmin warn at xx m/min 165 CF_DEFAULT CF_INT8, d'15', d'7', d'20' ; color_warn_celocity_mmin warn at xx m/min
158
159 CF_DEFAULT CF_SEC, d'42', d'0', d'240' ; time_correction_value_default Adds to Seconds on Midnight 166 CF_DEFAULT CF_SEC, d'42', d'0', d'240' ; time_correction_value_default Adds to Seconds on Midnight
160 CF_DEFAULT CF_INT15, 0, 0, 0 ; UNUSED 167 CF_DEFAULT CF_INT15, 0, 0, 0 ; UNUSED
161 CF_DEFAULT CF_INT15, 0, 0, 0 ; UNUSED 168 CF_DEFAULT CF_INT15, 0, 0, 0 ; UNUSED
162 CF_DEFAULT CF_INT15, 0, 0, 0 ; UNUSED 169 CF_DEFAULT CF_INT15, 0, 0, 0 ; UNUSED
163 CF_DEFAULT CF_INT15, 0, 0, 0 ; UNUSED
164 170
165 CF_DEFAULT CF_INT15, 0, 0, 0 ; UNUSED 171 CF_DEFAULT CF_INT15, 0, 0, 0 ; UNUSED
166 CF_DEFAULT CF_INT15, 0, 0, 0 ; UNUSED 172 CF_DEFAULT CF_INT15, 0, 0, 0 ; UNUSED
167 CF_DEFAULT CF_INT15, 0, 0, 0 ; UNUSED 173 CF_DEFAULT CF_INT15, 0, 0, 0 ; UNUSED
168 CF_DEFAULT CF_INT15, 0, 0, 0 ; UNUSED 174 CF_DEFAULT CF_INT15, 0, 0, 0 ; UNUSED
172 CF_DEFAULT CF_INT15, 0, 0, 0 ; UNUSED 178 CF_DEFAULT CF_INT15, 0, 0, 0 ; UNUSED
173 CF_DEFAULT CF_INT15, 0, 0, 0 ; UNUSED 179 CF_DEFAULT CF_INT15, 0, 0, 0 ; UNUSED
174 CF_DEFAULT CF_INT15, 0, 0, 0 ; UNUSED 180 CF_DEFAULT CF_INT15, 0, 0, 0 ; UNUSED
175 CF_DEFAULT CF_INT15, 0, 0, 0 ; UNUSED 181 CF_DEFAULT CF_INT15, 0, 0, 0 ; UNUSED
176 182
183 CF_DEFAULT CF_INT15, 0, 0, 0 ; UNUSED
177 CF_DEFAULT CF_INT15, 0, 0, 0 ; UNUSED 184 CF_DEFAULT CF_INT15, 0, 0, 0 ; UNUSED
178 CF_DEFAULT CF_INT15, 0, 0, 0 ; UNUSED 185 CF_DEFAULT CF_INT15, 0, 0, 0 ; UNUSED
179 cf_default_table2: 186 cf_default_table2:
180 187
181 ;============================================================================= 188 ;=============================================================================