annotate src/menu_tree.asm @ 591:146e50d2672f

BUGFIX: handle two deco gases configured to the same change depth
author heinrichsweikamp
date Thu, 15 Mar 2018 20:43:38 +0100
parents b455b31ce022
children cb59872ad53d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
heinrichsweikamp
parents:
diff changeset
1 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
2 ;
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
3 ; File menu_tree.asm REFACTORED VERSION V2.98
0
heinrichsweikamp
parents:
diff changeset
4 ;
275
653a3ab08062 rename into hwOS
heinrichsweikamp
parents: 269
diff changeset
5 ; OSTC 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
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
12 #include "hwos.inc" ; Mandatory header
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"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
21 #include "shared_definitions.h" ; Mailbox from/to p2_deco.c
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
22 #include "isr.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
23 #include "ghostwriter.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
24 #include "adc_lightsensor.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
25 #include "wait.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
26 #include "i2c.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
27
0
heinrichsweikamp
parents:
diff changeset
28
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
29 extern do_demo_divemode
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
30 extern restart
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
31 extern option_save_all
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
32 extern option_reset
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
33 extern do_demo_planner
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
34 extern calibrate_mix
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
35 extern comm_mode0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
36 extern piezo_config
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
37 extern compass_calibration_loop
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
174
932e91074bdb CHANGE: Clarify Travel Gases with "---" as change depth
heinrichsweikamp
parents: 155
diff changeset
42
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
43
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
44 gui CODE
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
45
0
heinrichsweikamp
parents:
diff changeset
46 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
47 ; Main Menu
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
48
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
49 do_return_main_menu:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
50 call menu_processor_double_pop ; drop exit line and back to last line
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
51 bra do_main_menu_common
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
52
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
53 global do_main_menu
0
heinrichsweikamp
parents:
diff changeset
54 do_main_menu:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
55 movff menupos3,customview_surfmode ; save last customview
0
heinrichsweikamp
parents:
diff changeset
56
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
57 global do_main_menu2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
58 do_main_menu2: ; entry point used by logbook.asm
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
59 call TFT_boot
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
60 bcf sleepmode ; for timeout
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
61 call menu_processor_reset ; restart from first icon
0
heinrichsweikamp
parents:
diff changeset
62
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
63 do_main_menu_common:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
64 MENU_BEGIN tMainMenu, .7
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
65 MENU_CALL tLogbook, logbook
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
66 MENU_CALL tGasSetup, do_gas_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
67 MENU_CALL tCCRSetup, do_ccr_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
68 MENU_CALL tPlan, do_planner_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
69 MENU_CALL tDiveModeMenu, do_divemode_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
70 MENU_CALL tSystSets, do_settings_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
71 MENU_CALL tExit, restart
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
72 MENU_END
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
73
0
heinrichsweikamp
parents:
diff changeset
74
heinrichsweikamp
parents:
diff changeset
75 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
76 ; CCR Setup
heinrichsweikamp
parents:
diff changeset
77
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
78 do_return_ccr_menu:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
79 call menu_processor_double_pop ; drop exit line and back to last line
0
heinrichsweikamp
parents:
diff changeset
80
heinrichsweikamp
parents:
diff changeset
81 do_ccr_menu:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
82 bcf menu_show_sensors2 ; stop imprinting of live sensor values
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 545
diff changeset
83
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
84 btfsc analog_o2_input
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
85 bra do_ccr_menu_cR
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
86
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
87 ; COMMENTED OUT - currently there is no difference between the OSTC 2 and 3 regarding this menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
88 ; btfss optical_input
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
89 ; bra do_ccr_menu_ostc2
240
633c7a6de5bc auto-select correct ccr menu
heinrichsweikamp
parents: 236
diff changeset
90
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
91 MENU_BEGIN tCCRSetup, .6 ; OSTC3 menu (and currently also the OSTC2 menu)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
92 MENU_OPTION tCCRMode, oCCRMode, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
93 MENU_CALL tDiluentSetup, do_diluent_setup
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
94 MENU_CALL tFixedSetpoints, do_fixed_setpoints
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
95 MENU_CALL tPSCRMenu, do_PSCR_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
96 MENU_OPTION tCCmaxFracO2, oCCmaxFracO2, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
97 MENU_CALL tExit, do_return_main_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
98 MENU_END
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
99
174
932e91074bdb CHANGE: Clarify Travel Gases with "---" as change depth
heinrichsweikamp
parents: 155
diff changeset
100
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
101 do_ccr_menu_cR: ; cR menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
102 MENU_BEGIN tCCRSetup, .7
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
103 MENU_OPTION tCCRMode, oCCRMode, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
104 MENU_CALL tCalibrateMenu, do_calibrate_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
105 MENU_CALL tDiluentSetup, do_diluent_setup
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
106 MENU_CALL tFixedSetpoints, do_fixed_setpoints
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
107 MENU_CALL tPSCRMenu, do_PSCR_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
108 MENU_OPTION tCCmaxFracO2, oCCmaxFracO2, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
109 MENU_CALL tExit, do_return_main_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
110 MENU_END
0
heinrichsweikamp
parents:
diff changeset
111
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
112 ; COMMENTED OUT - currently there is no difference between the OSTC 2 and 3 regarding this menu
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 545
diff changeset
113 ;do_ccr_menu_ostc2:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
114 ; MENU_BEGIN tCCRSetup, .6 ; ostc2 menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
115 ; MENU_OPTION tCCRMode, oCCRMode, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
116 ; MENU_CALL tDiluentSetup, do_diluent_setup
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
117 ; MENU_CALL tFixedSetpoints, do_fixed_setpoints
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
118 ; MENU_CALL tPSCRMenu, do_PSCR_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
119 ; MENU_OPTION tCCmaxFracO2, oCCmaxFracO2, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
120 ; MENU_CALL tExit, do_return_main_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
121 ; MENU_END
240
633c7a6de5bc auto-select correct ccr menu
heinrichsweikamp
parents: 236
diff changeset
122
633c7a6de5bc auto-select correct ccr menu
heinrichsweikamp
parents: 236
diff changeset
123
113
heinrichsweikamp
parents: 104
diff changeset
124 do_calibrate_menu:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
125 call enable_ir_s8 ; Enable IR/S8-Port
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
126 bsf menu_show_sensors2 ; start imprinting of live sensor values
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
127
113
heinrichsweikamp
parents: 104
diff changeset
128 do_calibrate_menu2:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
129 MENU_BEGIN tCalibrateMenu, .6
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
130 MENU_CALL tDiveHudMask1, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
131 MENU_CALL tDiveHudMask2, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
132 MENU_CALL tDiveHudMask3, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
133 MENU_OPTION tCalibrationGas,oCalGasO2, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
134 MENU_CALL tCalibrate, do_calibrate_mix
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
135 MENU_CALL tExit, do_return_ccr_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
136 MENU_END
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
137
113
heinrichsweikamp
parents: 104
diff changeset
138
heinrichsweikamp
parents: 104
diff changeset
139 do_calibrate_mix:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
140 call calibrate_mix ; Calibrate with opt_calibration_O2_ratio, also calibrate S8 HUD if connected
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
141 WAITMS d'250' ; Wait for HUD v3
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
142 movlw .9
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
143 movff WREG,customview_surfmode ; show sensor mV custom view after restart
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
144 goto restart ; Restart into surface mode
113
heinrichsweikamp
parents: 104
diff changeset
145
0
heinrichsweikamp
parents:
diff changeset
146
heinrichsweikamp
parents:
diff changeset
147 do_diluent_setup:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
148 bsf ccr_diluent_setup ; =1: Setting up Diluents ("Gas6-10")
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
149 bcf short_gas_decriptions ; =1: Use short versions of gaslist_strcat_gas_mod and gaslist_strcat_setpoint
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
150 call gaslist_cleanup_list ; Takes care that only one gas can be first and first has 0m change depth
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
151
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
152 MENU_BEGIN tDiluentSetup, .6
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
153 MENU_DYNAMIC gaslist_strcat_gas_mod, do_edit_gas_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
154 MENU_DYNAMIC gaslist_strcat_gas_mod, do_edit_gas_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
155 MENU_DYNAMIC gaslist_strcat_gas_mod, do_edit_gas_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
156 MENU_DYNAMIC gaslist_strcat_gas_mod, do_edit_gas_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
157 MENU_DYNAMIC gaslist_strcat_gas_mod, do_edit_gas_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
158 MENU_CALL tExit, do_return_ccr_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
159 MENU_END
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
160
0
heinrichsweikamp
parents:
diff changeset
161
heinrichsweikamp
parents:
diff changeset
162 do_return_fixed_setpoints:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
163 call menu_processor_double_pop ; drop exit line and back to last line
0
heinrichsweikamp
parents:
diff changeset
164
heinrichsweikamp
parents:
diff changeset
165 do_fixed_setpoints:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
166 bcf short_gas_decriptions ; =1: Use short versions of gaslist_strcat_gas_mod and gaslist_strcat_setpoint
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
167
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
168 MENU_BEGIN tFixedSetpoints, .6
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
169 MENU_DYNAMIC gaslist_strcat_setpoint, do_edit_sp_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
170 MENU_DYNAMIC gaslist_strcat_setpoint, do_edit_sp_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
171 MENU_DYNAMIC gaslist_strcat_setpoint, do_edit_sp_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
172 MENU_DYNAMIC gaslist_strcat_setpoint, do_edit_sp_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
173 MENU_DYNAMIC gaslist_strcat_setpoint, do_edit_sp_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
174 MENU_CALL tExit, do_return_ccr_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
175 MENU_END
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
176
0
heinrichsweikamp
parents:
diff changeset
177
heinrichsweikamp
parents:
diff changeset
178 do_edit_sp_menu:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
179 call gaslist_setSP ; Save current item.
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
180
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
181 MENU_BEGIN tFixedSetpoints, .5
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
182 MENU_DYNAMIC gaslist_strcat_setpoint_0, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
183 MENU_CALL tSPPlus, gaslist_spplus
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
184 MENU_CALL tDepthPlus, gaslist_spdepthplus
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
185 MENU_CALL tDepthMinus, gaslist_spdepthminus
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
186 MENU_CALL tExit, do_return_fixed_setpoints
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
187 MENU_END
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
188
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
189
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
190 do_PSCR_menu:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
191 MENU_BEGIN tPSCRMenu, .3 ; PSCR Menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
192 MENU_OPTION tPSCR_O2_drop, oPSCR_drop, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
193 MENU_OPTION tPSCR_lungratio, oPSCR_lungratio, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
194 MENU_CALL tExit, do_return_ccr_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
195 MENU_END
0
heinrichsweikamp
parents:
diff changeset
196
heinrichsweikamp
parents:
diff changeset
197 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
198 ; OC Gas Setup
heinrichsweikamp
parents:
diff changeset
199
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
200 do_return_gas_menu:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
201 call menu_processor_double_pop ; drop exit line and back to last line
0
heinrichsweikamp
parents:
diff changeset
202
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
203 btfsc ccr_diluent_setup ; Return to CCR-Menu?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
204 bra do_diluent_setup ; Yes.
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
205
0
heinrichsweikamp
parents:
diff changeset
206 do_gas_menu:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
207 bcf ccr_diluent_setup ; =1: Setting up Diluents ("Gas6-10")
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
208 bcf short_gas_decriptions ; =1: Use short versions of gaslist_strcat_gas_mod and gaslist_strcat_setpoint
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
209 call gaslist_cleanup_list ; Takes care that only one gas can be first and first has 0m change depth
0
heinrichsweikamp
parents:
diff changeset
210
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
211 MENU_BEGIN tGaslist, .6
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
212 MENU_DYNAMIC gaslist_strcat_gas_mod, do_edit_gas_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
213 MENU_DYNAMIC gaslist_strcat_gas_mod, do_edit_gas_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
214 MENU_DYNAMIC gaslist_strcat_gas_mod, do_edit_gas_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
215 MENU_DYNAMIC gaslist_strcat_gas_mod, do_edit_gas_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
216 MENU_DYNAMIC gaslist_strcat_gas_mod, do_edit_gas_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
217 MENU_CALL tExit, do_return_main_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
218 MENU_END
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
219
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
220
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
221 do_return_edit_gas_menu:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
222 call menu_processor_pop ; drop exit line and ...
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
223 do_abort_gas_depth_menu:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
224 call menu_processor_pop ; back to last line
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
225 bra do_edit_gas_menu_common
0
heinrichsweikamp
parents:
diff changeset
226
heinrichsweikamp
parents:
diff changeset
227 do_edit_gas_menu:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
228 call gaslist_setgas ; set gaslist_gas
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
229
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
230 do_edit_gas_menu_common: ; keep current gas
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
231 MENU_BEGIN tGasEdit, .6
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
232 MENU_DYNAMIC gaslist_gastitle, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
233 MENU_DYNAMIC gaslist_MOD_END, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
234 MENU_DYNAMIC gaslist_show_type, gaslist_toggle_type
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
235 MENU_CALL tSetup_mix, do_setup_mix
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
236 MENU_CALL tGasDepth, do_gas_depth_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
237 MENU_CALL tExit, do_return_gas_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
238 MENU_END
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
239
0
heinrichsweikamp
parents:
diff changeset
240
heinrichsweikamp
parents:
diff changeset
241 do_setup_mix:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
242 MENU_BEGIN tGasEdit, .7
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
243 MENU_DYNAMIC gaslist_gastitle, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
244 MENU_DYNAMIC gaslist_MOD_END, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
245 MENU_CALL tO2Plus, gaslist_pO2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
246 MENU_CALL tO2Minus, gaslist_mO2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
247 MENU_CALL tHePlus, gaslist_pHe
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
248 MENU_CALL tHeMinus, gaslist_mHe
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
249 MENU_CALL tExit, do_return_edit_gas_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
250 MENU_END
428
eccae727702f some cleanup
heinrichsweikamp
parents: 396
diff changeset
251
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 545
diff changeset
252
0
heinrichsweikamp
parents:
diff changeset
253 do_gas_depth_menu:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
254 movff gaslist_gas,WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
255 lfsr FSR1,opt_gas_type ; Read opt_gas_type[WREG]
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
256 movff PLUSW1,lo ; Used as temp
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
257 movlw .3 ; 3=Deco
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
258 btfsc ccr_diluent_setup ; =1: Setting up Diluents ("Gas6-10")
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
259 movlw .2 ; 2=Normal
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
260 cpfseq lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
261 bra do_abort_gas_depth_menu ; Non-Deco gas or "Normal" Diluent, abort!
174
932e91074bdb CHANGE: Clarify Travel Gases with "---" as change depth
heinrichsweikamp
parents: 155
diff changeset
262
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
263 MENU_BEGIN tGasEdit, .7
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
264 MENU_DYNAMIC gaslist_gastitle, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
265 MENU_DYNAMIC gaslist_MOD_END, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
266 MENU_DYNAMIC gaslist_ppo2, 0 ; ppO2 at change depth
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
267 MENU_CALL tDepthPlus, gaslist_pDepth
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
268 MENU_CALL tDepthMinus, gaslist_mDepth
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
269 MENU_DYNAMIC gaslist_reset_mod_title, gaslist_reset_mod
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
270 MENU_CALL tExit, do_return_edit_gas_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
271 MENU_END
0
heinrichsweikamp
parents:
diff changeset
272
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
273
0
heinrichsweikamp
parents:
diff changeset
274 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
275 ; Simulator menus
heinrichsweikamp
parents:
diff changeset
276
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
277 do_return_planner_menu:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
278 call menu_processor_pop ; drop exit line and ...
0
heinrichsweikamp
parents:
diff changeset
279
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
280 global do_return_demo_planner
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
281 do_return_demo_planner:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
282 call menu_processor_pop ; back to last line
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
283 bra do_planner_common
0
heinrichsweikamp
parents:
diff changeset
284
heinrichsweikamp
parents:
diff changeset
285 do_planner_menu:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
286 ; to have correct simulator results after mode changes without prior excursion to surfacemode
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
287 call option_save_all
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
288 call restart_set_modes_and_flags
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
289 ; Reset dive time/depth to default values
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
290 lfsr FSR0,odiveInterval
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
291 call option_reset
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
292 lfsr FSR0,obottomTime
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
293 call option_reset
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
294 lfsr FSR0,obottomDepth
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
295 call option_reset
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
296
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
297 do_planner_common:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
298 MENU_BEGIN tPlan, .7
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
299 MENU_OPTION tIntvl, odiveInterval, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
300 MENU_OPTION tBtDep, obottomDepth, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
301 MENU_CALL tInter, do_demo_divemode
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
302 MENU_OPTION tBtTm, obottomTime, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
303 MENU_CALL tDecoSetup, do_planner_config
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
304 MENU_CALL tDeco, do_demo_planner
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
305 MENU_CALL tExit, do_return_main_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
306 MENU_END
0
heinrichsweikamp
parents:
diff changeset
307
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 545
diff changeset
308
298
2fe34fc0e2ae new submenu for gas consumption, show actual mix instead of GAS1-GAS5 in deco planner
heinrichsweikamp
parents: 275
diff changeset
309 do_planner_config:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
310 MENU_BEGIN tPlan, .3
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
311 MENU_OPTION tSelectSetpoint, oSimSetpoint, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
312 MENU_OPTION tuseAGF, oSimAGF, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
313 MENU_CALL tExit, do_return_planner_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
314 MENU_END
524
d2e52e6e1604 menu work
heinrichsweikamp
parents: 523
diff changeset
315
298
2fe34fc0e2ae new submenu for gas consumption, show actual mix instead of GAS1-GAS5 in deco planner
heinrichsweikamp
parents: 275
diff changeset
316
0
heinrichsweikamp
parents:
diff changeset
317 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
318 ; Divemode menu
heinrichsweikamp
parents:
diff changeset
319
heinrichsweikamp
parents:
diff changeset
320 do_return_divemode_menu:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
321 call menu_processor_double_pop ; drop exit line and back to last line
0
heinrichsweikamp
parents:
diff changeset
322
heinrichsweikamp
parents:
diff changeset
323 do_divemode_menu:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
324 MENU_BEGIN tDiveModeMenu, .7
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
325 MENU_OPTION tDvMode, oDiveMode, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
326 MENU_OPTION tDkMode, oDecoMode, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
327 MENU_CALL tppO2settings, do_ppo2_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
328 MENU_OPTION tsafetystopmenu, oSafetyStop, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
329 MENU_CALL t2ndDecoPlanMenu, do_2nd_deco_plan_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
330 MENU_CALL tDecoparameters, do_decoparameters_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
331 MENU_CALL tExit, do_return_main_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
332 MENU_END
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
333
0
heinrichsweikamp
parents:
diff changeset
334
104
223579e905c3 Show a Safety Stop if enabled (Menu "Deco Parameters")
heinrichsweikamp
parents: 90
diff changeset
335 do_ppo2_menu:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
336 MENU_BEGIN tppO2settings, .6
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
337 MENU_DYNAMIC divesets_ppo2_max, do_toggle_ppo2_max
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
338 MENU_DYNAMIC divesets_ppo2_max_deco, do_toggle_ppo2_max_deco
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
339 MENU_DYNAMIC divesets_ppo2_min, do_toggle_ppo2_min
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
340 MENU_DYNAMIC divesets_ppo2_min_cc, do_toggle_ppo2_min_cc
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
341 MENU_OPTION tShowppO2, oShowppO2, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
342 MENU_CALL tExit, do_return_divemode_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
343 MENU_END
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
344
104
223579e905c3 Show a Safety Stop if enabled (Menu "Deco Parameters")
heinrichsweikamp
parents: 90
diff changeset
345
0
heinrichsweikamp
parents:
diff changeset
346 do_return_decoparameters_menu:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
347 call menu_processor_double_pop ; drop exit line and back to last line
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
348
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
349 do_decoparameters_menu:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
350 movff char_I_deco_model,lo ; 0 = ZH-L16, 1 = ZH-L16-GF
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
351 tstfsz lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
352 bra do_decoparameters_menugf ; <> 0 -> GF menu!
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
353 ; NON-GF menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
354 MENU_BEGIN tDecoparameters, .4
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
355 MENU_OPTION tSaturationMult, osatmult, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
356 MENU_OPTION tDesaturationMult, odesatmult, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
357 MENU_OPTION tLastDecostop, oLastDeco, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
358 MENU_CALL tExit, do_return_divemode_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
359 MENU_END
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
360
562
8b7ea27ea1fa seperate desat and sat multipliers for GF and Non-GF modes. Set to 100/100 as default in GF mode
heinrichsweikamp
parents: 560
diff changeset
361 do_decoparameters_menugf:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
362 ; GF menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
363 MENU_BEGIN tDecoparameters, .7
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
364 MENU_OPTION tGF_low, oGF_low, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
365 MENU_OPTION tGF_high, oGF_high, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
366 MENU_CALL taGFMenu, do_aGF_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
367 MENU_OPTION tSaturationMult, osatmultgf, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
368 MENU_OPTION tDesaturationMult, odesatmultgf, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
369 MENU_OPTION tLastDecostop, oLastDeco, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
370 MENU_CALL tExit, do_return_divemode_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
371 MENU_END
0
heinrichsweikamp
parents:
diff changeset
372
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 545
diff changeset
373
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 545
diff changeset
374 do_return_2nd_deco_plan_menu:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
375 call menu_processor_double_pop ; drop exit line and back to last line
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 545
diff changeset
376
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 545
diff changeset
377 do_2nd_deco_plan_menu
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
378 MENU_BEGIN t2ndDecoPlanMenu, .7
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
379 MENU_OPTION tFTTSMenu, oExtraTime, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
380 MENU_OPTION tCalcAscGas, oCalcAscGas, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
381 MENU_OPTION tSetBotUse, obottom_usage, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
382 MENU_OPTION tSetDecoUse, odeco_usage, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
383 MENU_CALL tTankSizes, do_tank_sizes_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
384 MENU_CALL tTankFillPress, do_tank_fill_press_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
385 MENU_CALL tExit, do_return_divemode_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
386 MENU_END
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 545
diff changeset
387
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 545
diff changeset
388
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 545
diff changeset
389 do_tank_sizes_menu:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
390 MENU_BEGIN tTankSizes, .6
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
391 MENU_OPTION tGas1, oTankSize1, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
392 MENU_OPTION tGas2, oTankSize2, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
393 MENU_OPTION tGas3, oTankSize3, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
394 MENU_OPTION tGas4, oTankSize4, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
395 MENU_OPTION tGas5, oTankSize5, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
396 MENU_CALL tExit, do_return_2nd_deco_plan_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
397 MENU_END
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 545
diff changeset
398
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 545
diff changeset
399
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 545
diff changeset
400 do_tank_fill_press_menu:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
401 MENU_BEGIN tTankFillPress, .6
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
402 MENU_OPTION tGas1, oTankFillPres1, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
403 MENU_OPTION tGas2, oTankFillPres2, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
404 MENU_OPTION tGas3, oTankFillPres3, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
405 MENU_OPTION tGas4, oTankFillPres4, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
406 MENU_OPTION tGas5, oTankFillPres5, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
407 MENU_CALL tExit, do_return_2nd_deco_plan_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
408 MENU_END
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 545
diff changeset
409
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
410
0
heinrichsweikamp
parents:
diff changeset
411 do_aGF_menu:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
412 MENU_BEGIN taGFMenu, .4
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
413 MENU_OPTION taGF_enable, oEnable_aGF, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
414 MENU_OPTION taGF_low, oaGF_low, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
415 MENU_OPTION taGF_high, oaGF_high, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
416 MENU_CALL tExit, do_return_decoparameters_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
417 MENU_END
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 545
diff changeset
418
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 545
diff changeset
419
0
heinrichsweikamp
parents:
diff changeset
420 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
421 ; Setup Menu
heinrichsweikamp
parents:
diff changeset
422
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
423 do_return_settings_deeper: ; entry point for return from set time/date sub-menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
424 bcf settime_setdate ; clear flag
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
425 call menu_processor_pop ; drop one more stack entry
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
426
0
heinrichsweikamp
parents:
diff changeset
427 do_return_settings:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
428 call menu_processor_double_pop ; drop exit line and back to last line
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
429
0
heinrichsweikamp
parents:
diff changeset
430 do_settings_menu:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
431 btfsc ble_available ; ble available?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
432 bra do_settings_menu_ble ; YES
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
433
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
434 MENU_BEGIN tSystSets, .6
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
435 MENU_CALL tInfoMenu, do_info_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
436 MENU_CALL tSetTimeDate, do_date_time_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
437 MENU_CALL tDispSets, do_dispsets_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
438 MENU_OPTION tLanguage, oLanguage, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
439 MENU_CALL tMore, do_settings_menu_more
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
440 MENU_CALL tExit, do_return_main_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
441 MENU_END
155
5f71e31bd5b3 CHANGE: Re-arranged Settings Menu, add 180? rotate to menu
heinrichsweikamp
parents: 154
diff changeset
442
345
3f2d0c0bc101 re-arrange settings menu
heinrichsweikamp
parents: 337
diff changeset
443 do_settings_menu_ble:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
444 MENU_BEGIN tSystSets, .7
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
445 MENU_CALL tInfoMenu, do_info_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
446 MENU_CALL tBleTitle, comm_mode0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
447 MENU_CALL tSetTimeDate, do_date_time_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
448 MENU_CALL tDispSets, do_dispsets_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
449 MENU_OPTION tLanguage, oLanguage, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
450 MENU_CALL tMore, do_settings_menu_more
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
451 MENU_CALL tExit, do_return_main_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
452 MENU_END
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
453
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
454 do_info_menu:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
455 MENU_BEGIN tInfoMenu, .6
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
456 MENU_DYNAMIC info_menu_serial, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
457 MENU_DYNAMIC info_menu_firmware, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
458 MENU_DYNAMIC info_menu_battery_volts, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
459 MENU_DYNAMIC info_menu_uptime, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
460 MENU_DYNAMIC info_menu_total_dives, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
461 MENU_CALL tExit, do_return_settings
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
462 MENU_END
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
463
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
464
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
465 do_return_settings_more_deeper: ; entry point for returns from reset sub-menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
466 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
467
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
468 do_return_settings_more:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
469 call menu_processor_double_pop ; drop exit line and back to last line
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
470
155
5f71e31bd5b3 CHANGE: Re-arranged Settings Menu, add 180? rotate to menu
heinrichsweikamp
parents: 154
diff changeset
471 do_settings_menu_more:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
472 btfsc battery_gauge_available ; piezo buttons available
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
473 bra do_settings_menu_more_piezo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
474 btfsc ble_available ; ble available
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
475 bra do_settings_menu_more_ostc3p
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
476 ; All MENU_CALLs that are
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
477 MENU_BEGIN tSystSets, .6 ; in all of this 3 menus
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
478 MENU_CALL tCompassMenu, do_compass_menu ; need to stay together
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
479 MENU_CALL tLogOffset, do_log_offset_menu ; on this menu level in
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
480 MENU_OPTION tAltMode, oAltMode, 0 ; oder to not mass up the
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
481 MENU_OPTION tDvSalinity, oDiveSalinity, 0 ; menu stack on doing the
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
482 MENU_CALL tResetMenu, do_reset_menu ; do_return_settings !
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
483 MENU_CALL tExit, do_return_settings
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
484 MENU_END
220
effd7259f5a5 make button sensitivity configurable (cR hardware)
heinrichsweikamp
parents: 218
diff changeset
485
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
486
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
487 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
488 call TFT_ClearScreen
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
489 call piezo_config ; Configure buttons
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
490 call menu_processor_double_pop ; drop exit line and back to last line
524
d2e52e6e1604 menu work
heinrichsweikamp
parents: 523
diff changeset
491
269
1207cf9a9408 adjust menu for different hardware versions
heinrichsweikamp
parents: 243
diff changeset
492 do_settings_menu_more_piezo:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
493 MENU_BEGIN tSystSets, .7
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
494 MENU_CALL tCompassMenu, do_compass_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
495 MENU_CALL tLogOffset, do_log_offset_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
496 MENU_OPTION tAltMode, oAltMode, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
497 MENU_OPTION tDvSalinity, oDiveSalinity, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
498 MENU_CALL tResetMenu, do_reset_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
499 MENU_CALL tMore, do_settings_piezo_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
500 MENU_CALL tExit, do_return_settings
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
501 MENU_END
0
heinrichsweikamp
parents:
diff changeset
502
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
503 do_settings_menu_more_ostc3p: ; Menu with BLE feature
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
504 MENU_BEGIN tSystSets, .6
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
505 MENU_CALL tCompassMenu, do_compass_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
506 MENU_CALL tLogOffset, do_log_offset_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
507 MENU_OPTION tAltMode, oAltMode, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
508 MENU_OPTION tDvSalinity, oDiveSalinity, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
509 MENU_CALL tResetMenu, do_reset_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
510 MENU_CALL tExit, do_return_settings
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
511 MENU_END
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
512
243
ee81f46714cb auto-select correct settings menu
heinrichsweikamp
parents: 240
diff changeset
513
345
3f2d0c0bc101 re-arrange settings menu
heinrichsweikamp
parents: 337
diff changeset
514 do_settings_piezo_menu:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
515 ; Menu with features only available in piezo button hardware
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
516 MENU_BEGIN tSystSets, .3
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
517 MENU_OPTION tButtonleft, ocR_button_left, 0 ; left button sensitivity
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
518 MENU_OPTION tButtonright, ocR_button_right, 0 ; right button sensitivity
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
519 MENU_CALL tExit, do_return_settings_menu_more_pz
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
520 MENU_END
220
effd7259f5a5 make button sensitivity configurable (cR hardware)
heinrichsweikamp
parents: 218
diff changeset
521
effd7259f5a5 make button sensitivity configurable (cR hardware)
heinrichsweikamp
parents: 218
diff changeset
522
18
4e3f133dfbf4 add new opt_compass_gain option to work with more magnetic battery types
heinrichsweikamp
parents: 0
diff changeset
523 do_compass_menu:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
524 MENU_BEGIN tSystSets, .5
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
525 MENU_CALL tCompassMenu, compass_calibration_loop ; exits to surfloop
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
526 ; MENU_OPTION tCompassGain, oCompassGain, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
527 MENU_DYNAMIC menu_cal_x, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
528 MENU_DYNAMIC menu_cal_y, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
529 MENU_DYNAMIC menu_cal_z, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
530 MENU_CALL tExit, do_return_settings_more
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
531 MENU_END
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
532
18
4e3f133dfbf4 add new opt_compass_gain option to work with more magnetic battery types
heinrichsweikamp
parents: 0
diff changeset
533
0
heinrichsweikamp
parents:
diff changeset
534 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
535 ; Reset and confirmation menu.
heinrichsweikamp
parents:
diff changeset
536
heinrichsweikamp
parents:
diff changeset
537 do_reset_menu:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
538 MENU_BEGIN tResetMenu, .6
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
539 MENU_CALL tExit, do_return_settings_more
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
540 MENU_CALL tReboot, do_reset_menu2 ; Confirm
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
541 MENU_CALL tResetDeco, do_reset_menu3 ; Confirm
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
542 MENU_CALL tResetSettings, do_reset_menu4 ; Confirm
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
543 MENU_CALL tResetLogbook, do_reset_menu5 ; Confirm
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
544 MENU_CALL tResetBattery, do_new_battery_menu ; Confirm
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
545 MENU_END
0
heinrichsweikamp
parents:
diff changeset
546
heinrichsweikamp
parents:
diff changeset
547 do_reset_menu2:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
548 MENU_BEGIN tResetMenu2, .2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
549 MENU_CALL tAbort, do_return_settings_more_deeper
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
550 MENU_CALL tReboot, do_reboot ; Reboot
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
551 MENU_END
0
heinrichsweikamp
parents:
diff changeset
552
heinrichsweikamp
parents:
diff changeset
553 do_reset_menu3:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
554 MENU_BEGIN tResetMenu2, .2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
555 MENU_CALL tAbort, do_return_settings_more_deeper
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
556 MENU_CALL tResetDeco, do_reset_deco ; Reset Deco
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
557 MENU_END
0
heinrichsweikamp
parents:
diff changeset
558
heinrichsweikamp
parents:
diff changeset
559 do_reset_menu4:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
560 MENU_BEGIN tResetMenu2, .2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
561 MENU_CALL tAbort, do_return_settings_more_deeper
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
562 MENU_CALL tResetSettings, do_reset_settings ; Reset all settings
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
563 MENU_END
0
heinrichsweikamp
parents:
diff changeset
564
63
5c4d4a42e7a0 allow logbook erase from reset menu
heinrichsweikamp
parents: 50
diff changeset
565 do_reset_menu5:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
566 MENU_BEGIN tResetMenu2, .2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
567 MENU_CALL tAbort, do_return_settings_more_deeper
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
568 MENU_CALL tResetLogbook, do_reset_logbook ; Reset logbook
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
569 MENU_END
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
570
63
5c4d4a42e7a0 allow logbook erase from reset menu
heinrichsweikamp
parents: 50
diff changeset
571
5c4d4a42e7a0 allow logbook erase from reset menu
heinrichsweikamp
parents: 50
diff changeset
572 do_reset_logbook:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
573 clrf EEADRH ; Make sure to select EEPROM bank 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
574 clrf EEDATA
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
575 read_int_eeprom .2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
576 write_int_eeprom .16
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
577 read_int_eeprom .3
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
578 write_int_eeprom .17 ; Copy number of dives
63
5c4d4a42e7a0 allow logbook erase from reset menu
heinrichsweikamp
parents: 50
diff changeset
579 clrf EEDATA
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
580 write_int_eeprom .2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
581 write_int_eeprom .3 ; Clear total dives
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
582 write_int_eeprom .4
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
583 write_int_eeprom .5
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
584 write_int_eeprom .6 ; Reset logbook pointers
63
5c4d4a42e7a0 allow logbook erase from reset menu
heinrichsweikamp
parents: 50
diff changeset
585 call ext_flash_erase_logbook ; And complete logbook (!)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
586
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
587 goto do_return_settings_more_deeper
63
5c4d4a42e7a0 allow logbook erase from reset menu
heinrichsweikamp
parents: 50
diff changeset
588
0
heinrichsweikamp
parents:
diff changeset
589
heinrichsweikamp
parents:
diff changeset
590 do_reset_deco:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 545
diff changeset
591 SAFE_2BYTE_COPY last_surfpressure_30min,int_I_pres_respiration ; copy surface pressure to deco routine
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 545
diff changeset
592 SAFE_2BYTE_COPY last_surfpressure_30min,int_I_pres_surface ; copy surface pressure to deco routine
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
593
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
594 call deco_clear_tissue ; set all tissues to Pamb * N2_ratio (C-Code)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
595 call deco_calc_dive_interval_1min; calculate deco in surface mode
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
596 call deco_calc_desaturation_time ; calculate desaturation and no-fly time
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
597 banksel common
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
598
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
599 goto do_return_settings_more_deeper
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
600
0
heinrichsweikamp
parents:
diff changeset
601
heinrichsweikamp
parents:
diff changeset
602 do_reset_settings:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
603 call TFT_ClearScreen ; Clear screen
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
604 banksel common ; (probably not needed)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
605 call option_reset_all ; Reset all options to factory default.
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
606 goto restart ; Restart into surfacemode
0
heinrichsweikamp
parents:
diff changeset
607
heinrichsweikamp
parents:
diff changeset
608 do_reboot:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
609 call ext_flash_enable_protection ; Enables write protection
0
heinrichsweikamp
parents:
diff changeset
610 reset
heinrichsweikamp
parents:
diff changeset
611
heinrichsweikamp
parents:
diff changeset
612
heinrichsweikamp
parents:
diff changeset
613 do_date_time_menu:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
614 MENU_BEGIN tSetTimeDate, .4
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
615 MENU_CALL tSetTime, do_time_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
616 MENU_CALL tSetDate, do_date_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
617 MENU_OPTION tDateFormat,oDateFormat, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
618 MENU_CALL tExit, do_return_settings
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
619 MENU_END
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
620
0
heinrichsweikamp
parents:
diff changeset
621
heinrichsweikamp
parents:
diff changeset
622 do_date_menu:
heinrichsweikamp
parents:
diff changeset
623 bsf settime_setdate
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
624
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
625 MENU_BEGIN tSetDate, .4
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
626 MENU_OPTION tSetDay, oSetDay, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
627 MENU_OPTION tSetMonth, oSetMonth, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
628 MENU_OPTION tSetYear, oSetYear, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
629 MENU_CALL tExit, do_return_settings_deeper
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
630 MENU_END
0
heinrichsweikamp
parents:
diff changeset
631
heinrichsweikamp
parents:
diff changeset
632
heinrichsweikamp
parents:
diff changeset
633 do_reset_seconds:
heinrichsweikamp
parents:
diff changeset
634 clrf secs
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
635 call rtc_set_rtc ; writes mins, sec, hours, day, month and year to RTC module
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
636 call menu_processor_pop ; clear the MENU_CALL for do_reset_seconds from the stack
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
637 ;bra do_time_menu ; direct jump-back into the menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
638
0
heinrichsweikamp
parents:
diff changeset
639 do_time_menu:
heinrichsweikamp
parents:
diff changeset
640 bsf settime_setdate
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
641
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
642 MENU_BEGIN tSetTime, .4
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
643 MENU_OPTION tSetHours, oSetHours, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
644 MENU_OPTION tSetMinutes, oSetMinutes, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
645 MENU_CALL tSetSeconds, do_reset_seconds
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
646 MENU_CALL tExit, do_return_settings_deeper
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
647 MENU_END
0
heinrichsweikamp
parents:
diff changeset
648
heinrichsweikamp
parents:
diff changeset
649
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
650 do_toggle_ppo2_max: ; add 0.1bar, with hard-coded max.
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
651 movff char_I_ppO2_max,lo ; banksafe
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
652 movlw .10
0
heinrichsweikamp
parents:
diff changeset
653 addwf lo,F
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
654 movlw ppo2_warning_high_highest
0
heinrichsweikamp
parents:
diff changeset
655 cpfsgt lo
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
656 bra do_toggle_ppo2_max2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
657 movlw ppo2_warning_high_lowest
0
heinrichsweikamp
parents:
diff changeset
658 movwf lo
heinrichsweikamp
parents:
diff changeset
659 do_toggle_ppo2_max2:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
660 movff lo,char_I_ppO2_max
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
661 return
0
heinrichsweikamp
parents:
diff changeset
662
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
663 do_toggle_ppo2_max_deco: ; add 0.1bar, with hard-coded max.
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
664 movff char_I_ppO2_max_deco,lo ; banksafe
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
665 movlw .10
507
4e6f5c36f4cc NEW: Two ppO2 max settings. One for travel/bottom and one for deco gases
heinrichsweikamp
parents: 505
diff changeset
666 addwf lo,F
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
667 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
668 cpfsgt lo
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
669 bra do_toggle_ppo2_max_deco2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
670 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
671 movwf lo
4e6f5c36f4cc NEW: Two ppO2 max settings. One for travel/bottom and one for deco gases
heinrichsweikamp
parents: 505
diff changeset
672 do_toggle_ppo2_max_deco2:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
673 movff lo,char_I_ppO2_max_deco
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
674 return
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
675
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
676 do_toggle_ppo2_min: ; sub 0.1bar, with hard-coded min.
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
677 movff char_I_ppO2_min,lo ; banksafe
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
678 incf lo,F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
679 movlw ppo2_warning_low_highest
0
heinrichsweikamp
parents:
diff changeset
680 cpfsgt lo
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
681 bra do_toggle_ppo2_min2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
682 movlw ppo2_warning_low_lowest
0
heinrichsweikamp
parents:
diff changeset
683 movwf lo
heinrichsweikamp
parents:
diff changeset
684 do_toggle_ppo2_min2:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
685 movff lo,char_I_ppO2_min
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
686 return
0
heinrichsweikamp
parents:
diff changeset
687
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
688 do_toggle_ppo2_min_cc: ; sub 0.1bar, with hard-coded min.
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
689 movff char_I_ppO2_min_loop,lo ; banksafe
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
690 incf lo,F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
691 movlw ppo2_warning_loop_highest
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 545
diff changeset
692 cpfsgt lo
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
693 bra do_toggle_ppo2_min_cc2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
694 movlw ppo2_warning_loop_lowest
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 545
diff changeset
695 movwf lo
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 545
diff changeset
696 do_toggle_ppo2_min_cc2:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
697 movff lo,char_I_ppO2_min_loop
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
698 return
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
699
0
heinrichsweikamp
parents:
diff changeset
700
heinrichsweikamp
parents:
diff changeset
701 ; Logbook offset sub-menu
heinrichsweikamp
parents:
diff changeset
702 do_log_offset_menu:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
703 MENU_BEGIN tLogOffset, .6
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
704 MENU_DYNAMIC TFT_LogOffset_Logtitle, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
705 MENU_CALL tLogOffsetp1, do_logoffset_plus1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
706 MENU_CALL tLogOffsetp10, do_logoffset_plus10
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
707 MENU_CALL tLogOffsetm1, do_logoffset_minus1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
708 MENU_CALL tLogOffsetm10, do_logoffset_minus10
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
709 MENU_CALL tExit, do_return_settings_more
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
710 MENU_END
0
heinrichsweikamp
parents:
diff changeset
711
heinrichsweikamp
parents:
diff changeset
712
heinrichsweikamp
parents:
diff changeset
713 do_logoffset_minus1:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
714 call do_logoffset_common_read ; Read into lo:hi
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
715 movlw .1
0
heinrichsweikamp
parents:
diff changeset
716 subwf lo
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
717 movlw .0
0
heinrichsweikamp
parents:
diff changeset
718 subwfb hi
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
719 btfss hi,7 ; <0?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
720 goto do_logoffset_common_write ; Store and return
0
heinrichsweikamp
parents:
diff changeset
721 clrf lo
heinrichsweikamp
parents:
diff changeset
722 clrf hi
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
723 goto do_logoffset_common_write ; Store and return
0
heinrichsweikamp
parents:
diff changeset
724
heinrichsweikamp
parents:
diff changeset
725 do_logoffset_minus10:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
726 call do_logoffset_common_read ; Read into lo:hi
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
727 movlw .10
0
heinrichsweikamp
parents:
diff changeset
728 subwf lo
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
729 movlw .0
0
heinrichsweikamp
parents:
diff changeset
730 subwfb hi
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
731 btfss hi,7 ; <0?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
732 goto do_logoffset_common_write ; Store and return
0
heinrichsweikamp
parents:
diff changeset
733 clrf lo
heinrichsweikamp
parents:
diff changeset
734 clrf hi
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
735 goto do_logoffset_common_write ; Store and return
0
heinrichsweikamp
parents:
diff changeset
736
heinrichsweikamp
parents:
diff changeset
737 do_logoffset_plus1:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
738 call do_logoffset_common_read ; Read into lo:hi
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
739 infsnz lo,F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
740 incf hi,F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
741 goto do_logoffset_common_write ; Store and return
0
heinrichsweikamp
parents:
diff changeset
742
heinrichsweikamp
parents:
diff changeset
743 do_logoffset_plus10:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
744 call do_logoffset_common_read ; Read into lo:hi
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
745 movlw .10
0
heinrichsweikamp
parents:
diff changeset
746 addwf lo
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
747 movlw .0
0
heinrichsweikamp
parents:
diff changeset
748 addwfc hi
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
749 goto do_logoffset_common_write ; Store and return
0
heinrichsweikamp
parents:
diff changeset
750
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
751 do_return_dispsets_menu:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
752 bcf in_color_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
753 call menu_processor_double_pop ; drop exit line and back to last line
0
heinrichsweikamp
parents:
diff changeset
754
heinrichsweikamp
parents:
diff changeset
755 do_dispsets_menu:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
756 MENU_BEGIN tDispSets, .5
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
757 MENU_OPTION tBright, oBrightness, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
758 MENU_CALL tColorScheme, do_color_scheme
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
759 MENU_OPTION tFlip, oFlipScreen, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
760 MENU_CALL tMore, do_dispsets_menu_more
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
761 MENU_CALL tExit, do_return_settings
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
762 MENU_END
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
763
335
3d43da7acfe1 Always show ppO2 (warning position, standard color) option
janos_kovacs <kovjanos@gmail.com>
parents: 333
diff changeset
764
3d43da7acfe1 Always show ppO2 (warning position, standard color) option
janos_kovacs <kovjanos@gmail.com>
parents: 333
diff changeset
765 do_dispsets_menu_more:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
766 MENU_BEGIN tDispSets, .7
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
767 MENU_OPTION tMODwarning, oMODwarning, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
768 MENU_OPTION tIBCDwarning, oEnable_IBCD, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
769 MENU_OPTION tVSItext2, oVSItextv2, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
770 MENU_OPTION tVSIgraph, oVSIgraph, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
771 MENU_OPTION tTimeoutDive, oDiveTimeout, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
772 MENU_OPTION tUnits, oUnits, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
773 MENU_CALL tExit, do_return_dispsets_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
774 MENU_END
0
heinrichsweikamp
parents:
diff changeset
775
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
776
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 39
diff changeset
777 do_color_scheme:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
778 bsf in_color_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
779
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
780 MENU_BEGIN tColorScheme, .2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
781 MENU_OPTION tColorSetDive, oColorSetDive, 0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
782 MENU_CALL tExit, do_return_dispsets_menu
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
783 MENU_END
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 39
diff changeset
784
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 39
diff changeset
785
0
heinrichsweikamp
parents:
diff changeset
786 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
787
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
788 do_new_battery_menu:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
789 MENU_BEGIN tNewBattTitle, .2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
790 MENU_CALL tAbort, do_return_settings_more_deeper
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
791 MENU_CALL tYes, do_new_battery_select
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
792 MENU_END
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
793
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
794 global do_new_battery_select
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
795 do_new_battery_select:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
796 bsf enable_screen_dumps ; To prevent exiting into COMM mode immediately
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
797 call TFT_boot ; Initialize TFT (includes clear screen)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
798 call TFT_Display_FadeIn ; Show splash
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
799 movlw .100
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
800 movwf batt_percent ; make sure to reset batt_percent
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
801
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
802 ; Default (In cases of timeout or USB): Use old battery
0
heinrichsweikamp
parents:
diff changeset
803 clrf EEADRH
heinrichsweikamp
parents:
diff changeset
804 read_int_eeprom 0x07
heinrichsweikamp
parents:
diff changeset
805 movff EEDATA,battery_gauge+0
heinrichsweikamp
parents:
diff changeset
806 read_int_eeprom 0x08
heinrichsweikamp
parents:
diff changeset
807 movff EEDATA,battery_gauge+1
heinrichsweikamp
parents:
diff changeset
808 read_int_eeprom 0x09
heinrichsweikamp
parents:
diff changeset
809 movff EEDATA,battery_gauge+2
heinrichsweikamp
parents:
diff changeset
810 read_int_eeprom 0x0A
heinrichsweikamp
parents:
diff changeset
811 movff EEDATA,battery_gauge+3
heinrichsweikamp
parents:
diff changeset
812 read_int_eeprom 0x0B
heinrichsweikamp
parents:
diff changeset
813 movff EEDATA,battery_gauge+4
heinrichsweikamp
parents:
diff changeset
814 read_int_eeprom 0x0C
heinrichsweikamp
parents:
diff changeset
815 movff EEDATA,battery_gauge+5
heinrichsweikamp
parents:
diff changeset
816
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
817 call menu_processor_reset ; restart from first icon.
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
818
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
819 ; hardware_flag:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
820 ; 3: 0x0A or 0x13 (2016)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
821 ; cR: 0x05
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
822 ; 2 with BLE: 0x11
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
823 ; Sport: 0x12
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
824 ; 3 with BLE: 0x1A
76
a5ea132770db 1.21 release
heinrichsweikamp
parents: 66
diff changeset
825
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
826 movlw 0x0A
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
827 cpfseq hardware_flag
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
828 bra $+4
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
829 bra menu_new_battery_AA
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
830 movlw 0x13
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
831 cpfseq hardware_flag
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
832 bra $+4
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
833 bra menu_new_battery_AA_16650
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
834 movlw 0x12
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
835 cpfseq hardware_flag
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
836 bra $+4
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
837 bra menu_new_battery_AA
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
838 movlw 0x1A
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
839 cpfseq hardware_flag
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
840 bra $+4
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
841 bra menu_new_battery_AA
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
842 movlw 0x11
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
843 cpfseq hardware_flag
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
844 bra $+4
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
845 bra menu_new_battery_18650
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
846 movlw 0x05
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
847 cpfseq hardware_flag
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
848 bra $+4
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
849 bra menu_new_battery_18650
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
850 bra use_old_batteries ; any unsupported value
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
851
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
852
474
2880aa1264f5 Fix new battery menu on Power-on reset
heinrichsweikamp
parents: 472
diff changeset
853 menu_new_battery_AA_16650:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
854 MENU_BEGIN tNewBattTitle, .5
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
855 MENU_CALL tNewBattOld, use_old_batteries
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
856 MENU_CALL tNewBattNew36, use_new_36V_batteries
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
857 MENU_CALL tNewBattNew15, use_new_15V_batteries
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
858 MENU_CALL tNewBattAccu, use_36V_rechargeable
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
859 MENU_CALL tNew16650, use_16650_battery
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
860 MENU_END
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
861
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
862
464
0491a84fd0b8 CHANGE: Easier to understand "New Battery" menu (OSTC model dependent)
heinrichsweikamp
parents: 457
diff changeset
863 menu_new_battery_AA:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
864 MENU_BEGIN tNewBattTitle, .4
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
865 MENU_CALL tNewBattOld, use_old_batteries
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
866 MENU_CALL tNewBattNew36, use_new_36V_batteries
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
867 MENU_CALL tNewBattNew15, use_new_15V_batteries
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
868 MENU_CALL tNewBattAccu, use_36V_rechargeable
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
869 MENU_END
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
870
464
0491a84fd0b8 CHANGE: Easier to understand "New Battery" menu (OSTC model dependent)
heinrichsweikamp
parents: 457
diff changeset
871
0491a84fd0b8 CHANGE: Easier to understand "New Battery" menu (OSTC model dependent)
heinrichsweikamp
parents: 457
diff changeset
872 menu_new_battery_18650:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
873 MENU_BEGIN tNewBattTitle, .2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
874 MENU_CALL tNewBattOld, use_old_batteries
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
875 MENU_CALL tNew18650, use_18650_battery
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
876 MENU_END
0
heinrichsweikamp
parents:
diff changeset
877
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
878
457
b4417044a042 recover old battery status prior 2.09
heinrichsweikamp
parents: 453
diff changeset
879 global use_old_prior_209
b4417044a042 recover old battery status prior 2.09
heinrichsweikamp
parents: 453
diff changeset
880 use_old_prior_209:
b4417044a042 recover old battery status prior 2.09
heinrichsweikamp
parents: 453
diff changeset
881 clrf EEADRH
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
882 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
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
883 incfsz EEDATA,F ; Was 0xFF?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
884 return ; No, done.
477
44b8a826b314 NEW: Show battery type in surface mode next to battery voltage
heinrichsweikamp
parents: 474
diff changeset
885
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
886 call lt2942_get_status ; Check for gauge IC
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
887 movlw .3 ; Assume a 18650
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
888 btfss battery_gauge_available ; cR/2 hardware?
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
889 movlw .1 ; Assume a Saft
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
890 movwf EEDATA
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
891 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
892 return
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
893
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
894
0
heinrichsweikamp
parents:
diff changeset
895 global use_old_batteries
heinrichsweikamp
parents:
diff changeset
896 use_old_batteries:
heinrichsweikamp
parents:
diff changeset
897 clrf EEADRH
heinrichsweikamp
parents:
diff changeset
898 read_int_eeprom 0x07
heinrichsweikamp
parents:
diff changeset
899 movff EEDATA,battery_gauge+0
heinrichsweikamp
parents:
diff changeset
900 read_int_eeprom 0x08
heinrichsweikamp
parents:
diff changeset
901 movff EEDATA,battery_gauge+1
heinrichsweikamp
parents:
diff changeset
902 read_int_eeprom 0x09
heinrichsweikamp
parents:
diff changeset
903 movff EEDATA,battery_gauge+2
heinrichsweikamp
parents:
diff changeset
904 read_int_eeprom 0x0A
heinrichsweikamp
parents:
diff changeset
905 movff EEDATA,battery_gauge+3
heinrichsweikamp
parents:
diff changeset
906 read_int_eeprom 0x0B
heinrichsweikamp
parents:
diff changeset
907 movff EEDATA,battery_gauge+4
heinrichsweikamp
parents:
diff changeset
908 read_int_eeprom 0x0C
heinrichsweikamp
parents:
diff changeset
909 movff EEDATA,battery_gauge+5
448
aadfe9f2edaf work on new battery options
heinrichsweikamp
parents: 428
diff changeset
910 read_int_eeprom 0x0F
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
911 movff EEDATA,battery_type ; =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
448
aadfe9f2edaf work on new battery options
heinrichsweikamp
parents: 428
diff changeset
912
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
913 rcall setup_new_saft ; Any other value
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
914 incf EEDATA,F ; 1 ... 5
450
791a25c4aab4 bugfix "old battery" type
heinrichsweikamp
parents: 448
diff changeset
915 dcfsnz EEDATA,F
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
916 rcall setup_new_15v ;=0
450
791a25c4aab4 bugfix "old battery" type
heinrichsweikamp
parents: 448
diff changeset
917 dcfsnz EEDATA,F
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
918 rcall setup_new_saft ;=1
450
791a25c4aab4 bugfix "old battery" type
heinrichsweikamp
parents: 448
diff changeset
919 dcfsnz EEDATA,F
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
920 rcall setup_new_panasonic ;=2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
921 dcfsnz EEDATA,F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
922 rcall setup_new_18650 ;=3
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
923 dcfsnz EEDATA,F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
924 rcall setup_new_16650 ;=4
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
925
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
926 bcf use_old_batt_flag ; clear flag
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
927 goto surfloop ; Jump to Surfaceloop!
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
928
0
heinrichsweikamp
parents:
diff changeset
929
472
4fdf6886004b CHANGE: Show warnings either in Customview (If active) _or_ next to warning sign
heinrichsweikamp
parents: 470
diff changeset
930 setup_new_15v:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
931 bsf charge_disable
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
932 bcf TRISE,2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
933 movlw .100
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
934 movwf batt_percent ; To have 1,5V batteries right after firmware update
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
935 movlw .0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
936 movff WREG,battery_type
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
937 return
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
938
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
939
448
aadfe9f2edaf work on new battery options
heinrichsweikamp
parents: 428
diff changeset
940 setup_new_saft:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
941 banksel battery_capacity
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
942 movlw LOW internal_saft_capacity
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
943 movwf internal_battery_capacity+0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
944 movlw HIGH internal_saft_capacity
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
945 movwf internal_battery_capacity+1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
946 movlw LOW saft_capacity
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
947 movwf battery_capacity+0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
948 movlw HIGH saft_capacity
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
949 movwf battery_capacity+1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
950 movlw LOW saft_offset
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
951 movwf battery_offset+0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
952 movlw HIGH saft_offset
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
953 movwf battery_offset+1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
954 banksel common
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
955 bsf charge_disable
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
956 bcf TRISE,2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
957 movlw .1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
958 movff WREG,battery_type
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
959 return
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
960
448
aadfe9f2edaf work on new battery options
heinrichsweikamp
parents: 428
diff changeset
961
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
962 setup_new_panasonic:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
963 banksel battery_capacity
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
964 movlw LOW internal_panasonic_capacity
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
965 movwf internal_battery_capacity+0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
966 movlw HIGH internal_panasonic_capacity
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
967 movwf internal_battery_capacity+1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
968 movlw LOW panasonic_capacity
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
969 movwf battery_capacity+0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
970 movlw HIGH panasonic_capacity
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
971 movwf battery_capacity+1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
972 movlw LOW panasonic_offset
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
973 movwf battery_offset+0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
974 movlw HIGH panasonic_offset
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
975 movwf battery_offset+1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
976 banksel common
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
977 bcf charge_disable
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
978 bsf TRISE,2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
979 movlw .2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
980 movff WREG,battery_type
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
981 return
472
4fdf6886004b CHANGE: Show warnings either in Customview (If active) _or_ next to warning sign
heinrichsweikamp
parents: 470
diff changeset
982
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
983
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
984 setup_new_18650:
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
985 banksel battery_capacity
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
986 clrf internal_battery_capacity+0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
987 clrf internal_battery_capacity+1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
988 movlw LOW ncr18650_capacity
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
989 movwf battery_capacity+0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
990 movlw HIGH ncr18650_capacity
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
991 movwf battery_capacity+1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
992 movlw LOW ncr18650_offset
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
993 movwf battery_offset+0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
994 movlw HIGH ncr18650_offset
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
995 movwf battery_offset+1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
996 banksel common
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
997 bcf charge_disable
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
998 bsf TRISE,2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
999 movlw .3
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1000 movff WREG,battery_type
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1001 return
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1002
472
4fdf6886004b CHANGE: Show warnings either in Customview (If active) _or_ next to warning sign
heinrichsweikamp
parents: 470
diff changeset
1003
4fdf6886004b CHANGE: Show warnings either in Customview (If active) _or_ next to warning sign
heinrichsweikamp
parents: 470
diff changeset
1004 setup_new_16650:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1005 banksel battery_capacity
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1006 clrf internal_battery_capacity+0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1007 clrf internal_battery_capacity+1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1008 movlw LOW ur16650_capacity
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1009 movwf battery_capacity+0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1010 movlw HIGH ur16650_capacity
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1011 movwf battery_capacity+1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1012 movlw LOW ur16650_offset
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1013 movwf battery_offset+0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1014 movlw HIGH ur16650_offset
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1015 movwf battery_offset+1
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1016 banksel common
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1017 bcf charge_disable
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1018 bsf TRISE,2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1019 movlw .4
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1020 movff WREG,battery_type
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1021 return
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1022
472
4fdf6886004b CHANGE: Show warnings either in Customview (If active) _or_ next to warning sign
heinrichsweikamp
parents: 470
diff changeset
1023
474
2880aa1264f5 Fix new battery menu on Power-on reset
heinrichsweikamp
parents: 472
diff changeset
1024 use_16650_battery:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1025 rcall setup_new_16650
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1026 bra use_new_36V_2
448
aadfe9f2edaf work on new battery options
heinrichsweikamp
parents: 428
diff changeset
1027 use_18650_battery:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1028 rcall setup_new_18650
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1029 bra use_new_36V_2
0
heinrichsweikamp
parents:
diff changeset
1030 use_new_36V_batteries:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1031 rcall setup_new_saft
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1032 bra use_new_36V_2
448
aadfe9f2edaf work on new battery options
heinrichsweikamp
parents: 428
diff changeset
1033 use_new_15V_batteries:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1034 rcall setup_new_15v
448
aadfe9f2edaf work on new battery options
heinrichsweikamp
parents: 428
diff changeset
1035 use_new_36V_2:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1036 call reset_battery_pointer ; Resets battery pointer 0x07-0x0C and battery_gauge:5
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1037 goto surfloop ; Jump to Surface loop!
448
aadfe9f2edaf work on new battery options
heinrichsweikamp
parents: 428
diff changeset
1038 use_36V_rechargeable:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1039 rcall setup_new_panasonic
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1040 call reset_battery_internal_only
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1041 goto surfloop ; Jump to Surface loop!
0
heinrichsweikamp
parents:
diff changeset
1042
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1043 END