annotate src/menu_tree.asm @ 627:bf5fee575701

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