Mercurial > public > hwos_code
annotate src/menu_tree.asm @ 631:185ba2f91f59
3.09 beta 1 release
author | heinrichsweikamp |
---|---|
date | Fri, 28 Feb 2020 15:45:07 +0100 |
parents | 237931377539 |
children | 4050675965ea |
rev | line source |
---|---|
0 | 1 ;============================================================================= |
2 ; | |
631 | 3 ; File menu_tree.asm next combined generation V3.08.8 |
0 | 4 ; |
623 | 5 ; OSTC Surface Menus |
0 | 6 ; |
7 ; Copyright (c) 2011, JD Gascuel, HeinrichsWeikamp, all right reserved. | |
8 ;============================================================================= | |
9 ; HISTORY | |
10 ; 2011-07-11 : [jDG] Creation. | |
11 | |
604 | 12 #include "hwos.inc" ; mandatory header |
582 | 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" | |
604 | 21 #include "shared_definitions.h" ; mailbox from/to p2_deco.c |
582 | 22 #include "ghostwriter.inc" |
23 #include "adc_lightsensor.inc" | |
24 #include "wait.inc" | |
25 #include "i2c.inc" | |
623 | 26 #include "calibrate.inc" |
27 #include "math.inc" | |
28 #include "rtc.inc" | |
582 | 29 |
0 | 30 |
582 | 31 extern do_demo_divemode |
32 extern restart | |
631 | 33 extern option_check_and_store_all |
582 | 34 extern option_reset |
35 extern do_demo_planner | |
623 | 36 extern comm_mode_ble ; will also set CPU speed to normal |
582 | 37 extern piezo_config |
38 extern option_reset_all | |
39 extern surfloop | |
40 extern oColorSetDive | |
631 | 41 extern eeprom_deco_data_write |
623 | 42 |
43 IFDEF _ccr_pscr | |
604 | 44 extern option_cleanup_oCCRMode |
623 | 45 ENDIF |
46 | |
47 IFDEF _compass | |
48 extern compass_calibration_loop | |
49 ENDIF | |
174
932e91074bdb
CHANGE: Clarify Travel Gases with "---" as change depth
heinrichsweikamp
parents:
155
diff
changeset
|
50 |
582 | 51 |
604 | 52 menu_tree CODE |
582 | 53 |
623 | 54 ;----------------------------------------------------------------------------- |
55 | |
56 | |
0 | 57 ;============================================================================= |
58 ; Main Menu | |
582 | 59 |
60 do_return_main_menu: | |
604 | 61 call menu_processor_double_pop ; drop exit line and back to last line |
582 | 62 bra do_main_menu_common |
63 | |
64 global do_main_menu | |
0 | 65 do_main_menu: |
623 | 66 movff active_customview,customview_surfmode ; save last custom view |
67 clrf MS_flags_imprint ; clear all flags for data imprinting | |
0 | 68 |
582 | 69 global do_main_menu2 |
631 | 70 do_main_menu2: ; entry point used by logbook.asm |
71 call TFT_boot ; initialize display | |
72 call menu_processor_reset ; reset menu stack | |
0 | 73 |
582 | 74 do_main_menu_common: |
623 | 75 IFDEF _ccr_pscr |
582 | 76 MENU_BEGIN tMainMenu, .7 |
77 MENU_CALL tLogbook, logbook | |
78 MENU_CALL tGasSetup, do_gas_menu | |
79 MENU_CALL tCCRSetup, do_ccr_menu | |
80 MENU_CALL tDiveModeMenu, do_divemode_menu | |
631 | 81 MENU_CALL tSimulator, do_simulator_menu |
582 | 82 MENU_CALL tSystSets, do_settings_menu |
623 | 83 MENU_CALL tExit, do_restart |
582 | 84 MENU_END |
623 | 85 ELSE |
86 MENU_BEGIN tMainMenu, .6 | |
87 MENU_CALL tLogbook, logbook | |
88 MENU_CALL tGasSetup, do_gas_menu | |
89 MENU_CALL tDiveModeMenu, do_divemode_menu | |
631 | 90 MENU_CALL tSimulator, do_simulator_menu |
623 | 91 MENU_CALL tSystSets, do_settings_menu |
92 MENU_CALL tExit, do_restart | |
93 MENU_END | |
94 ENDIF | |
582 | 95 |
0 | 96 |
623 | 97 do_restart: |
98 bsf restart_fast ; skip logos and waits an restart | |
99 goto restart ; restart into surface mode | |
100 | |
0 | 101 ;============================================================================= |
102 ; CCR Setup | |
103 | |
623 | 104 IFDEF _ccr_pscr |
105 | |
582 | 106 do_return_ccr_menu: |
107 call menu_processor_double_pop ; drop exit line and back to last line | |
0 | 108 |
109 do_ccr_menu: | |
604 | 110 call option_cleanup_oCCRMode ; in pSCR mode, revert AutoSP (2) to calculated SP (0) |
560 | 111 |
623 | 112 IFDEF _external_sensor |
113 bcf imprint_sensor_mv ; stop imprinting of live O2 sensor mV data | |
582 | 114 btfsc analog_o2_input |
115 bra do_ccr_menu_cR | |
623 | 116 ENDIF |
240 | 117 |
628 | 118 MENU_BEGIN tCCRSetup, .5 ; OSTC3 menu (and currently also the OSTC2 menu) |
582 | 119 MENU_OPTION tCCRMode, oCCRMode, 0 |
120 MENU_CALL tDiluentSetup, do_diluent_setup | |
121 MENU_CALL tFixedSetpoints, do_fixed_setpoints | |
628 | 122 MENU_CALL tMore, do_ccr_menu_more |
604 | 123 MENU_CALL tBack, do_return_main_menu |
582 | 124 MENU_END |
125 | |
174
932e91074bdb
CHANGE: Clarify Travel Gases with "---" as change depth
heinrichsweikamp
parents:
155
diff
changeset
|
126 |
623 | 127 IFDEF _external_sensor |
128 | |
582 | 129 do_ccr_menu_cR: ; cR menu |
628 | 130 MENU_BEGIN tCCRSetup, .6 |
582 | 131 MENU_OPTION tCCRMode, oCCRMode, 0 |
132 MENU_CALL tCalibrateMenu, do_calibrate_menu | |
133 MENU_CALL tDiluentSetup, do_diluent_setup | |
134 MENU_CALL tFixedSetpoints, do_fixed_setpoints | |
628 | 135 MENU_CALL tMore, do_ccr_menu_more |
604 | 136 MENU_CALL tBack, do_return_main_menu |
582 | 137 MENU_END |
0 | 138 |
240 | 139 |
113 | 140 do_calibrate_menu: |
604 | 141 call enable_ir_s8 ; enable IR/S8-Port |
623 | 142 bsf imprint_sensor_mv ; start imprinting of live O2 sensor mV data |
582 | 143 |
113 | 144 do_calibrate_menu2: |
582 | 145 MENU_BEGIN tCalibrateMenu, .6 |
146 MENU_CALL tDiveHudMask1, 0 | |
147 MENU_CALL tDiveHudMask2, 0 | |
148 MENU_CALL tDiveHudMask3, 0 | |
623 | 149 MENU_OPTION tCalibrationGas, oCalGasO2, 0 |
582 | 150 MENU_CALL tCalibrate, do_calibrate_mix |
604 | 151 MENU_CALL tBack, do_return_ccr_menu |
582 | 152 MENU_END |
153 | |
113 | 154 |
155 do_calibrate_mix: | |
604 | 156 call calibrate_mix ; calibrate with opt_calibration_O2_ratio, also calibrate S8 HUD if connected |
157 WAITMS d'250' ; wait for HUD v3 | |
582 | 158 movlw .9 |
159 movff WREG,customview_surfmode ; show sensor mV custom view after restart | |
623 | 160 bsf restart_fast ; skip logos and waits an restart |
604 | 161 goto restart ; restart into surface mode |
113 | 162 |
623 | 163 ENDIF ; _external_sensor |
164 | |
0 | 165 |
166 do_diluent_setup: | |
623 | 167 bsf is_diluent_menu ; setting up diluents |
168 bcf short_gas_descriptions ; do not use short versions of gaslist_strcat_gas_cd and gaslist_strcat_setpoint | |
604 | 169 bcf better_gas_hint ; do not mark the best gas/diluent (to be used in dive mode only) |
170 call gaslist_cleanup_list ; take care that only one gas can be first | |
582 | 171 |
172 MENU_BEGIN tDiluentSetup, .6 | |
604 | 173 MENU_DYNAMIC gaslist_strcat_gas_cd, do_edit_gas_menu |
174 MENU_DYNAMIC gaslist_strcat_gas_cd, do_edit_gas_menu | |
175 MENU_DYNAMIC gaslist_strcat_gas_cd, do_edit_gas_menu | |
176 MENU_DYNAMIC gaslist_strcat_gas_cd, do_edit_gas_menu | |
177 MENU_DYNAMIC gaslist_strcat_gas_cd, do_edit_gas_menu | |
178 MENU_CALL tBack, do_return_ccr_menu | |
582 | 179 MENU_END |
180 | |
0 | 181 |
182 do_return_fixed_setpoints: | |
582 | 183 call menu_processor_double_pop ; drop exit line and back to last line |
0 | 184 |
185 do_fixed_setpoints: | |
623 | 186 bcf short_gas_descriptions ; =1: use short versions of gaslist_strcat_gas_cd and gaslist_strcat_setpoint |
604 | 187 bcf better_gas_hint ; do not mark the best gas/diluent (to be used in dive mode only) |
582 | 188 |
189 MENU_BEGIN tFixedSetpoints, .6 | |
190 MENU_DYNAMIC gaslist_strcat_setpoint, do_edit_sp_menu | |
191 MENU_DYNAMIC gaslist_strcat_setpoint, do_edit_sp_menu | |
192 MENU_DYNAMIC gaslist_strcat_setpoint, do_edit_sp_menu | |
193 MENU_DYNAMIC gaslist_strcat_setpoint, do_edit_sp_menu | |
194 MENU_DYNAMIC gaslist_strcat_setpoint, do_edit_sp_menu | |
604 | 195 MENU_CALL tBack, do_return_ccr_menu |
582 | 196 MENU_END |
197 | |
0 | 198 |
199 do_edit_sp_menu: | |
604 | 200 movff PRODL,gaslist_gas ; get menu item we came from (0-4) |
582 | 201 |
202 MENU_BEGIN tFixedSetpoints, .5 | |
203 MENU_DYNAMIC gaslist_strcat_setpoint_0, 0 | |
204 MENU_CALL tSPPlus, gaslist_spplus | |
205 MENU_CALL tDepthPlus, gaslist_spdepthplus | |
206 MENU_CALL tDepthMinus, gaslist_spdepthminus | |
604 | 207 MENU_CALL tBack, do_return_fixed_setpoints |
582 | 208 MENU_END |
209 | |
210 | |
628 | 211 do_ccr_menu_more: |
631 | 212 IFDEF _external_sensor |
213 MENU_BEGIN tCCRSetup, .6 ; CCR/pSCR more menu | |
214 MENU_OPTION tS8Mode, oS8Mode, 0 | |
215 MENU_OPTION tCCmaxFracO2, oCCmaxFracO2, 0 | |
216 MENU_OPTION tDilppO2Check, oDilppO2Check, 0 | |
217 MENU_OPTION tPSCR_O2_drop, oPSCR_drop, 0 | |
218 MENU_OPTION tPSCR_lungratio, oPSCR_lungratio, 0 | |
219 MENU_CALL tBack, do_return_ccr_menu | |
220 MENU_END | |
221 ELSE | |
628 | 222 MENU_BEGIN tCCRSetup, .5 ; CCR/pSCR more menu |
223 MENU_OPTION tCCmaxFracO2, oCCmaxFracO2, 0 | |
224 MENU_OPTION tDilppO2Check, oDilppO2Check, 0 | |
582 | 225 MENU_OPTION tPSCR_O2_drop, oPSCR_drop, 0 |
226 MENU_OPTION tPSCR_lungratio, oPSCR_lungratio, 0 | |
604 | 227 MENU_CALL tBack, do_return_ccr_menu |
582 | 228 MENU_END |
631 | 229 ENDIF ; _external_sensor |
0 | 230 |
623 | 231 ENDIF ; _ccr_pscr |
232 | |
0 | 233 ;============================================================================= |
234 ; OC Gas Setup | |
235 | |
582 | 236 do_return_gas_menu: |
237 call menu_processor_double_pop ; drop exit line and back to last line | |
0 | 238 |
623 | 239 IFDEF _ccr_pscr |
240 btfsc is_diluent_menu ; return from setting up diluents? | |
604 | 241 bra do_diluent_setup ; YES |
623 | 242 ENDIF |
582 | 243 |
0 | 244 do_gas_menu: |
623 | 245 bcf is_diluent_menu ; setting up OC gases |
246 bcf short_gas_descriptions ; do not use short versions of gaslist_strcat_gas_cd and gaslist_strcat_setpoint | |
604 | 247 bcf better_gas_hint ; do not mark the best gas/diluent (to be used in dive mode only) |
248 call gaslist_cleanup_list ; takes care that only one gas can be first | |
0 | 249 |
582 | 250 MENU_BEGIN tGaslist, .6 |
604 | 251 MENU_DYNAMIC gaslist_strcat_gas_cd, do_edit_gas_menu |
252 MENU_DYNAMIC gaslist_strcat_gas_cd, do_edit_gas_menu | |
253 MENU_DYNAMIC gaslist_strcat_gas_cd, do_edit_gas_menu | |
254 MENU_DYNAMIC gaslist_strcat_gas_cd, do_edit_gas_menu | |
255 MENU_DYNAMIC gaslist_strcat_gas_cd, do_edit_gas_menu | |
256 MENU_CALL tBack, do_return_main_menu | |
582 | 257 MENU_END |
258 | |
259 | |
260 do_return_edit_gas_menu: | |
604 | 261 IFDEF _rx_functions |
623 | 262 bcf imprint_xmitter_pres ; stop imprinting of transmitter pressure data |
263 bcf imprint_xmitter_ID ; not in transmitter selection menu any more (back to normal timeout) | |
604 | 264 ENDIF |
623 | 265 call menu_processor_double_pop ; drop exit line and back to last line |
582 | 266 bra do_edit_gas_menu_common |
623 | 267 |
604 | 268 do_edit_gas_menu: |
269 movff PRODL,gaslist_gas ; get menu item we came from (0-4) | |
270 movlw .5 ; offset between gases and diluents | |
623 | 271 btfsc is_diluent_menu ; setting up diluents? |
604 | 272 addwf gaslist_gas,F ; YES - add the offset |
0 | 273 |
604 | 274 do_edit_gas_menu_common: |
275 MENU_BEGIN tGasEdit, .7 | |
582 | 276 MENU_DYNAMIC gaslist_gastitle, 0 |
277 MENU_DYNAMIC gaslist_MOD_END, 0 | |
278 MENU_DYNAMIC gaslist_show_type, gaslist_toggle_type | |
604 | 279 MENU_CALL tSetup_GasMix, do_setup_mix_menu |
280 MENU_DYNAMIC gaslist_GasDepth, do_setup_depth_menu | |
281 MENU_CALL tSetup_Tank, do_setup_tank_menu | |
282 MENU_CALL tBack, do_return_gas_menu | |
582 | 283 MENU_END |
284 | |
0 | 285 |
604 | 286 do_setup_mix_menu: |
623 | 287 IFDEF _helium |
582 | 288 MENU_BEGIN tGasEdit, .7 |
289 MENU_DYNAMIC gaslist_gastitle, 0 | |
290 MENU_DYNAMIC gaslist_MOD_END, 0 | |
291 MENU_CALL tO2Plus, gaslist_pO2 | |
292 MENU_CALL tO2Minus, gaslist_mO2 | |
293 MENU_CALL tHePlus, gaslist_pHe | |
294 MENU_CALL tHeMinus, gaslist_mHe | |
604 | 295 MENU_CALL tBack, do_return_edit_gas_menu |
296 MENU_END | |
623 | 297 ELSE |
298 MENU_BEGIN tGasEdit, .5 | |
299 MENU_DYNAMIC gaslist_gastitle, 0 | |
300 MENU_DYNAMIC gaslist_MOD_END, 0 | |
301 MENU_CALL tO2Plus, gaslist_pO2 | |
302 MENU_CALL tO2Minus, gaslist_mO2 | |
303 MENU_CALL tBack, do_return_edit_gas_menu | |
304 MENU_END | |
305 ENDIF | |
604 | 306 |
307 | |
308 do_setup_tank_menu: | |
309 IFDEF _rx_functions | |
623 | 310 TSTOSC opt_TR_mode ; TR functions switched on? |
604 | 311 bra do_setup_tank_menu_rx ; YES |
312 ENDIF | |
313 | |
623 | 314 IFDEF _ccr_pscr |
604 | 315 MENU_BEGIN tSetup_Tank, .6 |
316 MENU_DYNAMIC gaslist_gastitle, 0 | |
317 MENU_DYNAMIC gaslist_tank_size_pres, 0 | |
318 MENU_CALL tTankSize, gaslist_tank_size | |
319 MENU_CALL tTankUsablePress, gaslist_tank_pres | |
320 MENU_CALL tCopyDilToOC, gaslist_copy_dil_to_oc | |
321 MENU_CALL tBack, do_return_edit_gas_menu | |
582 | 322 MENU_END |
623 | 323 ELSE |
324 MENU_BEGIN tSetup_Tank, .5 | |
325 MENU_DYNAMIC gaslist_gastitle, 0 | |
326 MENU_DYNAMIC gaslist_tank_size_pres, 0 | |
327 MENU_CALL tTankSize, gaslist_tank_size | |
328 MENU_CALL tTankUsablePress, gaslist_tank_pres | |
329 MENU_CALL tBack, do_return_edit_gas_menu | |
330 MENU_END | |
331 ENDIF | |
428 | 332 |
560 | 333 |
604 | 334 IFDEF _rx_functions |
335 do_setup_tank_menu_rx: | |
336 setf pairing_slot ; prime slot number with 255 aka -1, used in pairing function | |
623 | 337 bsf imprint_xmitter_ID ; in transmitter selection menu (longer timeout) |
604 | 338 |
339 MENU_BEGIN tSetup_Tank, .7 | |
340 MENU_DYNAMIC gaslist_gastitle, 0 | |
341 MENU_DYNAMIC gaslist_tank_id_pres, 0 ; when changing position, adopt TFT_menu_tank_pres! | |
342 MENU_DYNAMIC gaslist_tank_size_pres, 0 | |
343 MENU_CALL tTankPairing, gaslist_tank_pairing | |
344 MENU_CALL tTankSize, gaslist_tank_size | |
345 MENU_CALL tTankUsablePress, gaslist_tank_pres | |
346 MENU_CALL tBack, do_return_edit_gas_menu | |
347 MENU_END | |
348 ENDIF | |
349 | |
350 | |
351 do_setup_depth_menu: | |
174
932e91074bdb
CHANGE: Clarify Travel Gases with "---" as change depth
heinrichsweikamp
parents:
155
diff
changeset
|
352 |
582 | 353 MENU_BEGIN tGasEdit, .7 |
354 MENU_DYNAMIC gaslist_gastitle, 0 | |
355 MENU_DYNAMIC gaslist_MOD_END, 0 | |
356 MENU_DYNAMIC gaslist_ppo2, 0 ; ppO2 at change depth | |
357 MENU_CALL tDepthPlus, gaslist_pDepth | |
358 MENU_CALL tDepthMinus, gaslist_mDepth | |
359 MENU_DYNAMIC gaslist_reset_mod_title, gaslist_reset_mod | |
604 | 360 MENU_CALL tBack, do_return_edit_gas_menu |
582 | 361 MENU_END |
0 | 362 |
582 | 363 |
0 | 364 ;============================================================================= |
604 | 365 ; Simulator Menus |
0 | 366 |
582 | 367 do_return_planner_menu: |
628 | 368 call menu_processor_double_pop ; drop exit line and back to last line |
369 bra do_planner_common_1 | |
0 | 370 |
582 | 371 global do_return_demo_planner |
372 do_return_demo_planner: | |
373 call menu_processor_pop ; back to last line | |
374 bra do_planner_common | |
0 | 375 |
631 | 376 do_simulator_menu: |
628 | 377 ; reset planning parameters to default values |
582 | 378 lfsr FSR0,odiveInterval |
379 call option_reset | |
380 lfsr FSR0,obottomTime | |
381 call option_reset | |
382 lfsr FSR0,obottomDepth | |
383 call option_reset | |
604 | 384 lfsr FSR0,oSimAGF |
385 call option_reset | |
582 | 386 |
628 | 387 IFDEF _gas_contingency |
631 | 388 ; switch off gas contingency mode by default when entering the simulator menu |
628 | 389 clrf WREG |
631 | 390 movff WREG,opt_gas_contingency_sim |
628 | 391 ENDIF |
392 | |
582 | 393 do_planner_common: |
623 | 394 call restart_set_modes_and_flags ; initialize dive mode settings |
628 | 395 do_planner_common_1: |
604 | 396 movff opt_dive_mode,WREG ; get dive mode: 0=OC, 1=CCR, 2=Gauge, 3=Apnea, 4=pSCR |
397 dcfsnz WREG,W ; subtract one, became zero? | |
398 bra do_planner_common_ccr ; YES - use CCR version | |
399 | |
631 | 400 MENU_BEGIN tSimulator, .7 |
604 | 401 MENU_OPTION tIntvl, odiveInterval, 0 |
402 MENU_OPTION tBtDep, obottomDepth, 0 | |
403 MENU_CALL tInter, do_demo_divemode | |
404 MENU_OPTION tBtTm, obottomTime, 0 | |
405 MENU_OPTION tuseAGF, oSimAGF, 0 | |
406 MENU_CALL tDeco, do_demo_planner | |
407 MENU_CALL tBack, do_return_main_menu | |
408 MENU_END | |
409 | |
410 do_planner_common_ccr: | |
631 | 411 MENU_BEGIN tSimulator, .7 |
582 | 412 MENU_OPTION tIntvl, odiveInterval, 0 |
413 MENU_OPTION tBtDep, obottomDepth, 0 | |
414 MENU_CALL tInter, do_demo_divemode | |
415 MENU_OPTION tBtTm, obottomTime, 0 | |
631 | 416 MENU_CALL tCalculatorSetup, do_planner_config |
582 | 417 MENU_CALL tDeco, do_demo_planner |
604 | 418 MENU_CALL tBack, do_return_main_menu |
582 | 419 MENU_END |
0 | 420 |
298
2fe34fc0e2ae
new submenu for gas consumption, show actual mix instead of GAS1-GAS5 in deco planner
heinrichsweikamp
parents:
275
diff
changeset
|
421 do_planner_config: |
628 | 422 IFDEF _gas_contingency |
631 | 423 MENU_BEGIN tSimulator, .4 |
628 | 424 MENU_OPTION tSelectSetpoint, oSimSetpoint, 0 |
425 MENU_OPTION tuseAGF, oSimAGF, 0 | |
631 | 426 MENU_OPTION tGasContingencySim, oGasContingencySim, 0 |
628 | 427 MENU_CALL tBack, do_return_planner_menu |
428 MENU_END | |
429 ELSE | |
631 | 430 MENU_BEGIN tSimulator, .3 |
582 | 431 MENU_OPTION tSelectSetpoint, oSimSetpoint, 0 |
432 MENU_OPTION tuseAGF, oSimAGF, 0 | |
604 | 433 MENU_CALL tBack, do_return_planner_menu |
582 | 434 MENU_END |
628 | 435 ENDIF |
524 | 436 |
298
2fe34fc0e2ae
new submenu for gas consumption, show actual mix instead of GAS1-GAS5 in deco planner
heinrichsweikamp
parents:
275
diff
changeset
|
437 |
0 | 438 ;============================================================================= |
604 | 439 ; Divemode Menu |
0 | 440 |
441 do_return_divemode_menu: | |
582 | 442 call menu_processor_double_pop ; drop exit line and back to last line |
0 | 443 |
444 do_divemode_menu: | |
631 | 445 MENU_BEGIN tDiveModeMenu, .6 |
446 MENU_CALL tDiveSetup, do_dive_menu ; dive setup | |
447 MENU_CALL tDecoSetup, do_deco_menu ; deco setup | |
448 MENU_CALL tSACSetup, do_SAC_menu ; SAC setup | |
449 MENU_CALL tppO2Setup, do_ppo2_menu ; ppO2 limits | |
450 MENU_CALL tStopsSetup, do_stops_menu ; stops setup | |
604 | 451 MENU_CALL tBack, do_return_main_menu |
582 | 452 MENU_END |
453 | |
0 | 454 |
631 | 455 do_dive_menu: |
456 IFDEF _cave_mode | |
457 MENU_BEGIN tDiveModeMenu, .6 | |
458 MENU_OPTION tDvMode, oDiveMode, 0 ; dive mode | |
459 MENU_OPTION tCvMode, oCaveMode, 0 ; cave mode | |
460 MENU_OPTION tFTTSMenu, oExtraTime, 0 ; fTTS/delay | |
461 MENU_OPTION tTimeoutDive, oDiveTimeout, 0 ; dive timeout | |
462 MENU_OPTION tStoreApnoeDive, oStoreApnoe, 0 ; store apnoe | |
604 | 463 MENU_CALL tBack, do_return_divemode_menu |
582 | 464 MENU_END |
623 | 465 ELSE |
631 | 466 MENU_BEGIN tDiveModeMenu, .5 |
467 MENU_OPTION tDvMode, oDiveMode, 0 ; dive mode | |
468 MENU_OPTION tFTTSMenu, oExtraTime, 0 ; fTTS/delay | |
469 MENU_OPTION tTimeoutDive, oDiveTimeout, 0 ; dive timeout | |
470 MENU_OPTION tStoreApnoeDive, oStoreApnoe, 0 ; store apnoe | |
623 | 471 MENU_CALL tBack, do_return_divemode_menu |
472 MENU_END | |
473 ENDIF | |
582 | 474 |
104
223579e905c3
Show a Safety Stop if enabled (Menu "Deco Parameters")
heinrichsweikamp
parents:
90
diff
changeset
|
475 |
631 | 476 do_return_deco_menu: |
582 | 477 call menu_processor_double_pop ; drop exit line and back to last line |
478 | |
631 | 479 do_deco_menu: |
480 MENU_BEGIN tDecoSetup, .6 | |
481 MENU_OPTION tDkMode, oDecoMode, 0 ; ZH-L16 /GF | |
482 MENU_OPTION tSaturationMult, osatmultgf, 0 ; saturation | |
483 MENU_OPTION tDesaturationMult, odesatmultgf, 0 ; desaturation | |
484 MENU_OPTION tAltMode, oAltMode, 0 ; altitude mode | |
485 MENU_CALL tGFMenu, do_GF_menu ; GF settings | |
604 | 486 MENU_CALL tBack, do_return_divemode_menu |
582 | 487 MENU_END |
0 | 488 |
560 | 489 |
631 | 490 do_SAC_menu: |
491 IFDEF _gas_contingency | |
492 MENU_BEGIN tSACSetup, .6 | |
493 MENU_OPTION tCalcGasNeeds, oCalcAscGas, 0 ; calc.gas | |
494 MENU_OPTION tGasContingencyDive, oGasContingencyDive, 0 ; switch tank if used up | |
495 MENU_OPTION tGasChangeTime, oGasChangeTime, 0 ; gas change time | |
496 MENU_OPTION tSetWorkSAC, oWork_SAC, 0 ; work SAC | |
497 MENU_OPTION tSetDecoSAC, oDeco_SAC, 0 ; deco SAC | |
498 MENU_CALL tBack, do_return_divemode_menu | |
582 | 499 MENU_END |
631 | 500 ELSE |
501 MENU_BEGIN tSACSetup, .5 | |
502 MENU_OPTION tCalcGasNeeds, oCalcAscGas, 0 ; calc.gas | |
503 MENU_OPTION tGasChangeTime, oGasChangeTime, 0 ; gas change time | |
504 MENU_OPTION tSetWorkSAC, oWork_SAC, 0 ; work SAC | |
505 MENU_OPTION tSetDecoSAC, oDeco_SAC, 0 ; deco SAC | |
506 MENU_CALL tBack, do_return_divemode_menu | |
507 MENU_END | |
508 ENDIF | |
560 | 509 |
510 | |
631 | 511 do_ppo2_menu: |
512 IFDEF _ccr_pscr | |
513 IFDEF _helium | |
514 MENU_BEGIN tppO2Setup, .6 | |
515 MENU_DYNAMIC divesets_ppo2_max, do_toggle_ppo2_max_work ; max work | |
516 MENU_DYNAMIC divesets_ppo2_max_deco, do_toggle_ppo2_max_deco ; max deco | |
517 MENU_DYNAMIC divesets_ppo2_min, do_toggle_ppo2_min ; min OC | |
518 MENU_DYNAMIC divesets_ppo2_min_cc, do_toggle_ppo2_min_cc ; min loop | |
519 MENU_OPTION tIBCDwarning, oEnable_IBCD, 0 ; IBCD warning | |
520 MENU_CALL tBack, do_return_divemode_menu | |
521 MENU_END | |
522 ELSE | |
523 MENU_BEGIN tppO2Setup, .5 | |
524 MENU_DYNAMIC divesets_ppo2_max, do_toggle_ppo2_max_work ; max work | |
525 MENU_DYNAMIC divesets_ppo2_max_deco, do_toggle_ppo2_max_deco ; max deco | |
526 MENU_DYNAMIC divesets_ppo2_min, do_toggle_ppo2_min ; min OC | |
527 MENU_DYNAMIC divesets_ppo2_min_cc, do_toggle_ppo2_min_cc ; min loop | |
528 MENU_CALL tBack, do_return_divemode_menu | |
529 MENU_END | |
530 ENDIF ; _helium | |
531 ELSE | |
532 IFDEF _helium | |
533 MENU_BEGIN tppO2Setup, .5 | |
534 MENU_DYNAMIC divesets_ppo2_max, do_toggle_ppo2_max_work ; max work | |
535 MENU_DYNAMIC divesets_ppo2_max_deco, do_toggle_ppo2_max_deco ; max deco | |
536 MENU_DYNAMIC divesets_ppo2_min, do_toggle_ppo2_min ; min OC | |
537 MENU_OPTION tIBCDwarning, oEnable_IBCD, 0 ; IBCD warning | |
538 MENU_CALL tBack, do_return_divemode_menu | |
539 ELSE | |
540 MENU_BEGIN tppO2Setup, .4 | |
541 MENU_DYNAMIC divesets_ppo2_max, do_toggle_ppo2_max_work ; max work | |
542 MENU_DYNAMIC divesets_ppo2_max_deco, do_toggle_ppo2_max_deco ; max deco | |
543 MENU_DYNAMIC divesets_ppo2_min, do_toggle_ppo2_min ; min OC | |
544 MENU_CALL tBack, do_return_divemode_menu | |
545 MENU_END | |
546 ENDIF ; _helium | |
547 ENDIF ; _ccr_pscr | |
548 | |
549 | |
550 do_stops_menu: | |
551 MENU_BEGIN tStopsSetup, .6 | |
552 MENU_OPTION tSafetyStop, oSafetyStop, 0 ; safety stop | |
553 MENU_OPTION tExtendedStops, oExtendedStops, 0 ; extended stops | |
554 MENU_OPTION tLastDecostop, oLastDeco, 0 ; last deco stop | |
555 MENU_OPTION tDvSalinity, oDiveSalinity, 0 ; salinity | |
556 MENU_OPTION tDepthWarn, oMaxDepth, 0 ; depth limit | |
604 | 557 MENU_CALL tBack, do_return_divemode_menu |
582 | 558 MENU_END |
560 | 559 |
560 | |
604 | 561 do_GF_menu: |
562 MENU_BEGIN tGFMenu, .6 | |
631 | 563 MENU_OPTION tGF_low, oGF_low, 0 ; GF low |
564 MENU_OPTION tGF_high, oGF_high, 0 ; GF high | |
565 MENU_OPTION taGFenable, oEnable_aGF, 0 ; aGF selectable | |
566 MENU_OPTION taGF_low, oaGF_low, 0 ; aGF low | |
567 MENU_OPTION taGF_high, oaGF_high, 0 ; aGF high | |
568 MENU_CALL tBack, do_return_deco_menu | |
582 | 569 MENU_END |
560 | 570 |
571 | |
0 | 572 ;============================================================================= |
573 ; Setup Menu | |
631 | 574 do_return_settings_deeper: ; entry point for return from info menu 2 |
575 call menu_processor_pop ; drop one more stack entry | |
576 | |
0 | 577 do_return_settings: |
623 | 578 bcf imprint_time_date ; stop imprinting of current time & date |
582 | 579 call menu_processor_double_pop ; drop exit line and back to last line |
631 | 580 |
604 | 581 IFDEF _rx_mode |
623 | 582 bcf tr_functions_activated ; set TR functions as deactivated by default |
583 btfss ostc_rx_present ; TR model / TR module up & running? | |
631 | 584 bra do_settings_menu ; NO - use version w/o TR |
623 | 585 movff opt_TR_mode,WREG ; YES - get TR mode |
586 tstfsz WREG ; - TR mode <> off ? | |
587 bsf tr_functions_activated ; YES - set TR functions as activated | |
604 | 588 ENDIF |
582 | 589 |
0 | 590 do_settings_menu: |
631 | 591 IFDEF _hwos_sport |
592 bsf ble_available ; for very old OSTC sport | |
593 ENDIF | |
623 | 594 btfsc ble_available ; BLE available? |
582 | 595 bra do_settings_menu_ble ; YES |
631 | 596 |
597 MENU_BEGIN tSystSets, .5 | |
582 | 598 MENU_CALL tInfoMenu, do_info_menu |
599 MENU_CALL tSetTimeDate, do_date_time_menu | |
600 MENU_CALL tDispSets, do_dispsets_menu | |
631 | 601 MENU_CALL tSysSets, do_syssets_menu |
604 | 602 MENU_CALL tBack, do_return_main_menu |
582 | 603 MENU_END |
155
5f71e31bd5b3
CHANGE: Re-arranged Settings Menu, add 180? rotate to menu
heinrichsweikamp
parents:
154
diff
changeset
|
604 |
631 | 605 |
345 | 606 do_settings_menu_ble: |
604 | 607 IFDEF _rx_functions |
631 | 608 btfss ostc_rx_present ; TR model and TR activated? |
609 bra do_settings_menu_noRX ; NO | |
604 | 610 |
611 MENU_BEGIN tSystSets, .7 | |
612 MENU_CALL tInfoMenu, do_info_menu | |
623 | 613 MENU_CALL tBleTitle, comm_mode_ble |
604 | 614 MENU_CALL tTrSettings, do_settings_menu_TR |
615 MENU_CALL tSetTimeDate, do_date_time_menu | |
616 MENU_CALL tDispSets, do_dispsets_menu | |
631 | 617 MENU_CALL tSysSets, do_syssets_menu |
604 | 618 MENU_CALL tBack, do_return_main_menu |
619 MENU_END | |
620 ENDIF | |
621 | |
631 | 622 do_settings_menu_noRX: |
623 MENU_BEGIN tSystSets, .6 | |
624 MENU_CALL tInfoMenu, do_info_menu | |
625 MENU_CALL tBleTitle, comm_mode_ble | |
626 MENU_CALL tSetTimeDate, do_date_time_menu | |
627 MENU_CALL tDispSets, do_dispsets_menu | |
628 MENU_CALL tSysSets, do_syssets_menu | |
629 MENU_CALL tBack, do_return_main_menu | |
630 MENU_END | |
631 | |
604 | 632 |
582 | 633 do_info_menu: |
604 | 634 IFDEF _rx_functions |
631 | 635 btfss ostc_rx_present ; TR model? |
636 bra do_info_menu_noRX ; NO | |
604 | 637 |
631 | 638 MENU_BEGIN tInfoMenu, .7 |
639 MENU_DYNAMIC info_menu_uptime, 0 | |
582 | 640 MENU_DYNAMIC info_menu_serial, 0 |
641 MENU_DYNAMIC info_menu_firmware, 0 | |
631 | 642 MENU_DYNAMIC info_menu_fw_cration_date, 0 |
604 | 643 MENU_DYNAMIC info_menu_firmware_rx, 0 |
631 | 644 MENU_DYNAMIC info_menu_total_dives, 0 |
628 | 645 MENU_CALL tMore, do_info_menu2 |
582 | 646 MENU_END |
604 | 647 ENDIF |
648 | |
631 | 649 do_info_menu_noRX: |
650 MENU_BEGIN tInfoMenu, .6 | |
651 MENU_DYNAMIC info_menu_uptime, 0 | |
652 MENU_DYNAMIC info_menu_serial, 0 | |
653 MENU_DYNAMIC info_menu_firmware, 0 | |
654 MENU_DYNAMIC info_menu_fw_cration_date, 0 | |
628 | 655 MENU_DYNAMIC info_menu_total_dives, 0 |
631 | 656 MENU_CALL tMore, do_info_menu2 |
657 MENU_END | |
658 | |
659 do_info_menu2: | |
660 MENU_BEGIN tInfoMenu, .5 | |
661 MENU_DYNAMIC info_menu_battery_volts, 0 | |
662 MENU_DYNAMIC info_menu_config, 0 | |
663 MENU_DYNAMIC info_menu_sensor_calib, 0 | |
664 MENU_DYNAMIC info_menu_sensor_offset, 0 | |
628 | 665 MENU_CALL tBack, do_return_settings_deeper |
666 MENU_END | |
631 | 667 |
604 | 668 |
669 IFDEF _rx_functions | |
623 | 670 |
604 | 671 do_settings_menu_TR: |
672 movff opt_dive_mode,WREG ; get dive mode: 0=OC, 1=CCR, 2=Gauge, 3=Apnea, 4=pSCR | |
673 incf WREG,W ; add 1 | |
674 dcfsnz WREG,W ; subtract one, became zero? | |
675 bra do_settings_menu_TR_MaxDelta; YES - OC | |
676 dcfsnz WREG,W ; subtract one, became zero? | |
677 bra do_settings_menu_TR_BailPres; YES - CCR | |
678 dcfsnz WREG,W ; subtract one, became zero? | |
679 bra do_settings_menu_TR_MaxDelta; YES - Gauge | |
680 dcfsnz WREG,W ; subtract one, became zero? | |
681 bra do_settings_menu_TR_abort ; YES - Apnea, abort | |
682 dcfsnz WREG,W ; subtract one, became zero? | |
683 bra do_settings_menu_TR_both ; YES - pSCR | |
684 do_settings_menu_TR_abort: | |
685 call menu_processor_pop ; drop last menu selection | |
686 bra do_settings_menu ; back to last menu | |
687 | |
688 do_settings_menu_TR_MaxDelta: ; menu with oTrMaxDeltaPres | |
689 MENU_BEGIN tTrSettings, .5 | |
690 MENU_OPTION tTrMode, oTrMode, 0 | |
691 MENU_OPTION tTr1stPres, oTr1stPres, 0 | |
692 MENU_OPTION tTr2ndPres, oTr2ndPres, 0 | |
693 MENU_DYNAMIC do_toggle_max_pres_diff_label,do_toggle_max_pres_diff | |
694 MENU_CALL tBack, do_return_settings | |
695 MENU_END | |
696 | |
697 do_settings_menu_TR_BailPres: ; menu with oTrBailPres | |
698 MENU_BEGIN tTrSettings, .5 | |
699 MENU_OPTION tTrMode, oTrMode, 0 | |
700 MENU_OPTION tTr1stPres, oTr1stPres, 0 | |
701 MENU_OPTION tTr2ndPres, oTr2ndPres, 0 | |
702 MENU_OPTION tTrBailPres, oTrBailPres, 0 | |
703 MENU_CALL tBack, do_return_settings | |
704 MENU_END | |
705 | |
706 do_settings_menu_TR_both: ; menu with oTrBailPres and oTrMaxDeltaPres | |
707 MENU_BEGIN tTrSettings, .6 | |
708 MENU_OPTION tTrMode, oTrMode, 0 | |
709 MENU_OPTION tTr1stPres, oTr1stPres, 0 | |
710 MENU_OPTION tTr2ndPres, oTr2ndPres, 0 | |
711 MENU_OPTION tTrBailPres, oTrBailPres, 0 | |
712 MENU_DYNAMIC do_toggle_max_pres_diff_label,do_toggle_max_pres_diff | |
713 MENU_CALL tBack, do_return_settings | |
714 MENU_END | |
715 | |
716 | |
717 do_toggle_max_pres_diff: ; add 5 bar, with hard-coded max. | |
718 movff char_I_max_pres_diff,lo ; get current value | |
719 movlw .5 ; load increment | |
720 addwf lo,F ; add increment | |
721 movlw max_pres_diff_max ; load maximum value | |
722 cpfsgt lo ; above maximum value? | |
723 bra do_toggle_max_pres_diff_1 ; NO - store new value | |
724 movlw max_pres_diff_min ; YES - load minimum value | |
725 movwf lo ; - into lo | |
726 do_toggle_max_pres_diff_1: | |
727 movff lo,char_I_max_pres_diff ; write back new value | |
728 return ; done | |
623 | 729 |
730 ENDIF ; _rx_functions | |
582 | 731 |
732 | |
733 do_return_settings_more_deeper: ; entry point for returns from reset sub-menu | |
734 call menu_processor_pop ; drop one more stack entry | |
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
|
735 |
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
|
736 do_return_settings_more: |
582 | 737 call menu_processor_double_pop ; drop exit line and back to last line |
738 | |
631 | 739 do_syssets_menu: |
623 | 740 btfsc battery_gauge_available ; piezo buttons available? |
631 | 741 bra do_syssets_menu_piezo ; YES |
623 | 742 |
743 IFDEF _compass | |
631 | 744 MENU_BEGIN tSystSets, .4 ; All MENU_CALLs in this menu |
745 MENU_CALL tCompassMenu, do_compass_menu ; need to stay together on this | |
746 MENU_CALL tLogOffset, do_log_offset_menu ; menu level in order to not | |
747 MENU_CALL tResetMenu, do_reset_menu ; mess up the menu stack on doing | |
748 MENU_CALL tBack, do_return_settings ; the do_return_settings ! | |
582 | 749 MENU_END |
623 | 750 ELSE |
631 | 751 MENU_BEGIN tSystSets, .3 ; see above |
623 | 752 MENU_CALL tLogOffset, do_log_offset_menu ; |
753 MENU_CALL tResetMenu, do_reset_menu ; | |
754 MENU_CALL tBack, do_return_settings ; | |
755 MENU_END | |
756 ENDIF ; _compass | |
220
effd7259f5a5
make button sensitivity configurable (cR hardware)
heinrichsweikamp
parents:
218
diff
changeset
|
757 |
582 | 758 |
631 | 759 do_return_syssets_menu_piezo: |
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
|
760 call TFT_ClearScreen |
604 | 761 call piezo_config ; configure buttons |
582 | 762 call menu_processor_double_pop ; drop exit line and back to last line |
524 | 763 |
631 | 764 do_syssets_menu_piezo: |
623 | 765 IFDEF _compass |
631 | 766 MENU_BEGIN tSystSets, .6 |
604 | 767 MENU_CALL tCompassMenu, do_compass_menu ; see above |
768 MENU_CALL tLogOffset, do_log_offset_menu ; | |
631 | 769 MENU_DYNAMIC info_menu_total_dives, 0 |
604 | 770 MENU_CALL tResetMenu, do_reset_menu ; |
631 | 771 MENU_CALL tPiezo, do_settings_piezo_menu ; |
623 | 772 MENU_CALL tBack, do_return_settings ; |
582 | 773 MENU_END |
623 | 774 ELSE |
631 | 775 MENU_BEGIN tSystSets, .5 |
623 | 776 MENU_CALL tLogOffset, do_log_offset_menu ; see above |
631 | 777 MENU_DYNAMIC info_menu_total_dives, 0 |
604 | 778 MENU_CALL tResetMenu, do_reset_menu ; |
631 | 779 MENU_CALL tPiezo, do_settings_piezo_menu ; |
623 | 780 MENU_CALL tBack, do_return_settings ; |
582 | 781 MENU_END |
623 | 782 ENDIF |
582 | 783 |
243 | 784 |
345 | 785 do_settings_piezo_menu: |
582 | 786 ; Menu with features only available in piezo button hardware |
631 | 787 MENU_BEGIN tPiezo, .3 |
604 | 788 MENU_OPTION tButtonleft, ocR_button_left, 0 ; left button sensitivity |
582 | 789 MENU_OPTION tButtonright, ocR_button_right, 0 ; right button sensitivity |
631 | 790 MENU_CALL tBack, do_return_syssets_menu_piezo |
582 | 791 MENU_END |
220
effd7259f5a5
make button sensitivity configurable (cR hardware)
heinrichsweikamp
parents:
218
diff
changeset
|
792 |
effd7259f5a5
make button sensitivity configurable (cR hardware)
heinrichsweikamp
parents:
218
diff
changeset
|
793 |
623 | 794 IFDEF _compass |
795 | |
18
4e3f133dfbf4
add new opt_compass_gain option to work with more magnetic battery types
heinrichsweikamp
parents:
0
diff
changeset
|
796 do_compass_menu: |
631 | 797 MENU_BEGIN tCompassMenu, .5 |
623 | 798 MENU_CALL tCompassMenu, compass_calibration_loop ; exits to surface loop |
582 | 799 ; MENU_OPTION tCompassGain, oCompassGain, 0 |
800 MENU_DYNAMIC menu_cal_x, 0 | |
801 MENU_DYNAMIC menu_cal_y, 0 | |
802 MENU_DYNAMIC menu_cal_z, 0 | |
604 | 803 MENU_CALL tBack, do_return_settings_more |
582 | 804 MENU_END |
805 | |
623 | 806 ENDIF ; _compass |
807 | |
18
4e3f133dfbf4
add new opt_compass_gain option to work with more magnetic battery types
heinrichsweikamp
parents:
0
diff
changeset
|
808 |
0 | 809 ;============================================================================= |
604 | 810 ; Reset and confirmation menu |
0 | 811 |
812 do_reset_menu: | |
582 | 813 MENU_BEGIN tResetMenu, .6 |
604 | 814 MENU_CALL tBack, do_return_settings_more |
623 | 815 MENU_CALL tReboot, do_reset_menu_reboot ; confirm |
816 MENU_CALL tResetDeco, do_reset_menu_deco ; confirm | |
817 MENU_CALL tResetSettings, do_reset_menu_settings ; confirm | |
818 MENU_CALL tResetLogbook, do_reset_menu_logbook ; confirm | |
604 | 819 MENU_CALL tResetBattery, do_new_battery_menu ; confirm |
582 | 820 MENU_END |
0 | 821 |
623 | 822 do_reset_menu_reboot: |
582 | 823 MENU_BEGIN tResetMenu2, .2 |
824 MENU_CALL tAbort, do_return_settings_more_deeper | |
623 | 825 MENU_CALL tReboot, do_reboot ; reboot (cold start) |
582 | 826 MENU_END |
0 | 827 |
623 | 828 do_reset_menu_deco: |
582 | 829 MENU_BEGIN tResetMenu2, .2 |
830 MENU_CALL tAbort, do_return_settings_more_deeper | |
623 | 831 MENU_CALL tResetDeco, do_reset_deco ; reset deco and return to main reset menu |
582 | 832 MENU_END |
0 | 833 |
623 | 834 do_reset_menu_settings: |
582 | 835 MENU_BEGIN tResetMenu2, .2 |
836 MENU_CALL tAbort, do_return_settings_more_deeper | |
623 | 837 MENU_CALL tResetSettings, do_reset_settings ; reset all settings and go to surface mode |
582 | 838 MENU_END |
0 | 839 |
623 | 840 do_reset_menu_logbook: |
582 | 841 MENU_BEGIN tResetMenu2, .2 |
842 MENU_CALL tAbort, do_return_settings_more_deeper | |
623 | 843 MENU_CALL tResetLogbook, do_reset_logbook ; reset logbook and return to main reset menu |
582 | 844 MENU_END |
845 | |
63 | 846 |
847 do_reset_logbook: | |
631 | 848 call erase_complete_logbook ; erase complete logbook |
604 | 849 bra do_return_settings_more_deeper |
63 | 850 |
0 | 851 do_reset_deco: |
623 | 852 call deco_clear_tissue ; set all tissues to absolute pressure * N2_ratio (C-code) |
853 call deco_calc_dive_interval_1min ; update tissues by 1 minute to calculate current GF factor (C-code) | |
854 call deco_calc_desaturation_time ; calculate desaturation and no-fly/no-altitude time (C-code) | |
582 | 855 banksel common |
631 | 856 call eeprom_deco_data_write ; store updated deco data into EEPROM |
604 | 857 bra do_return_settings_more_deeper |
582 | 858 |
0 | 859 |
860 do_reset_settings: | |
631 | 861 call TFT_ClearScreen ; clear screen to show start of activity |
604 | 862 call option_reset_all ; reset all options to factory default |
623 | 863 call do_logoffset_reset ; reset log offset |
864 goto restart ; restart into surface mode | |
0 | 865 |
866 do_reboot: | |
631 | 867 call ext_flash_enable_protection ; set write protection on external flash |
868 call eeprom_deco_data_write ; update deco data in EEPROM | |
869 call eeprom_battery_gauge_write ; update battery gauge in EEPROM | |
870 btfsc options_changed ; do the options need to be stored to EEPROM ? | |
871 call option_check_and_store_all ; YES - check and store all option values in EEPROM | |
872 reset ; cold-start the processor | |
0 | 873 |
623 | 874 do_return_date_time_menu: |
875 call menu_processor_double_pop ; drop exit line and back to last line | |
0 | 876 |
877 do_date_time_menu: | |
623 | 878 bsf imprint_time_date ; start imprinting current time & date |
879 bcf block_option_value ; allow display of option values again | |
880 | |
582 | 881 MENU_BEGIN tSetTimeDate, .4 |
882 MENU_CALL tSetTime, do_time_menu | |
883 MENU_CALL tSetDate, do_date_menu | |
623 | 884 MENU_OPTION tDateFormat, oDateFormat, 0 |
604 | 885 MENU_CALL tBack, do_return_settings |
582 | 886 MENU_END |
887 | |
0 | 888 |
889 do_date_menu: | |
623 | 890 bsf block_option_value ; suspend display of option values |
582 | 891 |
892 MENU_BEGIN tSetDate, .4 | |
893 MENU_OPTION tSetDay, oSetDay, 0 | |
894 MENU_OPTION tSetMonth, oSetMonth, 0 | |
895 MENU_OPTION tSetYear, oSetYear, 0 | |
623 | 896 MENU_CALL tBack, do_return_date_time_menu |
582 | 897 MENU_END |
0 | 898 |
899 | |
900 do_time_menu: | |
623 | 901 bsf block_option_value ; suspend display of option values |
582 | 902 |
903 MENU_BEGIN tSetTime, .4 | |
904 MENU_OPTION tSetHours, oSetHours, 0 | |
905 MENU_OPTION tSetMinutes, oSetMinutes, 0 | |
623 | 906 MENU_OPTION tSetSeconds, oClearSeconds, 0 |
907 MENU_CALL tBack, do_return_date_time_menu | |
582 | 908 MENU_END |
0 | 909 |
910 | |
631 | 911 do_toggle_ppo2_max_work: ; add 0.1 bar |
623 | 912 movff char_I_ppO2_max_work,lo ; bank-safe copy |
582 | 913 movlw .10 |
0 | 914 addwf lo,F |
582 | 915 movlw ppo2_warning_high_highest |
0 | 916 cpfsgt lo |
582 | 917 bra do_toggle_ppo2_max2 |
918 movlw ppo2_warning_high_lowest | |
0 | 919 movwf lo |
920 do_toggle_ppo2_max2: | |
623 | 921 movff lo,char_I_ppO2_max_work |
582 | 922 return |
0 | 923 |
631 | 924 do_toggle_ppo2_max_deco: ; add 0.1 bar |
623 | 925 movff char_I_ppO2_max_deco,lo ; bank-safe copy |
582 | 926 movlw .10 |
507
4e6f5c36f4cc
NEW: Two ppO2 max settings. One for travel/bottom and one for deco gases
heinrichsweikamp
parents:
505
diff
changeset
|
927 addwf lo,F |
582 | 928 movlw ppo2_warning_deco_highest |
507
4e6f5c36f4cc
NEW: Two ppO2 max settings. One for travel/bottom and one for deco gases
heinrichsweikamp
parents:
505
diff
changeset
|
929 cpfsgt lo |
582 | 930 bra do_toggle_ppo2_max_deco2 |
931 movlw ppo2_warning_deco_lowest | |
507
4e6f5c36f4cc
NEW: Two ppO2 max settings. One for travel/bottom and one for deco gases
heinrichsweikamp
parents:
505
diff
changeset
|
932 movwf lo |
4e6f5c36f4cc
NEW: Two ppO2 max settings. One for travel/bottom and one for deco gases
heinrichsweikamp
parents:
505
diff
changeset
|
933 do_toggle_ppo2_max_deco2: |
582 | 934 movff lo,char_I_ppO2_max_deco |
935 return | |
936 | |
631 | 937 do_toggle_ppo2_min: ; sub 0.1 bar |
623 | 938 movff char_I_ppO2_min,lo ; bank-safe copy |
582 | 939 incf lo,F |
940 movlw ppo2_warning_low_highest | |
0 | 941 cpfsgt lo |
582 | 942 bra do_toggle_ppo2_min2 |
943 movlw ppo2_warning_low_lowest | |
0 | 944 movwf lo |
945 do_toggle_ppo2_min2: | |
582 | 946 movff lo,char_I_ppO2_min |
947 return | |
0 | 948 |
631 | 949 do_toggle_ppo2_min_cc: ; sub 0.1 bar |
623 | 950 movff char_I_ppO2_min_loop,lo ; bank-safe copy |
582 | 951 incf lo,F |
952 movlw ppo2_warning_loop_highest | |
560 | 953 cpfsgt lo |
582 | 954 bra do_toggle_ppo2_min_cc2 |
955 movlw ppo2_warning_loop_lowest | |
560 | 956 movwf lo |
957 do_toggle_ppo2_min_cc2: | |
582 | 958 movff lo,char_I_ppO2_min_loop |
959 return | |
960 | |
0 | 961 |
962 ; Logbook offset sub-menu | |
963 do_log_offset_menu: | |
623 | 964 |
965 clrf WREG ; select an initial step size of 1 | |
966 movff WREG,opt_logoffset_step ; bank-safe write to option variable | |
967 | |
968 MENU_BEGIN tLogOffset, .5 | |
969 MENU_DYNAMIC TFT_LogOffset, 0 | |
970 MENU_OPTION tLogOffStepSize, oLogOffsetStep, 0 | |
971 MENU_CALL tLogOffsetplus, do_logoffset_plus | |
972 MENU_CALL tLogOffsetminus, do_logoffset_minus | |
604 | 973 MENU_CALL tBack, do_return_settings_more |
582 | 974 MENU_END |
0 | 975 |
976 | |
623 | 977 do_logoffset_common: |
631 | 978 call eeprom_log_offset_read ; read current offset into mpr+1:mpr+0 |
623 | 979 movff opt_logoffset_step,ul ; get step size: 0=1, 1=10, 2=100, 3=1000 |
980 incf ul,F ; 0...3 -> 1...4 | |
981 clrf mpr+3 ; clear step size, high byte | |
982 movlw .1 ; set a step size of 1 | |
983 movwf mpr+2 ; copy to step size, low byte | |
984 dcfsnz ul,F ; ul--, did ul became 0, i.e. step size = 1 ? | |
985 return ; YES - done | |
986 movlw .10 ; NO - set a step size of 10 | |
987 movwf mpr+2 ; - copy to step size, low byte | |
988 dcfsnz ul,F ; ul--, did ul became 0, i.e. step size = 10 ? | |
989 return ; YES - done | |
990 movlw .100 ; NO - set a step size of 100 | |
991 movwf mpr+2 ; - copy to step size, low byte | |
992 dcfsnz ul,F ; ul--, did ul became 0, i.e. step size = 100 ? | |
993 return ; YES - done | |
994 movlw LOW .1000 ; NO - set a step size of 1000, low byte | |
995 movwf mpr+2 ; - copy to step size, low byte | |
996 movlw HIGH .1000 ; - set a step size of 1000, high byte | |
997 movwf mpr+3 ; - copy to step size, high byte | |
998 return ; - done | |
0 | 999 |
623 | 1000 do_logoffset_plus: |
1001 rcall do_logoffset_common ; load current offset and step size | |
1002 ; add step size to current offset | |
1003 movf mpr+2,W ; get step size, low byte | |
1004 addwf mpr+0,F ; add to offset, low byte | |
1005 movf mpr+3,W ; get step size, high byte | |
1006 addwfc mpr+1,F ; add to offset, high byte, considering carry flag | |
1007 ; check if new offset is within limit | |
1008 MOVLI .9999,sub_a ; load max limit into sub_a | |
1009 MOVII mpr, sub_b ; copy new offset into sub_b | |
1010 call cmpU16 ; compute sub_a - sub_b, setting neg_flag if result becomes negative | |
1011 btfss neg_flag ; neg_flag set, i.e. new offset > 9999 ? | |
1012 bra do_logoffset_exit ; NO - store offset and return | |
1013 MOVLI .9999,mpr ; YES - limit offset to 9999 | |
1014 bra do_logoffset_exit ; - store offset and return | |
0 | 1015 |
623 | 1016 do_logoffset_minus: |
1017 rcall do_logoffset_common ; load current offset and step size | |
1018 ; subtract step size from current offset | |
1019 movf mpr+2,W ; get step size, low byte | |
1020 subwf mpr+0,F ; subtract from offset, low byte | |
1021 movf mpr+3,W ; get step size, high byte | |
1022 subwfb mpr+1,F ; subtract from offset, high byte, considering borrow flag | |
1023 ; check if new offset is within limit | |
1024 btfsc STATUS,C ; borrow to propagate (B == /CARRY) ? | |
1025 bra do_logoffset_exit ; NO - result >= 0, store and return | |
1026 do_logoffset_reset: | |
631 | 1027 CLRI mpr ; YES - revert offset to 0 |
623 | 1028 ;bra do_logoffset_exit ; - store offset and return |
0 | 1029 |
604 | 1030 do_logoffset_exit: |
631 | 1031 goto eeprom_log_offset_write ; store offset and return |
623 | 1032 |
0 | 1033 |
582 | 1034 do_return_dispsets_menu: |
623 | 1035 bcf imprint_color_schemes ; not in color schemes menu any more |
582 | 1036 call menu_processor_double_pop ; drop exit line and back to last line |
0 | 1037 |
1038 do_dispsets_menu: | |
604 | 1039 IF _language_2!=none |
1040 MENU_BEGIN tDispSets, .7 | |
582 | 1041 MENU_OPTION tBright, oBrightness, 0 |
631 | 1042 MENU_OPTION tLayout, oLayout, 0 |
1043 MENU_OPTION tUnits, oUnits, 0 | |
604 | 1044 MENU_OPTION tLanguage, oLanguage, 0 |
631 | 1045 MENU_OPTION tFlip, oFlipScreen, 0 |
582 | 1046 MENU_CALL tColorScheme, do_color_scheme |
1047 MENU_CALL tMore, do_dispsets_menu_more | |
1048 MENU_END | |
604 | 1049 ELSE |
1050 MENU_BEGIN tDispSets, .6 | |
1051 MENU_OPTION tBright, oBrightness, 0 | |
631 | 1052 MENU_OPTION tLayout, oLayout, 0 |
604 | 1053 MENU_OPTION tUnits, oUnits, 0 |
1054 MENU_OPTION tFlip, oFlipScreen, 0 | |
631 | 1055 MENU_CALL tColorScheme, do_color_scheme |
604 | 1056 MENU_CALL tMore, do_dispsets_menu_more |
1057 MENU_END | |
1058 ENDIF | |
582 | 1059 |
335
3d43da7acfe1
Always show ppO2 (warning position, standard color) option
janos_kovacs <kovjanos@gmail.com>
parents:
333
diff
changeset
|
1060 |
3d43da7acfe1
Always show ppO2 (warning position, standard color) option
janos_kovacs <kovjanos@gmail.com>
parents:
333
diff
changeset
|
1061 do_dispsets_menu_more: |
623 | 1062 IFDEF _helium |
582 | 1063 MENU_BEGIN tDispSets, .7 |
1064 MENU_OPTION tVSIgraph, oVSIgraph, 0 | |
631 | 1065 MENU_OPTION tVSItext2, oVSItext, 0 |
1066 MENU_OPTION tShowppO2, oShowppO2, 0 | |
1067 MENU_OPTION tDepthWarning, oDepthWarn, 0 | |
623 | 1068 MENU_OPTION t2ndDepth, o2ndDepthDisp, 0 |
1069 MENU_OPTION tTissueGraphics, oTissueGraphics, 0 | |
631 | 1070 MENU_CALL tBack, do_return_settings_deeper |
623 | 1071 MENU_END |
1072 ELSE | |
1073 MENU_BEGIN tDispSets, .6 | |
1074 MENU_OPTION tVSIgraph, oVSIgraph, 0 | |
631 | 1075 MENU_OPTION tVSItext2, oVSItext, 0 |
1076 MENU_OPTION tShowppO2, oShowppO2, 0 | |
1077 MENU_OPTION tDepthWarning, oDepthWarn, 0 | |
604 | 1078 MENU_OPTION t2ndDepth, o2ndDepthDisp, 0 |
631 | 1079 MENU_CALL tBack, do_return_settings_deeper |
582 | 1080 MENU_END |
623 | 1081 ENDIF |
0 | 1082 |
582 | 1083 |
50 | 1084 do_color_scheme: |
623 | 1085 bsf imprint_color_schemes ; in color schemes menu |
582 | 1086 |
1087 MENU_BEGIN tColorScheme, .2 | |
1088 MENU_OPTION tColorSetDive, oColorSetDive, 0 | |
604 | 1089 MENU_CALL tBack, do_return_dispsets_menu |
582 | 1090 MENU_END |
50 | 1091 |
1092 | |
0 | 1093 ;============================================================================= |
1094 | |
582 | 1095 do_new_battery_menu: |
1096 MENU_BEGIN tNewBattTitle, .2 | |
1097 MENU_CALL tAbort, do_return_settings_more_deeper | |
623 | 1098 MENU_CALL tYes, do_new_battery_select_1 |
582 | 1099 MENU_END |
1100 | |
623 | 1101 |
582 | 1102 global do_new_battery_select |
1103 do_new_battery_select: | |
623 | 1104 call TFT_boot ; initialize TFT (includes clear screen) |
1105 call TFT_Display_FadeIn ; dim up the display | |
1106 call menu_processor_reset ; reset menu stack | |
1107 | |
1108 do_new_battery_select_1: | |
1109 ; make sure to reset battery percentage | |
1110 movlw .100 | |
1111 movwf batt_percent ; set battery level to full | |
1112 | |
1113 ; default (in cases of timeout or USB): use old battery | |
631 | 1114 call eeprom_battery_gauge_read ; retrieve stored battery gauge value from EEPROM |
604 | 1115 |
1116 IFDEF _screendump | |
623 | 1117 bsf screen_dump_avail ; enable screen dump function to prevent exiting into COMM mode immediately |
604 | 1118 ELSE |
623 | 1119 bsf comm_mode_disabled ; disable COMM mode to prevent exiting into COMM mode immediately |
604 | 1120 ENDIF |
1121 | |
623 | 1122 ; hardware descriptor: user changeable battery charger supported battery types |
614 | 1123 ; ------------------------------------------------------------------------------------------------------------------------------------------------------- |
623 | 1124 ; 0x11: BLE and battery gauge ---> OSTC 2 (old model) NO YES internal 18650 |
1125 ; 0x05: analog input and battery gauge ---> OSTC 2 cR NO YES internal 18650 | |
1126 ; 0x33: BLE and RX module and ambient sensor and battery gauge ---> OSTC 2 TR NO YES internal 16650 | |
1127 ; 0x13: BLE and ambient sensor and battery gauge -+-> OSTC 2 (new model) NO YES internal 16650 | |
1128 ; +-> OSTC Plus YES YES 1.5V ----- NO! ----- 3.6V rechargeable | |
1129 ; 0x0A: optical input and ambient sensor ---> OSTC 3 (USB model) YES NO 1.5V 3.6V disposable 3.6V rechargeable | |
1130 ; 0x1A: BLE and optical input and ambient sensor ---> OSTC 3 (BLE model) YES NO 1.5V 3.6V disposable 3.6V rechargeable | |
1131 ; 0x02: ambient sensor ---> OSTC Sport (USB model) YES NO 1.5V 3.6V disposable 3.6V rechargeable | |
1132 ; 0x52: BLE and ambient sensor and low volt core ---> OSTC Sport (BLE model) YES NO 1.5V 3.6V disposable 3.6V rechargeable | |
614 | 1133 |
1134 | |
623 | 1135 movlw 0x11 ; OSTC 2 (old model) |
1136 cpfseq HW_descriptor | |
614 | 1137 bra $+4 |
623 | 1138 bra use_18650_battery |
614 | 1139 |
623 | 1140 movlw 0x05 ; OSTC 2 cR |
1141 cpfseq HW_descriptor | |
614 | 1142 bra $+4 |
623 | 1143 bra use_18650_battery |
76 | 1144 |
614 | 1145 movlw 0x33 ; OSTC 2 TR |
623 | 1146 cpfseq HW_descriptor |
614 | 1147 bra $+4 |
623 | 1148 bra use_16650_battery |
614 | 1149 |
623 | 1150 ; movlw 0xXX ; OSTC 2 (new model) TODO: define signature |
1151 ; cpfseq HW_descriptor | |
1152 ; bra $+4 | |
1153 ; bra use_16650_battery | |
614 | 1154 |
623 | 1155 movlw 0x13 ; OSTC Plus TODO: and OSTC 2 new model as of now |
1156 cpfseq HW_descriptor | |
614 | 1157 bra $+4 |
623 | 1158 bra menu_new_battery_AA_charger |
614 | 1159 |
623 | 1160 ; movlw 0x0A ; OSTC 3 (USB model) |
1161 ; cpfseq HW_descriptor | |
1162 ; bra $+4 | |
1163 ; bra menu_new_battery_AA_no_charger | |
1164 | |
1165 ; movlw 0x1A ; OSTC 3 (BLE model) | |
1166 ; cpfseq HW_descriptor | |
1167 ; bra $+4 | |
1168 ; bra menu_new_battery_AA_no_charger | |
614 | 1169 |
623 | 1170 ; movlw 0x02 ; OSTC Sport (USB model) |
1171 ; cpfseq HW_descriptor | |
1172 ; bra $+4 | |
1173 ; bra menu_new_battery_AA_no_charger | |
614 | 1174 |
623 | 1175 ; movlw 0x52 ; OSTC Sport (BLE model) |
1176 ; cpfseq HW_descriptor | |
1177 ; bra $+4 | |
1178 ; bra menu_new_battery_AA_no_charger | |
1179 | |
1180 bra menu_new_battery_AA_no_charger ; any other model | |
582 | 1181 |
614 | 1182 |
623 | 1183 do_return_menu_new_bat_AA_chrg: |
614 | 1184 call menu_processor_double_pop ; drop exit line and back to last line |
1185 | |
623 | 1186 ; OSTC Plus (charging function) TODO: and OSTC 2 new model as of now |
1187 menu_new_battery_AA_charger: | |
614 | 1188 MENU_BEGIN tNewBattTitle, .4 |
1189 MENU_CALL tNewBattOld, use_old_batteries | |
1190 MENU_CALL tNewBattNew15, use_new_15V_batteries ; not rechargeable | |
623 | 1191 ; MENU_CALL tNewBattNew36, use_36V_disposable ; not rechargeable -> not allowed any more !!! |
1192 MENU_CALL tNewBattAccu, pre_36V_rechargeable ; rechargeable -> goto safety question | |
1193 MENU_CALL tNew16650, use_16650_battery ; OSTC 2 new model TODO: remove when OSTC 2 new model can be separated from Plus | |
614 | 1194 MENU_END |
1195 | |
1196 pre_36V_rechargeable: | |
1197 MENU_BEGIN tNewBattTitle, .5 | |
1198 MENU_CALL tConfirmChargeable1, 0 ; safety question, line 1 | |
1199 MENU_CALL tConfirmChargeable2, 0 ; safety question, line 2 | |
1200 MENU_CALL tConfirmChargeable3, 0 ; safety question, line 3 | |
623 | 1201 MENU_CALL tNo, do_return_menu_new_bat_AA_chrg ; NO - go back |
1202 MENU_CALL tYes, use_37V_rechargeable ; YES - confirmed rechargeable | |
1203 MENU_END | |
1204 | |
1205 ; OSTC 3 and Sport (no charging function) | |
1206 menu_new_battery_AA_no_charger: | |
1207 MENU_BEGIN tNewBattTitle, .4 | |
1208 MENU_CALL tNewBattOld, use_old_batteries | |
1209 MENU_CALL tNewBattNew15, use_new_15V_batteries ; not rechargeable | |
1210 MENU_CALL tNewBattNew36, use_36V_disposable ; not rechargeable | |
1211 MENU_CALL tNewBattAccu, use_37V_rechargeable ; rechargeable | |
582 | 1212 MENU_END |
0 | 1213 |
582 | 1214 |
457 | 1215 global use_old_prior_209 |
1216 use_old_prior_209: | |
631 | 1217 EEPROM_CC_READ eeprom_battery_type,WREG ; read battery type from EEPROM |
1218 incfsz WREG,W ; battery type = 0xFF (undefined) ? | |
1219 return ; NO - done | |
1220 call lt2942_get_status ; YES - check for gauge IC | |
1221 movlw .3 ; - default to a 18650 (LiIon 3.7V/3.1Ah) | |
1222 btfss battery_gauge_available ; - OSTC 2 or cR hardware? | |
1223 movlw .1 ; - NO - assume a Saft (disposable 3.6 V) | |
1224 EEPROM_CC_WRITE WREG,eeprom_battery_type; - write battery type to EEPROM | |
1225 return ; - done | |
582 | 1226 |
1227 | |
0 | 1228 use_old_batteries: |
623 | 1229 rcall get_battery_data ; load data of old battery |
1230 goto surfloop ; proceed to surface loop | |
582 | 1231 |
0 | 1232 |
623 | 1233 global get_battery_data |
1234 get_battery_data: | |
631 | 1235 call eeprom_battery_gauge_read ; retrieve stored battery gauge value from EEPROM |
623 | 1236 movff battery_type,lo ; copy retrieved battery type to lo |
1237 rcall setup_new_saft ; default battery configuration | |
1238 incf lo,F ; (0-4) -> (1-5) | |
1239 dcfsnz lo,F | |
1240 rcall setup_new_15v ; =0 | |
1241 dcfsnz lo,F | |
1242 rcall setup_new_saft ; =1 | |
1243 dcfsnz lo,F | |
1244 rcall setup_new_panasonic ; =2 | |
1245 dcfsnz lo,F | |
1246 rcall setup_new_18650 ; =3 | |
1247 dcfsnz lo,F | |
1248 rcall setup_new_16650 ; =4 | |
1249 bcf use_old_batt_flag ; clear flag | |
1250 IFNDEF _screendump | |
1251 bcf comm_mode_disabled ; re-enable COMM mode again | |
1252 ENDIF | |
1253 return ; done | |
1254 | |
1255 | |
1256 ; disposable 1.5 Volt Alkaline | |
472
4fdf6886004b
CHANGE: Show warnings either in Customview (If active) _or_ next to warning sign
heinrichsweikamp
parents:
470
diff
changeset
|
1257 setup_new_15v: |
623 | 1258 bsf charge_disable ; set charging-inhibit signal |
1259 bcf charge_enable ; activate charging-inhibit signal | |
582 | 1260 movlw .100 |
604 | 1261 movwf batt_percent ; to have 1.5V batteries right after firmware update |
582 | 1262 movlw .0 |
623 | 1263 movwf battery_type |
1264 return | |
1265 | |
1266 ; disposable 3.6 Volt Lithium | |
1267 setup_new_saft: | |
1268 bsf charge_disable ; set charging-inhibit signal | |
1269 bcf charge_enable ; activate charging-inhibit signal | |
1270 MOVLI capacity_saft_internal, battery_capacity_internal | |
1271 MOVLI capacity_saft, battery_capacity | |
1272 MOVLI offset_saft, battery_offset | |
1273 movlw .1 | |
1274 movwf battery_type | |
1275 return | |
1276 | |
1277 ; rechargeable user-changeable 3.7 Volt Lithium-ion | |
1278 setup_new_panasonic: | |
1279 bcf charge_disable ; release charging-inhibit signal | |
1280 bsf charge_enable ; tristate charging-inhibit signal | |
1281 MOVLI capacity_panasonic_internal, battery_capacity_internal | |
1282 MOVLI capacity_panasonic, battery_capacity | |
1283 MOVLI offset_panasonic, battery_offset | |
1284 movlw .2 | |
1285 movwf battery_type | |
1286 return | |
1287 | |
1288 ; rechargeable internal Lithium-ion | |
1289 setup_new_18650: | |
1290 bcf charge_disable ; release charging-inhibit signal | |
1291 bsf charge_enable ; tristate charging-inhibit signal | |
1292 CLRI battery_capacity_internal | |
1293 MOVLI capacity_ncr18650, battery_capacity | |
1294 MOVLI offset_ncr18650, battery_offset | |
1295 movlw .3 | |
1296 movwf battery_type | |
1297 return | |
1298 | |
1299 ; rechargeable internal Lithium-ion | |
1300 setup_new_16650: | |
1301 bcf charge_disable ; release charging-inhibit signal | |
1302 bsf charge_enable ; tristate charging-inhibit signal | |
1303 CLRI battery_capacity_internal | |
1304 MOVLI capacity_ur16650, battery_capacity | |
1305 MOVLI offset_ur16650, battery_offset | |
1306 movlw .4 | |
1307 movwf battery_type | |
582 | 1308 return |
1309 | |
1310 | |
623 | 1311 use_new_15V_batteries: |
1312 rcall setup_new_15v | |
1313 bra use_batt_exit | |
448 | 1314 |
623 | 1315 use_36V_disposable: |
1316 rcall setup_new_saft | |
1317 bra use_batt_exit | |
582 | 1318 |
623 | 1319 use_37V_rechargeable: |
1320 rcall setup_new_panasonic | |
631 | 1321 call reset_battery_gauge |
623 | 1322 bra use_batt_exit_1 |
472
4fdf6886004b
CHANGE: Show warnings either in Customview (If active) _or_ next to warning sign
heinrichsweikamp
parents:
470
diff
changeset
|
1323 |
474 | 1324 use_16650_battery: |
582 | 1325 rcall setup_new_16650 |
604 | 1326 bra use_batt_exit |
623 | 1327 |
448 | 1328 use_18650_battery: |
582 | 1329 rcall setup_new_18650 |
623 | 1330 ;bra use_batt_exit |
1331 | |
604 | 1332 use_batt_exit: |
631 | 1333 call reset_battery_gauge_and_lt2942 ; reset battery pointer 0x07-0x0C and battery gauge |
623 | 1334 use_batt_exit_1: |
604 | 1335 IFNDEF _screendump |
623 | 1336 bcf comm_mode_disabled ; re-enable COMM mode again |
604 | 1337 ENDIF |
1338 goto surfloop ; jump to surface loop | |
1339 | |
623 | 1340 ;----------------------------------------------------------------------------- |
0 | 1341 |
623 | 1342 END |