annotate src/menu_tree.asm @ 629:237931377539

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