annotate src/menu_tree.asm @ 632:0347acdf6d8e

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