Mercurial > public > hwos_code
annotate src/menu_tree.asm @ 437:23b58c4bc6aa
CHANGE: Language fixes, 2.08 release
author | heinrichsweikamp |
---|---|
date | Thu, 30 Jun 2016 10:28:12 +0200 |
parents | eccae727702f |
children | aadfe9f2edaf |
rev | line source |
---|---|
0 | 1 ;============================================================================= |
2 ; | |
3 ; File menu_tree.asm | |
4 ; | |
275 | 5 ; OSTC menus |
0 | 6 ; |
7 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved. | |
8 ;============================================================================= | |
9 ; HISTORY | |
10 ; 2011-07-11 : [jDG] Creation. | |
11 | |
275 | 12 #include "hwos.inc" ; Mandatory header |
0 | 13 #include "gaslist.inc" |
14 #include "menu_processor.inc" | |
15 #include "start.inc" | |
16 #include "comm.inc" | |
17 #include "logbook.inc" | |
18 #include "tft.inc" | |
19 #include "eeprom_rs232.inc" | |
20 #include "external_flash.inc" | |
21 #include "shared_definitions.h" ; Mailbox from/to p2_deco.c | |
22 #include "isr.inc" | |
23 #include "ghostwriter.inc" | |
24 #include "adc_lightsensor.inc" | |
355 | 25 #include "wait.inc" |
0 | 26 |
174
932e91074bdb
CHANGE: Clarify Travel Gases with "---" as change depth
heinrichsweikamp
parents:
155
diff
changeset
|
27 CBLOCK tmp+0x40 ; Keep space for menu processor |
932e91074bdb
CHANGE: Clarify Travel Gases with "---" as change depth
heinrichsweikamp
parents:
155
diff
changeset
|
28 gaslist_gas ; Check ram position in gaslist.asm, too! |
932e91074bdb
CHANGE: Clarify Travel Gases with "---" as change depth
heinrichsweikamp
parents:
155
diff
changeset
|
29 ENDC |
932e91074bdb
CHANGE: Clarify Travel Gases with "---" as change depth
heinrichsweikamp
parents:
155
diff
changeset
|
30 |
0 | 31 gui CODE |
32 ;============================================================================= | |
33 ; Main Menu | |
66
00636132cca6
BUGFIX: Maintain last selected customview in surface mode
heinrichsweikamp
parents:
64
diff
changeset
|
34 global do_main_menu,do_main_menu2 |
0 | 35 do_main_menu: |
39
e4e91fe8b09d
remember last customview in dive and surface mode
mh@mh-THINK.fritz.box
parents:
23
diff
changeset
|
36 movff menupos3,customview_surfmode; save last customview |
66
00636132cca6
BUGFIX: Maintain last selected customview in surface mode
heinrichsweikamp
parents:
64
diff
changeset
|
37 do_main_menu2: |
0 | 38 bcf sleepmode ; for timeout |
39 call menu_processor_reset ; restart from first icon. | |
40 | |
41 do_continue_main_menu: | |
428 | 42 rcall menu_tree_double_pop ; drop exit line and back to last line |
0 | 43 |
44 extern do_demo_divemode, restart | |
45 MENU_BEGIN tMainMenu, .7 | |
46 MENU_CALL tLogbook, logbook | |
47 MENU_CALL tGasSetup, do_gas_menu | |
48 MENU_CALL tCCRSetup, do_ccr_menu | |
49 MENU_CALL tPlan, do_planner_menu_reset | |
50 MENU_CALL tDiveModeMenu, do_divemode_menu | |
51 MENU_CALL tSystSets, do_settings_menu | |
52 MENU_CALL tExit, restart | |
53 MENU_END | |
54 | |
55 do_info_menu: | |
62 | 56 MENU_BEGIN tInfoMenu, .5 |
0 | 57 MENU_DYNAMIC info_menu_serial, 0 |
58 MENU_DYNAMIC info_menu_firmware, 0 | |
59 MENU_DYNAMIC info_menu_total_dives, 0 | |
62 | 60 MENU_DYNAMIC info_menu_battery_volts,0 |
0 | 61 MENU_CALL tExit, do_return_settings |
62 MENU_END | |
63 | |
64 ;============================================================================= | |
65 ; CCR Setup | |
66 | |
67 return_ccr_menu: | |
428 | 68 rcall menu_tree_double_pop ; drop exit line and back to last line |
0 | 69 |
70 do_ccr_menu: | |
113 | 71 bcf menu_show_sensors ; Clear flag |
72 bcf menu_show_sensors2 ; Clear flag | |
236 | 73 btfsc analog_o2_input |
240 | 74 bra do_ccr_menu_cR |
75 btfss optical_input | |
76 bra do_ccr_menu_ostc2 | |
77 | |
78 MENU_BEGIN tCCRSetup, .5 ; OSTC3 menu | |
174
932e91074bdb
CHANGE: Clarify Travel Gases with "---" as change depth
heinrichsweikamp
parents:
155
diff
changeset
|
79 MENU_OPTION tCCRMode, oCCRMode, 0 |
932e91074bdb
CHANGE: Clarify Travel Gases with "---" as change depth
heinrichsweikamp
parents:
155
diff
changeset
|
80 MENU_CALL tCCRSensor, do_ccr_sensor |
932e91074bdb
CHANGE: Clarify Travel Gases with "---" as change depth
heinrichsweikamp
parents:
155
diff
changeset
|
81 MENU_CALL tDiluentSetup, do_diluent_setup |
932e91074bdb
CHANGE: Clarify Travel Gases with "---" as change depth
heinrichsweikamp
parents:
155
diff
changeset
|
82 MENU_CALL tFixedSetpoints, do_fixed_setpoints |
932e91074bdb
CHANGE: Clarify Travel Gases with "---" as change depth
heinrichsweikamp
parents:
155
diff
changeset
|
83 MENU_CALL tExit, do_continue_main_menu |
932e91074bdb
CHANGE: Clarify Travel Gases with "---" as change depth
heinrichsweikamp
parents:
155
diff
changeset
|
84 MENU_END |
932e91074bdb
CHANGE: Clarify Travel Gases with "---" as change depth
heinrichsweikamp
parents:
155
diff
changeset
|
85 |
240 | 86 do_ccr_menu_cR: ; cR menu |
113 | 87 MENU_BEGIN tCCRSetup, .6 |
0 | 88 MENU_OPTION tCCRMode, oCCRMode, 0 |
89 MENU_CALL tCCRSensor, do_ccr_sensor | |
113 | 90 MENU_CALL tCalibrateMenu, do_calibrate_menu |
0 | 91 MENU_CALL tDiluentSetup, do_diluent_setup |
92 MENU_CALL tFixedSetpoints, do_fixed_setpoints | |
93 MENU_CALL tExit, do_continue_main_menu | |
94 MENU_END | |
95 | |
240 | 96 do_ccr_menu_ostc2: |
359 | 97 MENU_BEGIN tCCRSetup, .4 ; ostc2 menu |
98 MENU_OPTION tCCRMode, oCCRMode, 0 | |
240 | 99 MENU_CALL tDiluentSetup, do_diluent_setup |
100 MENU_CALL tFixedSetpoints, do_fixed_setpoints | |
101 MENU_CALL tExit, do_continue_main_menu | |
102 MENU_END | |
103 | |
104 | |
113 | 105 do_calibrate_menu: |
187
669b5d00706d
CHANGE: Longer timeout (4 min) for calibration menu
heinrichsweikamp
parents:
174
diff
changeset
|
106 call enable_ir_s8 ; Enable IR/S8-Port |
113 | 107 bsf menu_show_sensors2 ; Set flag |
108 do_calibrate_menu2: | |
109 MENU_BEGIN tCalibrateMenu, .6 | |
110 MENU_CALL tDiveHudMask1, 0 | |
111 MENU_CALL tDiveHudMask2, 0 | |
112 MENU_CALL tDiveHudMask3, 0 | |
113 MENU_OPTION tCalibrationGas,oCalGasO2, 0 | |
114 MENU_CALL tCalibrate, do_calibrate_mix | |
115 MENU_CALL tExit, return_ccr_menu | |
116 MENU_END | |
117 | |
118 do_calibrate_mix: | |
119 extern calibrate_mix | |
120 call calibrate_mix ; Calibrate with opt_calibration_O2_ratio, also calibrate S8 HUD if connected | |
355 | 121 WAITMS d'250' ; Wait for HUD v3 |
113 | 122 goto restart ; Restart into surface mode |
123 | |
0 | 124 do_ccr_sensor: |
187
669b5d00706d
CHANGE: Longer timeout (4 min) for calibration menu
heinrichsweikamp
parents:
174
diff
changeset
|
125 call enable_ir_s8 ; Enable IR/S8-Port |
0 | 126 bsf menu_show_sensors ; Set flag |
145
e3ac5b2021bc
NEW: Setpoint-Fallback option for external O2 sensor failure
heinrichsweikamp
parents:
144
diff
changeset
|
127 MENU_BEGIN tCCRSensor, .5 |
0 | 128 MENU_CALL tDiveHudMask1, 0 |
129 MENU_CALL tDiveHudMask2, 0 | |
130 MENU_CALL tDiveHudMask3, 0 | |
145
e3ac5b2021bc
NEW: Setpoint-Fallback option for external O2 sensor failure
heinrichsweikamp
parents:
144
diff
changeset
|
131 MENU_OPTION tSensorFallback,oSensorFallback, 0 |
0 | 132 MENU_CALL tExit, return_ccr_menu |
133 MENU_END | |
134 | |
135 do_diluent_setup: | |
136 bsf ccr_diluent_setup ; =1: Setting up Diluents ("Gas6-10") | |
139 | 137 bcf short_gas_decriptions ; =1: Use short versions of gaslist_strcat_gas_mod and gaslist_strcat_setpoint |
0 | 138 call gaslist_cleanup_list ; Takes care that only one gas can be first and first has 0m change depth |
139 MENU_BEGIN tDiluentSetup, .6 | |
140 MENU_DYNAMIC gaslist_strcat_gas_mod, do_edit_gas_menu | |
141 MENU_DYNAMIC gaslist_strcat_gas_mod, do_edit_gas_menu | |
142 MENU_DYNAMIC gaslist_strcat_gas_mod, do_edit_gas_menu | |
143 MENU_DYNAMIC gaslist_strcat_gas_mod, do_edit_gas_menu | |
144 MENU_DYNAMIC gaslist_strcat_gas_mod, do_edit_gas_menu | |
145 MENU_CALL tExit, return_ccr_menu | |
146 MENU_END | |
147 | |
148 do_return_fixed_setpoints: | |
428 | 149 rcall menu_tree_double_pop ; drop exit line and back to last line |
0 | 150 |
151 do_fixed_setpoints: | |
139 | 152 bcf short_gas_decriptions ; =1: Use short versions of gaslist_strcat_gas_mod and gaslist_strcat_setpoint |
0 | 153 MENU_BEGIN tFixedSetpoints, .6 |
154 MENU_DYNAMIC gaslist_strcat_setpoint, do_edit_sp_menu | |
155 MENU_DYNAMIC gaslist_strcat_setpoint, do_edit_sp_menu | |
156 MENU_DYNAMIC gaslist_strcat_setpoint, do_edit_sp_menu | |
157 MENU_DYNAMIC gaslist_strcat_setpoint, do_edit_sp_menu | |
158 MENU_DYNAMIC gaslist_strcat_setpoint, do_edit_sp_menu | |
159 MENU_CALL tExit, return_ccr_menu | |
160 MENU_END | |
161 | |
162 do_edit_sp_menu: | |
163 call gaslist_setSP ; Save current item. | |
164 MENU_BEGIN tFixedSetpoints, .5 | |
165 MENU_DYNAMIC gaslist_strcat_setpoint_0,0 | |
166 MENU_CALL tSPPlus, gaslist_spplus | |
167 MENU_CALL tDepthPlus, gaslist_spdepthplus | |
168 MENU_CALL tDepthMinus, gaslist_spdepthminus | |
169 MENU_CALL tExit, do_return_fixed_setpoints | |
170 MENU_END | |
171 | |
172 ;============================================================================= | |
173 ; OC Gas Setup | |
174 | |
175 return_gas_menu: | |
428 | 176 rcall menu_tree_double_pop ; drop exit line and back to last line |
0 | 177 |
178 btfsc ccr_diluent_setup ; Return to CCR-Menu? | |
179 bra do_diluent_setup ; Yes. | |
180 do_gas_menu: | |
181 bcf ccr_diluent_setup ; =1: Setting up Diluents ("Gas6-10") | |
139 | 182 bcf short_gas_decriptions ; =1: Use short versions of gaslist_strcat_gas_mod and gaslist_strcat_setpoint |
0 | 183 call gaslist_cleanup_list ; Takes care that only one gas can be first and first has 0m change depth |
184 MENU_BEGIN tGaslist, .6 | |
185 MENU_DYNAMIC gaslist_strcat_gas_mod, do_edit_gas_menu | |
186 MENU_DYNAMIC gaslist_strcat_gas_mod, do_edit_gas_menu | |
187 MENU_DYNAMIC gaslist_strcat_gas_mod, do_edit_gas_menu | |
188 MENU_DYNAMIC gaslist_strcat_gas_mod, do_edit_gas_menu | |
189 MENU_DYNAMIC gaslist_strcat_gas_mod, do_edit_gas_menu | |
190 MENU_CALL tExit, do_continue_main_menu | |
191 MENU_END | |
192 | |
193 return_gas_depth: | |
428 | 194 rcall menu_tree_double_pop ; drop exit line and back to last line |
0 | 195 bra do_edit_gas_menu_1 |
196 | |
197 do_edit_gas_menu: | |
198 call gaslist_setgas ; Save current item. | |
199 do_edit_gas_menu_1: ; Keep current gas. | |
200 MENU_BEGIN tGasEdit, .6 | |
201 MENU_DYNAMIC gaslist_gastitle, 0 | |
202 MENU_DYNAMIC gaslist_MOD_END, 0 | |
203 MENU_DYNAMIC gaslist_show_type, gaslist_toggle_type | |
204 MENU_CALL tSetup_mix, do_setup_mix | |
205 MENU_CALL tGasDepth, do_gas_depth_menu | |
206 MENU_CALL tExit, return_gas_menu | |
207 MENU_END | |
208 | |
209 do_setup_mix: | |
210 MENU_BEGIN tGasEdit, .7 | |
211 MENU_DYNAMIC gaslist_gastitle, 0 | |
212 MENU_DYNAMIC gaslist_MOD_END, 0 | |
213 MENU_CALL tO2Plus, gaslist_pO2 | |
214 MENU_CALL tO2Minus, gaslist_mO2 | |
215 MENU_CALL tHePlus, gaslist_pHe | |
216 MENU_CALL tHeMinus, gaslist_mHe | |
217 MENU_CALL tExit, return_gas_depth | |
218 MENU_END | |
219 | |
428 | 220 menu_tree_double_pop: |
221 call menu_processor_pop ; drop exit line. | |
222 goto menu_processor_pop ; back to last gas and return | |
223 | |
224 | |
0 | 225 global do_gas_depth_menu |
226 do_gas_depth_menu: | |
174
932e91074bdb
CHANGE: Clarify Travel Gases with "---" as change depth
heinrichsweikamp
parents:
155
diff
changeset
|
227 movff gaslist_gas,WREG |
932e91074bdb
CHANGE: Clarify Travel Gases with "---" as change depth
heinrichsweikamp
parents:
155
diff
changeset
|
228 lfsr FSR1,opt_gas_type ; Read opt_gas_type[WREG] |
932e91074bdb
CHANGE: Clarify Travel Gases with "---" as change depth
heinrichsweikamp
parents:
155
diff
changeset
|
229 movff PLUSW1,lo ; Used as temp |
932e91074bdb
CHANGE: Clarify Travel Gases with "---" as change depth
heinrichsweikamp
parents:
155
diff
changeset
|
230 movlw .3 ; 3=Deco |
932e91074bdb
CHANGE: Clarify Travel Gases with "---" as change depth
heinrichsweikamp
parents:
155
diff
changeset
|
231 btfsc ccr_diluent_setup ; =1: Setting up Diluents ("Gas6-10") |
932e91074bdb
CHANGE: Clarify Travel Gases with "---" as change depth
heinrichsweikamp
parents:
155
diff
changeset
|
232 movlw .2 ; 2=Normal |
932e91074bdb
CHANGE: Clarify Travel Gases with "---" as change depth
heinrichsweikamp
parents:
155
diff
changeset
|
233 cpfseq lo |
932e91074bdb
CHANGE: Clarify Travel Gases with "---" as change depth
heinrichsweikamp
parents:
155
diff
changeset
|
234 bra return_gas_depth ; Non-Deco gas or "Normal" Diluent, Return! |
932e91074bdb
CHANGE: Clarify Travel Gases with "---" as change depth
heinrichsweikamp
parents:
155
diff
changeset
|
235 |
154
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
148
diff
changeset
|
236 MENU_BEGIN tGasEdit, .7 |
0 | 237 MENU_DYNAMIC gaslist_gastitle, 0 |
238 MENU_DYNAMIC gaslist_MOD_END, 0 | |
154
afa31c815f24
NEW: Show ppO2 for change depth during gas setup
heinrichsweikamp
parents:
148
diff
changeset
|
239 MENU_DYNAMIC gaslist_ppo2, 0 ; ppO2 at change depth |
0 | 240 MENU_CALL tDepthPlus, gaslist_pDepth |
241 MENU_CALL tDepthMinus, gaslist_mDepth | |
242 MENU_DYNAMIC gaslist_reset_mod_title,gaslist_reset_mod | |
243 MENU_CALL tExit, return_gas_depth | |
244 MENU_END | |
245 | |
246 ;============================================================================= | |
247 ; Simulator menus | |
248 | |
249 global do_planner_menu | |
250 | |
251 do_planner_menu_reset: | |
252 extern option_save_all | |
253 call option_save_all | |
254 ;---- Reset dive time/depth to default values | |
255 extern option_reset | |
256 lfsr FSR0,odiveInterval | |
257 call option_reset | |
258 lfsr FSR0,obottomTime | |
259 call option_reset | |
260 lfsr FSR0,obottomDepth | |
261 call option_reset | |
262 | |
263 do_planner_menu: | |
264 extern do_demo_planner | |
298
2fe34fc0e2ae
new submenu for gas consumption, show actual mix instead of GAS1-GAS5 in deco planner
heinrichsweikamp
parents:
275
diff
changeset
|
265 MENU_BEGIN tPlan, .7 |
0 | 266 MENU_CALL tInter, do_demo_divemode |
267 MENU_OPTION tIntvl, odiveInterval, 0 | |
268 MENU_OPTION tBtTm, obottomTime, 0 | |
269 MENU_OPTION tMxDep, obottomDepth, 0 | |
270 MENU_CALL tDeco, do_demo_planner | |
298
2fe34fc0e2ae
new submenu for gas consumption, show actual mix instead of GAS1-GAS5 in deco planner
heinrichsweikamp
parents:
275
diff
changeset
|
271 MENU_CALL tSystSets, do_planner_config |
0 | 272 MENU_CALL tExit, do_continue_main_menu |
273 MENU_END | |
274 | |
298
2fe34fc0e2ae
new submenu for gas consumption, show actual mix instead of GAS1-GAS5 in deco planner
heinrichsweikamp
parents:
275
diff
changeset
|
275 do_planner_config: |
2fe34fc0e2ae
new submenu for gas consumption, show actual mix instead of GAS1-GAS5 in deco planner
heinrichsweikamp
parents:
275
diff
changeset
|
276 MENU_BEGIN tPlan, .3 |
2fe34fc0e2ae
new submenu for gas consumption, show actual mix instead of GAS1-GAS5 in deco planner
heinrichsweikamp
parents:
275
diff
changeset
|
277 MENU_OPTION tSetBotUse, obottom_usage, 0 |
2fe34fc0e2ae
new submenu for gas consumption, show actual mix instead of GAS1-GAS5 in deco planner
heinrichsweikamp
parents:
275
diff
changeset
|
278 MENU_OPTION tSetDecoUse, odeco_usage, 0 |
2fe34fc0e2ae
new submenu for gas consumption, show actual mix instead of GAS1-GAS5 in deco planner
heinrichsweikamp
parents:
275
diff
changeset
|
279 MENU_CALL tExit, do_planner_menu |
2fe34fc0e2ae
new submenu for gas consumption, show actual mix instead of GAS1-GAS5 in deco planner
heinrichsweikamp
parents:
275
diff
changeset
|
280 MENU_END |
2fe34fc0e2ae
new submenu for gas consumption, show actual mix instead of GAS1-GAS5 in deco planner
heinrichsweikamp
parents:
275
diff
changeset
|
281 |
2fe34fc0e2ae
new submenu for gas consumption, show actual mix instead of GAS1-GAS5 in deco planner
heinrichsweikamp
parents:
275
diff
changeset
|
282 |
0 | 283 ;============================================================================= |
284 ; Divemode menu | |
285 | |
286 do_return_divemode_menu: | |
428 | 287 rcall menu_tree_double_pop ; drop exit line and back to last line |
0 | 288 |
289 do_divemode_menu: | |
290 MENU_BEGIN tDiveModeMenu, .7 | |
291 MENU_OPTION tDvMode, oDiveMode, 0 | |
292 MENU_OPTION tDkMode, oDecoMode, 0 | |
104
223579e905c3
Show a Safety Stop if enabled (Menu "Deco Parameters")
heinrichsweikamp
parents:
90
diff
changeset
|
293 MENU_CALL tppO2settings, do_ppo2_menu |
223579e905c3
Show a Safety Stop if enabled (Menu "Deco Parameters")
heinrichsweikamp
parents:
90
diff
changeset
|
294 MENU_OPTION tsafetystopmenu,oSafetyStop, 0 |
0 | 295 MENU_OPTION tFTTSMenu, oExtraTime,0 |
296 MENU_CALL tDecoparameters, do_decoparameters_menu | |
297 MENU_CALL tExit, do_continue_main_menu | |
298 MENU_END | |
299 | |
104
223579e905c3
Show a Safety Stop if enabled (Menu "Deco Parameters")
heinrichsweikamp
parents:
90
diff
changeset
|
300 do_ppo2_menu: |
337
508d7fb98b34
cleanup menu, add "Auto SP" option (Not working yet), minor layout change in compass menu
heinrichsweikamp
parents:
335
diff
changeset
|
301 MENU_BEGIN tppO2settings, .4 |
104
223579e905c3
Show a Safety Stop if enabled (Menu "Deco Parameters")
heinrichsweikamp
parents:
90
diff
changeset
|
302 MENU_DYNAMIC divesets_ppo2_max, do_toggle_ppo2_max |
223579e905c3
Show a Safety Stop if enabled (Menu "Deco Parameters")
heinrichsweikamp
parents:
90
diff
changeset
|
303 MENU_DYNAMIC divesets_ppo2_min, do_toggle_ppo2_min |
337
508d7fb98b34
cleanup menu, add "Auto SP" option (Not working yet), minor layout change in compass menu
heinrichsweikamp
parents:
335
diff
changeset
|
304 MENU_OPTION tShowppO2, oShowppO2, 0 |
104
223579e905c3
Show a Safety Stop if enabled (Menu "Deco Parameters")
heinrichsweikamp
parents:
90
diff
changeset
|
305 MENU_CALL tExit, do_return_divemode_menu |
223579e905c3
Show a Safety Stop if enabled (Menu "Deco Parameters")
heinrichsweikamp
parents:
90
diff
changeset
|
306 MENU_END |
223579e905c3
Show a Safety Stop if enabled (Menu "Deco Parameters")
heinrichsweikamp
parents:
90
diff
changeset
|
307 |
0 | 308 do_return_decoparameters_menu: |
428 | 309 rcall menu_tree_double_pop ; drop exit line and back to last line |
0 | 310 do_decoparameters_menu: |
311 MENU_BEGIN tDecoparameters, .7 | |
312 MENU_OPTION tGF_low, oGF_low, 0 | |
313 MENU_OPTION tGF_high, oGF_high, 0 | |
314 MENU_CALL taGFMenu, do_aGF_menu | |
315 MENU_OPTION tSaturationMult,osatmult, 0 | |
316 MENU_OPTION tDesaturationMult,odesatmult,0 | |
317 MENU_OPTION tLastDecostop,oLastDeco, 0 | |
318 MENU_CALL tExit, do_return_divemode_menu | |
319 MENU_END | |
320 | |
321 do_aGF_menu: | |
322 MENU_BEGIN taGFMenu, .4 | |
323 MENU_OPTION taGF_enable,oEnable_aGF, 0 | |
324 MENU_OPTION taGF_low, oaGF_low, 0 | |
325 MENU_OPTION taGF_high, oaGF_high, 0 | |
326 MENU_CALL tExit, do_return_decoparameters_menu | |
327 MENU_END | |
328 ;============================================================================= | |
329 ; Setup Menu | |
330 | |
331 do_return_settings: | |
332 bcf settime_setdate ; Clear flag | |
428 | 333 rcall menu_tree_double_pop ; drop exit line and back to last line |
0 | 334 |
335 extern compass_calibration_loop | |
336 do_settings_menu: | |
345 | 337 btfsc ble_available ; ble available |
338 bra do_settings_menu_ble ; Yes. | |
339 MENU_BEGIN tSystSets, .6 | |
0 | 340 MENU_CALL tInfoMenu, do_info_menu |
341 MENU_CALL tSetTimeDate, do_date_time_menu | |
342 MENU_CALL tDispSets, do_dispsets_menu | |
343 MENU_OPTION tLanguage, oLanguage, 0 | |
155
5f71e31bd5b3
CHANGE: Re-arranged Settings Menu, add 180? rotate to menu
heinrichsweikamp
parents:
154
diff
changeset
|
344 MENU_CALL tMore, do_settings_menu_more |
5f71e31bd5b3
CHANGE: Re-arranged Settings Menu, add 180? rotate to menu
heinrichsweikamp
parents:
154
diff
changeset
|
345 MENU_CALL tExit, do_continue_main_menu |
5f71e31bd5b3
CHANGE: Re-arranged Settings Menu, add 180? rotate to menu
heinrichsweikamp
parents:
154
diff
changeset
|
346 MENU_END |
5f71e31bd5b3
CHANGE: Re-arranged Settings Menu, add 180? rotate to menu
heinrichsweikamp
parents:
154
diff
changeset
|
347 |
345 | 348 do_settings_menu_ble: |
349 MENU_BEGIN tSystSets, .7 | |
350 MENU_CALL tInfoMenu, do_info_menu | |
351 MENU_CALL tBleTitle, comm_mode0 | |
352 MENU_CALL tSetTimeDate, do_date_time_menu | |
353 MENU_CALL tDispSets, do_dispsets_menu | |
354 MENU_OPTION tLanguage, oLanguage, 0 | |
355 MENU_CALL tMore, do_settings_menu_more | |
356 MENU_CALL tExit, do_continue_main_menu | |
357 MENU_END | |
326
d21b172d5a7a
VSIbar #4: VSI settings submenu, graph option, logbook offset and compass calib. menu exit fix
Janos Kovacs <kovjanos@gmail.com>
parents:
307
diff
changeset
|
358 |
d21b172d5a7a
VSIbar #4: VSI settings submenu, graph option, logbook offset and compass calib. menu exit fix
Janos Kovacs <kovjanos@gmail.com>
parents:
307
diff
changeset
|
359 do_return_settings_more: |
428 | 360 rcall menu_tree_double_pop ; drop exit line and back to last line |
220
effd7259f5a5
make button sensitivity configurable (cR hardware)
heinrichsweikamp
parents:
218
diff
changeset
|
361 |
155
5f71e31bd5b3
CHANGE: Re-arranged Settings Menu, add 180? rotate to menu
heinrichsweikamp
parents:
154
diff
changeset
|
362 do_settings_menu_more: |
243 | 363 btfsc rechargeable ; piezo buttons available |
269
1207cf9a9408
adjust menu for different hardware versions
heinrichsweikamp
parents:
243
diff
changeset
|
364 bra do_settings_menu_more_piezo |
243 | 365 btfsc ble_available ; ble available |
269
1207cf9a9408
adjust menu for different hardware versions
heinrichsweikamp
parents:
243
diff
changeset
|
366 bra do_settings_menu_more_ostc3p |
345 | 367 MENU_BEGIN tSystSets, .7 |
220
effd7259f5a5
make button sensitivity configurable (cR hardware)
heinrichsweikamp
parents:
218
diff
changeset
|
368 MENU_CALL tCompassMenu, do_compass_menu |
effd7259f5a5
make button sensitivity configurable (cR hardware)
heinrichsweikamp
parents:
218
diff
changeset
|
369 MENU_CALL tLogOffset, do_log_offset_menu |
effd7259f5a5
make button sensitivity configurable (cR hardware)
heinrichsweikamp
parents:
218
diff
changeset
|
370 MENU_OPTION tUnits, oUnits, 0 |
effd7259f5a5
make button sensitivity configurable (cR hardware)
heinrichsweikamp
parents:
218
diff
changeset
|
371 MENU_OPTION tSamplingrate,oSamplingRate,0 |
effd7259f5a5
make button sensitivity configurable (cR hardware)
heinrichsweikamp
parents:
218
diff
changeset
|
372 MENU_OPTION tDvSalinity,oDiveSalinity, 0 |
345 | 373 MENU_CALL tResetMenu, do_reset_menu |
220
effd7259f5a5
make button sensitivity configurable (cR hardware)
heinrichsweikamp
parents:
218
diff
changeset
|
374 MENU_CALL tExit, do_return_settings |
effd7259f5a5
make button sensitivity configurable (cR hardware)
heinrichsweikamp
parents:
218
diff
changeset
|
375 MENU_END |
effd7259f5a5
make button sensitivity configurable (cR hardware)
heinrichsweikamp
parents:
218
diff
changeset
|
376 |
375
a9e35c1327aa
1.88 release, BUGFIX: Start with Sensor use from sleep (cR only), CHANGE: Apply button settings when button menu is closed, NEW: Reset button settings on a magnet reset (cR and OSTC 2)
heinrichsweikamp
parents:
359
diff
changeset
|
377 do_settings_menu_more_piezo_exit: |
a9e35c1327aa
1.88 release, BUGFIX: Start with Sensor use from sleep (cR only), CHANGE: Apply button settings when button menu is closed, NEW: Reset button settings on a magnet reset (cR and OSTC 2)
heinrichsweikamp
parents:
359
diff
changeset
|
378 call TFT_ClearScreen |
a9e35c1327aa
1.88 release, BUGFIX: Start with Sensor use from sleep (cR only), CHANGE: Apply button settings when button menu is closed, NEW: Reset button settings on a magnet reset (cR and OSTC 2)
heinrichsweikamp
parents:
359
diff
changeset
|
379 extern piezo_config |
a9e35c1327aa
1.88 release, BUGFIX: Start with Sensor use from sleep (cR only), CHANGE: Apply button settings when button menu is closed, NEW: Reset button settings on a magnet reset (cR and OSTC 2)
heinrichsweikamp
parents:
359
diff
changeset
|
380 call piezo_config ; Configure buttons |
a9e35c1327aa
1.88 release, BUGFIX: Start with Sensor use from sleep (cR only), CHANGE: Apply button settings when button menu is closed, NEW: Reset button settings on a magnet reset (cR and OSTC 2)
heinrichsweikamp
parents:
359
diff
changeset
|
381 |
269
1207cf9a9408
adjust menu for different hardware versions
heinrichsweikamp
parents:
243
diff
changeset
|
382 do_settings_menu_more_piezo: |
218 | 383 MENU_BEGIN tSystSets, .7 |
18
4e3f133dfbf4
add new opt_compass_gain option to work with more magnetic battery types
heinrichsweikamp
parents:
0
diff
changeset
|
384 MENU_CALL tCompassMenu, do_compass_menu |
155
5f71e31bd5b3
CHANGE: Re-arranged Settings Menu, add 180? rotate to menu
heinrichsweikamp
parents:
154
diff
changeset
|
385 MENU_CALL tLogOffset, do_log_offset_menu |
5f71e31bd5b3
CHANGE: Re-arranged Settings Menu, add 180? rotate to menu
heinrichsweikamp
parents:
154
diff
changeset
|
386 MENU_OPTION tUnits, oUnits, 0 |
5f71e31bd5b3
CHANGE: Re-arranged Settings Menu, add 180? rotate to menu
heinrichsweikamp
parents:
154
diff
changeset
|
387 MENU_OPTION tSamplingrate,oSamplingRate,0 |
5f71e31bd5b3
CHANGE: Re-arranged Settings Menu, add 180? rotate to menu
heinrichsweikamp
parents:
154
diff
changeset
|
388 MENU_OPTION tDvSalinity,oDiveSalinity, 0 |
345 | 389 MENU_CALL tMore, do_settings_piezo_menu |
155
5f71e31bd5b3
CHANGE: Re-arranged Settings Menu, add 180? rotate to menu
heinrichsweikamp
parents:
154
diff
changeset
|
390 MENU_CALL tExit, do_return_settings |
0 | 391 MENU_END |
392 | |
220
effd7259f5a5
make button sensitivity configurable (cR hardware)
heinrichsweikamp
parents:
218
diff
changeset
|
393 extern comm_mode0 |
243 | 394 |
345 | 395 do_settings_piezo_menu: |
396 ; Menu with features only available in piezo button hardware | |
220
effd7259f5a5
make button sensitivity configurable (cR hardware)
heinrichsweikamp
parents:
218
diff
changeset
|
397 MENU_BEGIN tSystSets, .4 |
345 | 398 MENU_CALL tResetMenu, do_reset_menu |
220
effd7259f5a5
make button sensitivity configurable (cR hardware)
heinrichsweikamp
parents:
218
diff
changeset
|
399 MENU_OPTION tButtonleft,ocR_button_left ,0 ; left button sensitivity |
effd7259f5a5
make button sensitivity configurable (cR hardware)
heinrichsweikamp
parents:
218
diff
changeset
|
400 MENU_OPTION tButtonright,ocR_button_right,0 ; right button sensitivity |
375
a9e35c1327aa
1.88 release, BUGFIX: Start with Sensor use from sleep (cR only), CHANGE: Apply button settings when button menu is closed, NEW: Reset button settings on a magnet reset (cR and OSTC 2)
heinrichsweikamp
parents:
359
diff
changeset
|
401 MENU_CALL tExit, do_settings_menu_more_piezo_exit |
220
effd7259f5a5
make button sensitivity configurable (cR hardware)
heinrichsweikamp
parents:
218
diff
changeset
|
402 MENU_END |
effd7259f5a5
make button sensitivity configurable (cR hardware)
heinrichsweikamp
parents:
218
diff
changeset
|
403 |
269
1207cf9a9408
adjust menu for different hardware versions
heinrichsweikamp
parents:
243
diff
changeset
|
404 do_settings_menu_more_ostc3p: ; Menu with BLE feature |
243 | 405 MENU_BEGIN tSystSets, .7 |
406 MENU_CALL tCompassMenu, do_compass_menu | |
407 MENU_CALL tLogOffset, do_log_offset_menu | |
408 MENU_OPTION tUnits, oUnits, 0 | |
409 MENU_OPTION tSamplingrate,oSamplingRate,0 | |
410 MENU_OPTION tDvSalinity,oDiveSalinity, 0 | |
345 | 411 MENU_CALL tResetMenu, do_reset_menu |
243 | 412 MENU_CALL tExit, do_return_settings |
413 MENU_END | |
220
effd7259f5a5
make button sensitivity configurable (cR hardware)
heinrichsweikamp
parents:
218
diff
changeset
|
414 |
18
4e3f133dfbf4
add new opt_compass_gain option to work with more magnetic battery types
heinrichsweikamp
parents:
0
diff
changeset
|
415 do_compass_menu: |
90
3274e87fd027
NEW: automatic compass gain makes calibration quicker
heinrichsweikamp
parents:
78
diff
changeset
|
416 MENU_BEGIN tSystSets, .2 |
18
4e3f133dfbf4
add new opt_compass_gain option to work with more magnetic battery types
heinrichsweikamp
parents:
0
diff
changeset
|
417 MENU_CALL tCompassMenu, compass_calibration_loop |
90
3274e87fd027
NEW: automatic compass gain makes calibration quicker
heinrichsweikamp
parents:
78
diff
changeset
|
418 ; MENU_OPTION tCompassGain, oCompassGain, 0 |
326
d21b172d5a7a
VSIbar #4: VSI settings submenu, graph option, logbook offset and compass calib. menu exit fix
Janos Kovacs <kovjanos@gmail.com>
parents:
307
diff
changeset
|
419 MENU_CALL tExit, do_return_settings_more |
18
4e3f133dfbf4
add new opt_compass_gain option to work with more magnetic battery types
heinrichsweikamp
parents:
0
diff
changeset
|
420 MENU_END |
4e3f133dfbf4
add new opt_compass_gain option to work with more magnetic battery types
heinrichsweikamp
parents:
0
diff
changeset
|
421 |
0 | 422 ;============================================================================= |
423 ; Reset and confirmation menu. | |
424 | |
425 do_reset_menu: | |
63 | 426 MENU_BEGIN tResetMenu, .6 |
0 | 427 MENU_CALL tExit, do_return_settings |
428 MENU_CALL tReboot, do_reset_menu2 ; Confirm | |
429 MENU_CALL tResetDeco, do_reset_menu3 ; Confirm | |
430 MENU_CALL tResetSettings, do_reset_menu4 ; Confirm | |
63 | 431 MENU_CALL tResetLogbook, do_reset_menu5 ; Confirm |
0 | 432 MENU_CALL tResetBattery, new_battery_menu ; New Battery submenu |
433 MENU_END | |
434 | |
435 do_reset_menu2: | |
436 MENU_BEGIN tResetMenu2, .2 | |
437 MENU_CALL tAbort, do_continue_menu_3stack | |
438 MENU_CALL tReboot, do_reboot ; Reboot | |
439 MENU_END | |
440 | |
441 do_reset_menu3: | |
442 MENU_BEGIN tResetMenu2, .2 | |
443 MENU_CALL tAbort, do_continue_menu_3stack | |
444 MENU_CALL tResetDeco, do_reset_deco ; Reset Deco | |
445 MENU_END | |
446 | |
447 do_reset_menu4: | |
448 MENU_BEGIN tResetMenu2, .2 | |
449 MENU_CALL tAbort, do_continue_menu_3stack | |
450 MENU_CALL tResetSettings, do_reset_settings ; Reset all settings | |
451 MENU_END | |
452 | |
63 | 453 do_reset_menu5: |
454 MENU_BEGIN tResetMenu2, .2 | |
455 MENU_CALL tAbort, do_continue_menu_3stack | |
456 MENU_CALL tResetLogbook, do_reset_logbook ; Reset logbook | |
457 MENU_END | |
458 | |
459 do_reset_logbook: | |
460 clrf EEADRH ; Make sure to select eeprom bank 0 | |
461 clrf EEDATA | |
78
668b432dcae9
BUGFIX: Reset Logbook did not reset Logbook TOC properly
mh@mh-THINK.localdomain
parents:
76
diff
changeset
|
462 read_int_eeprom .2 |
396
61984f91174a
place total dives backup counter in eeprom 16:17
heinrichsweikamp
parents:
375
diff
changeset
|
463 write_int_eeprom .16 |
78
668b432dcae9
BUGFIX: Reset Logbook did not reset Logbook TOC properly
mh@mh-THINK.localdomain
parents:
76
diff
changeset
|
464 read_int_eeprom .3 |
396
61984f91174a
place total dives backup counter in eeprom 16:17
heinrichsweikamp
parents:
375
diff
changeset
|
465 write_int_eeprom .17 ; Copy number of dives |
144 | 466 clrf EEDATA |
78
668b432dcae9
BUGFIX: Reset Logbook did not reset Logbook TOC properly
mh@mh-THINK.localdomain
parents:
76
diff
changeset
|
467 write_int_eeprom .2 |
668b432dcae9
BUGFIX: Reset Logbook did not reset Logbook TOC properly
mh@mh-THINK.localdomain
parents:
76
diff
changeset
|
468 write_int_eeprom .3 ; Clear total dives |
63 | 469 write_int_eeprom .4 |
470 write_int_eeprom .5 | |
471 write_int_eeprom .6 ; Reset logbook pointers | |
472 call ext_flash_erase_logbook ; And complete logbook (!) | |
473 goto do_continue_main_menu ; back to menu | |
474 | |
0 | 475 |
476 do_reset_deco: | |
477 movlw d'79' ; 79% N2 | |
478 movff WREG,char_I_N2_ratio | |
479 movlw d'0' | |
480 movff WREG,char_I_step_is_1min ; 2 second deco mode | |
481 SAFE_2BYTE_COPY amb_pressure,int_I_pres_respiration ; copy for deco routine | |
482 movff int_I_pres_respiration+0,int_I_pres_surface+0 ; copy for desat routine | |
483 movff int_I_pres_respiration+1,int_I_pres_surface+1 | |
484 | |
485 extern deco_reset | |
486 call deco_reset | |
487 call deco_calc_desaturation_time ; calculate desaturation time | |
488 banksel common | |
489 call deco_calc_wo_deco_step_1_min ; calculate deco in surface mode | |
490 banksel common | |
491 clrf nofly_time+0 ; Reset NoFly | |
492 clrf nofly_time+1 | |
493 clrf desaturation_time+0 ; Reset Desat | |
494 clrf desaturation_time+1 | |
495 goto do_return_settings ; back to menu | |
496 | |
497 do_reset_settings: | |
139 | 498 banksel common |
0 | 499 extern option_reset_all |
500 call option_reset_all ; Reset all options to factory default. | |
76 | 501 goto restart ; Restart into surfacemode |
0 | 502 |
503 do_continue_menu_3stack: ; Return three levels deep | |
504 call menu_processor_pop | |
505 goto do_return_settings | |
506 | |
507 do_reboot: | |
508 call ext_flash_enable_protection ; Enables write protection | |
509 reset | |
510 | |
511 | |
512 do_date_time_menu: | |
513 MENU_BEGIN tSetTimeDate, .4 | |
514 MENU_CALL tSetTime, do_time_menu | |
515 MENU_CALL tSetDate, do_date_menu | |
516 MENU_OPTION tDateFormat,oDateFormat, 0 | |
517 MENU_CALL tExit, do_return_settings | |
518 MENU_END | |
519 | |
520 do_date_menu: | |
521 bsf settime_setdate | |
522 MENU_BEGIN tSetDate, .4 | |
523 MENU_OPTION tSetDay, oSetDay, 0 | |
50 | 524 MENU_OPTION tSetMonth, oSetMonth, 0 |
0 | 525 MENU_OPTION tSetYear, oSetYear, 0 |
526 MENU_CALL tExit, do_continue_menu_3stack | |
527 MENU_END | |
528 | |
529 | |
530 do_reset_seconds: | |
531 clrf secs | |
532 extern rtc_set_rtc | |
533 call rtc_set_rtc ; writes mins,sec,hours,day,month and year to rtc module | |
534 do_time_menu: | |
535 bsf settime_setdate | |
536 MENU_BEGIN tSetTime, .4 | |
537 MENU_OPTION tSetHours, oSetHours, 0 | |
538 MENU_OPTION tSetMinutes,oSetMinutes, 0 | |
539 MENU_CALL tSetSeconds, do_reset_seconds | |
540 MENU_CALL tExit, do_continue_menu_3stack | |
541 MENU_END | |
542 | |
543 | |
544 do_toggle_ppo2_max: ; add 0.1bar, with hard-coded max. | |
545 movff opt_ppO2_max,lo ; banksafe | |
546 movlw .10 | |
547 addwf lo,F | |
548 movlw ppo2_highest_setting | |
549 cpfsgt lo | |
550 bra do_toggle_ppo2_max2 | |
551 movlw .120 | |
552 movwf lo | |
553 do_toggle_ppo2_max2: | |
554 movff lo,opt_ppO2_max | |
555 return | |
556 | |
557 do_toggle_ppo2_min: ; sub 0.1bar, with hard-coded min. | |
558 movff opt_ppO2_min,lo ; banksafe | |
559 incf lo,F | |
560 movlw .21 | |
561 cpfsgt lo | |
562 bra do_toggle_ppo2_min2 | |
563 movlw ppo2_lowest_setting | |
564 movwf lo | |
565 do_toggle_ppo2_min2: | |
566 movff lo,opt_ppO2_min | |
567 return | |
568 | |
569 | |
570 ; Logbook offset sub-menu | |
571 do_log_offset_menu: | |
572 MENU_BEGIN tLogOffset, .6 | |
573 MENU_DYNAMIC TFT_LogOffset_Logtitle, 0 | |
574 MENU_CALL tLogOffsetp1, do_logoffset_plus1 | |
575 MENU_CALL tLogOffsetp10, do_logoffset_plus10 | |
576 MENU_CALL tLogOffsetm1, do_logoffset_minus1 | |
577 MENU_CALL tLogOffsetm10, do_logoffset_minus10 | |
326
d21b172d5a7a
VSIbar #4: VSI settings submenu, graph option, logbook offset and compass calib. menu exit fix
Janos Kovacs <kovjanos@gmail.com>
parents:
307
diff
changeset
|
578 MENU_CALL tExit, do_return_settings_more |
0 | 579 MENU_END |
580 | |
581 | |
582 do_logoffset_minus1: | |
583 call do_logoffset_common_read ; Read into lo:hi | |
584 movlw d'1' | |
585 subwf lo | |
586 movlw d'0' | |
587 subwfb hi | |
588 btfss hi,7 ; <0? | |
589 goto do_logoffset_common_write ; Store and return | |
590 clrf lo | |
591 clrf hi | |
592 goto do_logoffset_common_write ; Store and return | |
593 | |
594 do_logoffset_minus10: | |
595 call do_logoffset_common_read ; Read into lo:hi | |
596 movlw d'10' | |
597 subwf lo | |
598 movlw d'0' | |
599 subwfb hi | |
600 btfss hi,7 ; <0? | |
601 goto do_logoffset_common_write ; Store and return | |
602 clrf lo | |
603 clrf hi | |
604 goto do_logoffset_common_write ; Store and return | |
605 | |
606 do_logoffset_plus1: | |
607 call do_logoffset_common_read ; Read into lo:hi | |
148 | 608 infsnz lo,F |
609 incf hi,F | |
0 | 610 goto do_logoffset_common_write ; Store and return |
611 | |
612 do_logoffset_plus10: | |
613 call do_logoffset_common_read ; Read into lo:hi | |
614 movlw d'10' | |
615 addwf lo | |
616 movlw d'0' | |
617 addwfc hi | |
618 goto do_logoffset_common_write ; Store and return | |
619 | |
620 do_dispsets_menu_3stack: | |
50 | 621 bcf in_color_menu |
428 | 622 rcall menu_tree_double_pop ; drop exit line and back to last line |
0 | 623 |
624 do_dispsets_menu: | |
337
508d7fb98b34
cleanup menu, add "Auto SP" option (Not working yet), minor layout change in compass menu
heinrichsweikamp
parents:
335
diff
changeset
|
625 MENU_BEGIN tDispSets, .5 |
303
9b1b0b32e7d5
Add configuration option to control depth warning blinking
janos_kovacs <kovjanos@gmail.com>
parents:
298
diff
changeset
|
626 MENU_OPTION tBright, oBrightness, 0 |
9b1b0b32e7d5
Add configuration option to control depth warning blinking
janos_kovacs <kovjanos@gmail.com>
parents:
298
diff
changeset
|
627 MENU_CALL tColorScheme, do_color_scheme |
9b1b0b32e7d5
Add configuration option to control depth warning blinking
janos_kovacs <kovjanos@gmail.com>
parents:
298
diff
changeset
|
628 MENU_OPTION tFlip, oFlipScreen, 0 |
335
3d43da7acfe1
Always show ppO2 (warning position, standard color) option
janos_kovacs <kovjanos@gmail.com>
parents:
333
diff
changeset
|
629 MENU_CALL tMore, do_dispsets_menu_more |
3d43da7acfe1
Always show ppO2 (warning position, standard color) option
janos_kovacs <kovjanos@gmail.com>
parents:
333
diff
changeset
|
630 MENU_CALL tExit, do_return_settings |
3d43da7acfe1
Always show ppO2 (warning position, standard color) option
janos_kovacs <kovjanos@gmail.com>
parents:
333
diff
changeset
|
631 MENU_END |
3d43da7acfe1
Always show ppO2 (warning position, standard color) option
janos_kovacs <kovjanos@gmail.com>
parents:
333
diff
changeset
|
632 |
3d43da7acfe1
Always show ppO2 (warning position, standard color) option
janos_kovacs <kovjanos@gmail.com>
parents:
333
diff
changeset
|
633 do_dispsets_menu_more: |
337
508d7fb98b34
cleanup menu, add "Auto SP" option (Not working yet), minor layout change in compass menu
heinrichsweikamp
parents:
335
diff
changeset
|
634 MENU_BEGIN tDispSets, .4 |
508d7fb98b34
cleanup menu, add "Auto SP" option (Not working yet), minor layout change in compass menu
heinrichsweikamp
parents:
335
diff
changeset
|
635 MENU_OPTION tMODwarning, oMODwarning, 0 |
508d7fb98b34
cleanup menu, add "Auto SP" option (Not working yet), minor layout change in compass menu
heinrichsweikamp
parents:
335
diff
changeset
|
636 MENU_OPTION tVSItext2, oVSItextv2, 0 |
508d7fb98b34
cleanup menu, add "Auto SP" option (Not working yet), minor layout change in compass menu
heinrichsweikamp
parents:
335
diff
changeset
|
637 MENU_OPTION tVSIgraph, oVSIgraph, 0 |
335
3d43da7acfe1
Always show ppO2 (warning position, standard color) option
janos_kovacs <kovjanos@gmail.com>
parents:
333
diff
changeset
|
638 MENU_CALL tExit, do_dispsets_menu_3stack |
0 | 639 MENU_END |
640 | |
50 | 641 extern oColorSetDive |
642 do_color_scheme: | |
643 bsf in_color_menu | |
644 MENU_BEGIN tColorScheme, .2 | |
645 MENU_OPTION tColorSetDive,oColorSetDive, 0 | |
646 MENU_CALL tExit, do_dispsets_menu_3stack | |
647 MENU_END | |
648 | |
649 | |
0 | 650 ;============================================================================= |
651 | |
652 global new_battery_menu | |
653 new_battery_menu: | |
654 bsf enable_screen_dumps ; To prevent exiting into COMM mode immediately | |
655 call TFT_boot ; Initialize TFT (includes clear screen) | |
656 call TFT_Display_FadeIn ; Show splash | |
657 movlw .100 | |
658 movwf batt_percent ; make sure to reset batt_percent | |
659 | |
660 ; Default (In cases of timeout or USB): Use old battery | |
661 clrf EEADRH | |
662 read_int_eeprom 0x07 | |
663 movff EEDATA,battery_gauge+0 | |
664 read_int_eeprom 0x08 | |
665 movff EEDATA,battery_gauge+1 | |
666 read_int_eeprom 0x09 | |
667 movff EEDATA,battery_gauge+2 | |
668 read_int_eeprom 0x0A | |
669 movff EEDATA,battery_gauge+3 | |
670 read_int_eeprom 0x0B | |
671 movff EEDATA,battery_gauge+4 | |
672 read_int_eeprom 0x0C | |
673 movff EEDATA,battery_gauge+5 | |
674 | |
76 | 675 call menu_processor_reset ; restart from first icon. |
676 | |
0 | 677 MENU_BEGIN tNewBattTitle, .3 |
678 MENU_CALL tNewBattOld, use_old_batteries | |
679 MENU_CALL tNewBattNew36, use_new_36V_batteries | |
680 MENU_CALL tNewBattNew15, use_new_15V_batteries | |
681 MENU_END | |
682 | |
683 global use_old_batteries | |
684 use_old_batteries: | |
685 clrf EEADRH | |
686 read_int_eeprom 0x07 | |
687 movff EEDATA,battery_gauge+0 | |
688 read_int_eeprom 0x08 | |
689 movff EEDATA,battery_gauge+1 | |
690 read_int_eeprom 0x09 | |
691 movff EEDATA,battery_gauge+2 | |
692 read_int_eeprom 0x0A | |
693 movff EEDATA,battery_gauge+3 | |
694 read_int_eeprom 0x0B | |
695 movff EEDATA,battery_gauge+4 | |
696 read_int_eeprom 0x0C | |
697 movff EEDATA,battery_gauge+5 | |
698 movlw .100 | |
699 movwf batt_percent ; To have 1,5V batteries right after firmware update | |
700 goto power_on_return | |
701 | |
702 use_new_15V_batteries: | |
703 use_new_36V_batteries: | |
704 call reset_battery_pointer ; Resets battery pointer 0x07-0x0C and battery_gauge:5 | |
705 goto power_on_return | |
706 | |
707 END |