annotate src/menu_tree.asm @ 634:4050675965ea

3.10 stable release
author heinrichsweikamp
date Tue, 28 Apr 2020 17:34:31 +0200
parents 185ba2f91f59
children 9a64914a8fca
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
heinrichsweikamp
parents:
diff changeset
1 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
2 ;
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
3 ; File menu_tree.asm * combined next generation V3.09.5
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
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
12
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
13 ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
14 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
15 ; ATTENTION
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
16 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
17 ; All Calls made via the Menu Macros need to go to Addresses within 0x0xxxx !
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
18 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
19 ;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
20
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
21
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
22 #include "hwos.inc" ; mandatory header
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
23 #include "shared_definitions.h" ; mailbox from/to p2_deco.c
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
24 #include "gaslist.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
25 #include "menu_processor.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
26 #include "start.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
27 #include "comm.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
28 #include "tft.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
29 #include "eeprom_rs232.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
30 #include "external_flash.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
31 #include "adc_lightsensor.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
32 #include "wait.inc"
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
33 #include "i2c.inc"
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
34 #include "calibrate.inc"
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
35 #include "math.inc"
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
36 #include "rtc.inc"
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
37 #include "strings.inc"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
38 #include "tft_outputs.inc"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
39 #include "convert.inc"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
40 #include "colorschemes.inc"
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
41
0
heinrichsweikamp
parents:
diff changeset
42
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
43 extern surfloop
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
44 extern logbook
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
45 extern demo_divemode
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
46 extern demo_planner
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
47 extern piezo_config
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
48 extern comm_firmware_update_exec
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
49
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
50 extern option_check_and_store_all
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
51 extern option_reset
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
52 extern option_reset_all
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
53 extern option_adjust_group_member
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
54 extern option_inc
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
55 extern option_dec
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
56 extern option_draw
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
57
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
58 extern get_cpu_version
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
59 extern eeprom_deco_data_write
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
60
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
61
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
62 IFDEF _ccr_pscr
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
63 extern option_cleanup_oCCRMode
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
64 ENDIF
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
65
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
66 IFDEF _compass
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
67 extern compass_calibration
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
68 ENDIF
174
932e91074bdb CHANGE: Clarify Travel Gases with "---" as change depth
heinrichsweikamp
parents: 155
diff changeset
69
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
70 IFDEF _rx_functions
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
71 extern get_transmitter_id_by_slot
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
72 ENDIF
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
73
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
74
0
heinrichsweikamp
parents:
diff changeset
75 ;=============================================================================
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
76 surf_menu CODE 0x01000 ; needs to be at 0x0xxxx
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
77 ;=============================================================================
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
78
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
79
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
80 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
81 ; Returning from a Menu Item
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
82 ;
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
83 do_return_main_menu:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
84 call menu_processor_double_pop ; drop exit line and back to last line
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
85 bra main_menu_common ; continue with menu
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
86
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
87
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
88 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
89 ; Entry Point for Main Menu
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
90 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
91 global main_menu
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
92 main_menu:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
93 movff active_customview,customview_surfmode ; save last custom view
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
94 clrf MS_flags_imprint ; clear all flags for data imprinting
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
95 call TFT_boot ; initialize display
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
96 call menu_processor_reset ; reset menu stack
0
heinrichsweikamp
parents:
diff changeset
97
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
98 main_menu_common:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
99 IFDEF _ccr_pscr
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
100 MENU_BEGIN tMainMenu, .7
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
101 MENU_CALL tLogbook, do_logbook
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
102 MENU_CALL tGasSetup, do_menu_gas
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
103 MENU_CALL tCCRSetup, do_menu_ccr
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
104 MENU_CALL tDiveModeMenu, do_menu_dive
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
105 MENU_CALL tSimulator, do_menu_simulator
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
106 MENU_CALL tSystSets, do_menu_settings
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
107 MENU_CALL tExit, do_restart
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
108 MENU_END
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
109 ELSE
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
110 MENU_BEGIN tMainMenu, .6
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
111 MENU_CALL tLogbook, do_logbook
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
112 MENU_CALL tGasSetup, do_menu_gas
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
113 MENU_CALL tDiveModeMenu, do_menu_dive
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
114 MENU_CALL tSimulator, do_menu_simulator
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
115 MENU_CALL tSystSets, do_menu_settings
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
116 MENU_CALL tExit, do_restart
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
117 MENU_END
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
118 ENDIF ; _ccr_pscr
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
119
0
heinrichsweikamp
parents:
diff changeset
120
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
121 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
122 ; Call Function - start Logbook
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
123 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
124 do_logbook:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
125 goto logbook ; code is hosted in logbook.asm
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
126
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
127
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
128 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
129 ; Call Function - exit Menu
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
130 ;
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
131 do_restart:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
132 bsf restart_fast ; skip logos and waits an restart
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
133 goto restart ; restart into surface mode
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
134
0
heinrichsweikamp
parents:
diff changeset
135
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
136 IFDEF _ccr_pscr
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
137
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
138 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
139 ; returning to CCR / pSCR Setup
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
140 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
141 do_return_menu_ccr:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
142 call menu_processor_double_pop ; drop exit line and back to last line
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
143 ;bra do_menu_ccr
0
heinrichsweikamp
parents:
diff changeset
144
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
145
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
146 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
147 ; CCR / pSCR Setup - 1st Level
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
148 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
149 do_menu_ccr:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
150 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
151
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
152 IFDEF _external_sensor
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
153
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
154 bcf imprint_sensor_mv ; stop imprinting of live O2 sensor mV data
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
155 btfss ext_input_s8_ana ; S8/analog sensor input available?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
156 bra do_menu_ccr_2 ; NO - do OSTC 2 menu
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
157 ;bra do_menu_ccr_cR ; YES - do OSTC cR menu
240
633c7a6de5bc auto-select correct ccr menu
heinrichsweikamp
parents: 236
diff changeset
158
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
159 do_menu_ccr_cR: ; OSTC cR menu
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
160 MENU_BEGIN tCCRSetup, .6
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
161 MENU_OPT_INC tCCRMode, oCCRMode
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
162 MENU_CALL tCalibrateMenu, do_menu_calibrate
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
163 MENU_CALL tDiluentSetup, do_menu_diluent
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
164 MENU_CALL tFixedSetpoints, do_menu_setpoints
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
165 MENU_CALL tMore, do_menu_ccr_more
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
166 MENU_CALL tBack, do_return_main_menu
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
167 MENU_END
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
168
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
169 ENDIF ; _external_sensor
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
170
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
171 do_menu_ccr_2:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
172 MENU_BEGIN tCCRSetup, .5 ; OSTC 2 menu
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
173 MENU_OPT_INC tCCRMode, oCCRMode
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
174 MENU_CALL tDiluentSetup, do_menu_diluent
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
175 MENU_CALL tFixedSetpoints, do_menu_setpoints
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
176 MENU_CALL tMore, do_menu_ccr_more
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
177 MENU_CALL tBack, do_return_main_menu
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
178 MENU_END
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
179
174
932e91074bdb CHANGE: Clarify Travel Gases with "---" as change depth
heinrichsweikamp
parents: 155
diff changeset
180
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
181 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
182 ; CCR / pSCR Setup - 2nd Level
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
183 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
184 do_menu_ccr_more:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
185 IFDEF _external_sensor
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
186 MENU_BEGIN tCCRSetup, .7 ; CCR/pSCR more menu
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
187 MENU_OPT_INC tS8Mode, oS8Mode
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
188 MENU_OPT_INC tCCmaxFracO2, oCCmaxFracO2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
189 MENU_OPT_INC tDilppO2Check, oDilppO2Check
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
190 MENU_OPT_INC tGasDensityCheck, oGasDensityCheck
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
191 MENU_OPT_INC tPSCR_O2_drop, oPSCR_drop
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
192 MENU_OPT_INC tPSCR_lungratio, oPSCR_lungratio
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
193 MENU_CALL tBack, do_return_menu_ccr
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
194 MENU_END
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
195 ELSE
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
196 MENU_BEGIN tCCRSetup, .6 ; CCR/pSCR more menu
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
197 MENU_OPT_INC tCCmaxFracO2, oCCmaxFracO2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
198 MENU_OPT_INC tDilppO2Check, oDilppO2Check
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
199 MENU_OPT_INC tGasDensityCheck, oGasDensityCheck
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
200 MENU_OPT_INC tPSCR_O2_drop, oPSCR_drop
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
201 MENU_OPT_INC tPSCR_lungratio, oPSCR_lungratio
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
202 MENU_CALL tBack, do_return_menu_ccr
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
203 MENU_END
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
204 ENDIF ; _external_sensor
0
heinrichsweikamp
parents:
diff changeset
205
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
206 ENDIF ; _ccr_pscr
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
207
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
208
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
209 IFDEF _external_sensor
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
210
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
211 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
212 ; Calibration Menu
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
213 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
214 do_menu_calibrate:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
215 call enable_ir_s8_analog ; enable IR/S8/analog interface
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
216 bsf imprint_sensor_mv ; start imprinting of live O2 sensor mV data
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
217
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
218 MENU_BEGIN tCalibrateMenu, .6
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
219 MENU_CALL tDiveHudMask1, 0 ; data will be superimposed by housekeeping
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
220 MENU_CALL tDiveHudMask2, 0 ; ...
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
221 MENU_CALL tDiveHudMask3, 0 ; ...
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
222 MENU_OPT_INC tCalibrationGas, oCalGasO2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
223 MENU_CALL tCalibrate, do_calibrate
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
224 MENU_CALL tBack, do_return_menu_ccr
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
225 MENU_END
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
226
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
227
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
228 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
229 ; Call Function - start Calibration, returns to Surface Mode
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
230 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
231 do_calibrate:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
232 call calibrate_mix ; calibrate with opt_calibration_O2_ratio, also calibrate S8 HUD if connected
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
233 WAITMS d'250' ; wait for HUD v3
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
234 movlw .9 ; load index of sensor mV custom view
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
235 movff WREG,customview_surfmode ; show this custom view when back in surface mode
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
236 bra do_restart ; exit menu
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
237
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
238 ENDIF ; _external_sensor
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
239
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
240
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
241 IFDEF _ccr_pscr
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
242
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
243 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
244 ; Diluent Setup
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
245 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
246 do_menu_diluent:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
247 bsf is_diluent_menu ; setting up diluents
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
248 bcf short_gas_descriptions ; use long gas description format
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
249 bcf better_gas_hint ; do not mark the best gas/diluent (to be used in dive mode only)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
250 call gaslist_cleanup_list ; make sure there is only one gas being first
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
251
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
252 MENU_BEGIN tDiluentSetup, .6
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
253 MENU_DYNAMIC dyn_strcat_gas_PRODL, do_menu_edit_gas
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
254 MENU_DYNAMIC dyn_strcat_gas_PRODL, do_menu_edit_gas
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
255 MENU_DYNAMIC dyn_strcat_gas_PRODL, do_menu_edit_gas
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
256 MENU_DYNAMIC dyn_strcat_gas_PRODL, do_menu_edit_gas
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
257 MENU_DYNAMIC dyn_strcat_gas_PRODL, do_menu_edit_gas
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
258 MENU_CALL tBack, do_return_menu_ccr
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
259 MENU_END
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
260
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
261
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
262 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
263 ; dynamic Title - show full Gas Description (just for info, active code is in other place)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
264 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
265 ;dyn_strcat_gas_PRODL:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
266 ; goto gaslist_strcat_gas_PRODL ; code is hosted in gaslist.asm
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
267
0
heinrichsweikamp
parents:
diff changeset
268
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
269 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
270 ; returning to Setpoint Setup
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
271 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
272 do_return_menu_setpoints:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
273 call menu_processor_double_pop ; drop exit line and back to last line
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
274 bcf block_option_value ; resume displaying of option values
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
275 ;bra do_menu_setpoints ; continue
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
276
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
277
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
278 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
279 ; Setpoint Setup - 1st Level
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
280 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
281 do_menu_setpoints:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
282 bcf short_gas_descriptions ; use long gas description format
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
283 bcf better_gas_hint ; do not mark the best gas/diluent (to be used in dive mode only)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
284
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
285 MENU_BEGIN tFixedSetpoints, .6
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
286 MENU_DYNAMIC dyn_strcat_setpoint_prodl, do_menu_edit_sp
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
287 MENU_DYNAMIC dyn_strcat_setpoint_prodl, do_menu_edit_sp
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
288 MENU_DYNAMIC dyn_strcat_setpoint_prodl, do_menu_edit_sp
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
289 MENU_DYNAMIC dyn_strcat_setpoint_prodl, do_menu_edit_sp
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
290 MENU_DYNAMIC dyn_strcat_setpoint_prodl, do_menu_edit_sp
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
291 MENU_CALL tBack, do_return_menu_ccr
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
292 MENU_END
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
293
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
294
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
295 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
296 ; dynamic Title - show Setpoint Data
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
297 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
298 dyn_strcat_setpoint_prodl:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
299 goto gaslist_strcat_setpoint_PRODL ; function is hosted in gaslist.asm
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
300
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
301
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
302 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
303 ; Setpoint Setup - 2nd Level
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
304 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
305 do_menu_edit_sp:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
306 movff PRODL,gaslist_gas ; get menu item we came from (0-4)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
307 bsf block_option_value ; suspend displaying of option values
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
308
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
309 MENU_BEGIN tFixedSetpoints, .5
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
310 MENU_DYNAMIC dyn_strcat_setpoint, 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
311 MENU_GRP_INC tSPPlus, oSP1ppO2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
312 MENU_GRP_INCS tDepthPlus, oSP1Depth
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
313 MENU_GRP_DECS tDepthMinus, oSP1Depth
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
314 MENU_CALL tBack, do_return_menu_setpoints
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
315 MENU_END
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
316
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
317
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
318 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
319 ; dynamic Title - show Setpoint Data
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
320 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
321 dyn_strcat_setpoint:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
322 goto gaslist_strcat_setpoint ; function is hosted in gaslist.asm
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
323
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
324 ENDIF ; _ccr_pscr
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
325
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
326
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
327 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
328 ; returning from Gas / Diluent Setup
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
329 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
330 do_return_menu_gas:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
331 call menu_processor_double_pop ; drop exit line and back to last line
0
heinrichsweikamp
parents:
diff changeset
332
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
333 IFDEF _ccr_pscr
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
334 btfsc is_diluent_menu ; return from setting up diluents?
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
335 bra do_menu_diluent ; YES - continue with diluent menu
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
336 ;bra do_menu_gas ; NO - continue with OC gas menu
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
337 ENDIF
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
338
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
339
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
340 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
341 ; OC Gas Setup - 1st Level
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
342 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
343 do_menu_gas:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
344 bcf is_diluent_menu ; setting up OC gases
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
345 bcf short_gas_descriptions ; use long gas description format
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
346 bcf better_gas_hint ; do not mark the best gas/diluent (to be used in dive mode only)
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
347 call gaslist_cleanup_list ; make sure there is only one gas being first
0
heinrichsweikamp
parents:
diff changeset
348
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
349 MENU_BEGIN tGaslist, .6
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
350 MENU_DYNAMIC dyn_strcat_gas_PRODL, do_menu_edit_gas
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
351 MENU_DYNAMIC dyn_strcat_gas_PRODL, do_menu_edit_gas
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
352 MENU_DYNAMIC dyn_strcat_gas_PRODL, do_menu_edit_gas
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
353 MENU_DYNAMIC dyn_strcat_gas_PRODL, do_menu_edit_gas
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
354 MENU_DYNAMIC dyn_strcat_gas_PRODL, do_menu_edit_gas
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
355 MENU_CALL tBack, do_return_main_menu
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
356 MENU_END
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
357
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
358
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
359 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
360 ; dynamic Title - show full Gas Description
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
361 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
362 dyn_strcat_gas_PRODL:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
363 goto gaslist_strcat_gas_PRODL ; code is hosted in gaslist.asm
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
364
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
365
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
366 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
367 ; return to OC Gas Setup from Sub-Menu
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
368 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
369 do_return_menu_edit_gas:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
370 IFDEF _rx_functions
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
371 bcf imprint_xmitter_pres ; stop imprinting of transmitter pressure data
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
372 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
373 ENDIF
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
374 call menu_processor_double_pop ; drop exit line and back to last line
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
375 bcf block_option_value ; resume displaying of option values
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
376 bra do_menu_edit_gas_common ; continue with common part
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
377
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
378
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
379 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
380 ; OC Gas Setup - 2nd Level
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
381 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
382 do_menu_edit_gas:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
383 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
384 movlw .5 ; offset between gases and diluents
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
385 btfsc is_diluent_menu ; setting up diluents?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
386 addwf gaslist_gas,F ; YES - add the offset
0
heinrichsweikamp
parents:
diff changeset
387
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
388 do_menu_edit_gas_common:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
389 MENU_BEGIN tGasEdit, .7
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
390 MENU_DYNAMIC dyn_gastitle, 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
391 MENU_DYNAMIC dyn_MOD_END, 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
392 MENU_GRP_INC tType, oGas1
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
393 MENU_CALL tSetup_GasMix, do_menu_gas_mix
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
394 MENU_DYNAMIC dyn_show_depth, do_menu_gas_depth
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
395 MENU_CALL tSetup_Tank, do_menu_gas_tank
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
396 MENU_CALL tBack, do_return_menu_gas
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
397 MENU_END
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
398
0
heinrichsweikamp
parents:
diff changeset
399
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
400 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
401 ; dynamic Title - show full Gas Description
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
402 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
403 dyn_gastitle:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
404 goto gaslist_strcat_gas ; code is hosted in gaslist.asm
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
405
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
406
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
407 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
408 ; dynamic Title - show MOD and END
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
409 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
410 dyn_MOD_END:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
411 goto gaslist_MOD_END ; code is hosted in gaslist.asm
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
412
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
413
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
414 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
415 ; dynamic Title - show Change Depth
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
416 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
417 dyn_show_depth:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
418 movf gaslist_gas,W ; load gas/dil index into WREG (0-9)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
419 lfsr FSR1,opt_gas_change ; load base address of change depths
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
420 tstfsz PLUSW1 ; change depth = 0 ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
421 bra dyn_show_depth_1 ; NO - print in normal color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
422 lfsr FSR1,opt_gas_type ; YES - load base address of opt_gas_type
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
423 tstfsz PLUSW1 ; - type = disabled ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
424 FONT_COLOR_ATTENTION ; NO - print in attention color (yellow)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
425 dyn_show_depth_1:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
426 STRCAT_TEXT tSetup_GasDepth ; print text
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
427 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
428
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
429
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
430 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
431 ; OC Gas Setup - 3rd Level - Mix
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
432 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
433 do_menu_gas_mix:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
434 bsf block_option_value ; suspend displaying of option values
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
435
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
436 IFDEF _helium
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
437 MENU_BEGIN tGasEdit, .7
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
438 MENU_DYNAMIC dyn_gastitle, 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
439 MENU_DYNAMIC dyn_MOD_END, 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
440 MENU_GRP_INCS tO2Plus, oGas1O2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
441 MENU_GRP_DECS tO2Minus, oGas1O2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
442 MENU_GRP_INCS tHePlus, oGas1He
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
443 MENU_GRP_DECS tHeMinus, oGas1He
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
444 MENU_CALL tBack, do_return_menu_edit_gas
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
445 MENU_END
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
446 ELSE
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
447 MENU_BEGIN tGasEdit, .5
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
448 MENU_DYNAMIC dyn_gastitle, 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
449 MENU_DYNAMIC dyn_MOD_END, 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
450 MENU_GRP_INCS tO2Plus, oGas1O2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
451 MENU_GRP_DECS tO2Minus, oGas1O2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
452 MENU_CALL tBack, do_return_menu_edit_gas
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
453 MENU_END
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
454 ENDIF
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
455
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
456
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
457 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
458 ; OC Gas Setup - 3rd Level - Change Depth
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
459 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
460 do_menu_gas_depth:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
461 bsf block_option_value ; suspend displaying of option values
174
932e91074bdb CHANGE: Clarify Travel Gases with "---" as change depth
heinrichsweikamp
parents: 155
diff changeset
462
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
463 MENU_BEGIN tGasEdit, .7
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
464 MENU_DYNAMIC dyn_gastitle, 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
465 MENU_DYNAMIC dyn_MOD_END, 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
466 MENU_DYNAMIC dyn_ppo2, 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
467 MENU_GRP_INCS tDepthPlus, oGas1Depth
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
468 MENU_GRP_DECS tDepthMinus, oGas1Depth
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
469 MENU_DYNAMIC dyn_reset_mod_title, do_gas_depth_reset
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
470 MENU_CALL tBack, do_return_menu_edit_gas
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
471 MENU_END
0
heinrichsweikamp
parents:
diff changeset
472
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
473
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
474 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
475 ; dynamic Title - show Gas Description
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
476 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
477 ;dyn_gastitle:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
478 ; goto gaslist_strcat_gas ; code is hosted in gaslist.asm
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
479
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
480
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
481 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
482 ; dynamic Title - show MOD and END
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
483 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
484 ;dyn_MOD_END:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
485 ; goto gaslist_MOD_END ; code is hosted in gaslist.asm
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
486
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
487
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
488 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
489 ; dynamic Title - show ppO2 and Change Depth
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
490 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
491 dyn_ppo2:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
492 goto gaslist_ppo2 ; code is hosted in gaslist.asm
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
493
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
494
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
495 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
496 ; dynamic Title - show 'Rest to MOD' Dialog
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
497 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
498 dyn_reset_mod_title:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
499 goto gaslist_reset_mod_title ; code is hosted in gaslist.asm
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
500
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
501
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
502 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
503 ; Call Function - reset Change Depth to MOD
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
504 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
505 do_gas_depth_reset:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
506 call gaslist_calc_mod ; compute MOD, result in WREG
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
507 movwf lo ; copy result to lo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
508 lfsr FSR1,opt_gas_change ; load base address of opt_gas_change
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
509 movf gaslist_gas,W ; load index
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
510 movff lo,PLUSW1 ; update change depth
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
511 bsf option_changed ; flag that EEPROM needs to be updated
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
512 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
513
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
514
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
515 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
516 ; OC Gas Setup - 3rd Level - Tank Setup
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
517 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
518 do_menu_gas_tank:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
519 IFDEF _rx_functions
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
520 TSTOSC opt_TR_mode ; TR functions switched on?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
521 bra do_menu_gas_tank_rx ; YES
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
522 ENDIF
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
523
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
524 IFDEF _ccr_pscr
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
525 MENU_BEGIN tSetup_Tank, .5
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
526 MENU_DYNAMIC dyn_gastitle, 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
527 MENU_GRP_INC tTankSize, oTankSizeOC1
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
528 MENU_GRP_INC tTankUsablePress, oTankPresOC1
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
529 MENU_CALL tCopyDilToOC, do_copy_dil_to_oc
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
530 MENU_CALL tBack, do_return_menu_edit_gas
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
531 MENU_END
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
532 ELSE
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
533 MENU_BEGIN tSetup_Tank, .4
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
534 MENU_DYNAMIC dyn_gastitle, 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
535 MENU_GRP_INC tTankSize, oTankSizeOC1
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
536 MENU_GRP_INC tTankUsablePress, oTankPresOC1
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
537 MENU_CALL tBack, do_return_menu_edit_gas
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
538 MENU_END
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
539 ENDIF ; _ccr_pscr
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
540
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
541
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
542 IFDEF _rx_functions
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
543 do_menu_gas_tank_rx:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
544 setf pairing_slot ; prime slot number with 255 aka -1, used in pairing function
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
545 bsf imprint_xmitter_ID ; in transmitter selection menu (longer timeout)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
546
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
547 IFDEF _ccr_pscr
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
548 MENU_BEGIN tSetup_Tank, .7
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
549 MENU_DYNAMIC dyn_gastitle, 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
550 MENU_DYNAMIC dyn_tank_id_pres, 0 ; pressure will be superimposed by housekeeping
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
551 MENU_CALL tTankPairing, do_tank_pairing
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
552 MENU_GRP_INC tTankSize, oTankSizeOC1
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
553 MENU_GRP_INC tTankUsablePress, oTankPresOC1
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
554 MENU_CALL tCopyDilToOC, do_copy_dil_to_oc
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
555 MENU_CALL tBack, do_return_menu_edit_gas
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
556 MENU_END
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
557 ELSE
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
558 MENU_BEGIN tSetup_Tank, .6
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
559 MENU_DYNAMIC dyn_gastitle, 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
560 MENU_DYNAMIC dyn_tank_id_pres, 0 ; pressure will be superimposed by housekeeping
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
561 MENU_CALL tTankPairing, do_tank_pairing
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
562 MENU_GRP_INC tTankSize, oTankSizeOC1
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
563 MENU_GRP_INC tTankUsablePress, oTankPresOC1
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
564 MENU_CALL tBack, do_return_menu_edit_gas
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
565 MENU_END
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
566 ENDIF ; _ccr_pscr
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
567
0
heinrichsweikamp
parents:
diff changeset
568
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
569 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
570 ; dynamic Title - show Transmitter ID
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
571 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
572 dyn_tank_id_pres:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
573 STRCAT " ID: " ; print header
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
574 ; get ID
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
575 lfsr FSR1,opt_transmitter_id_1 ; load base address of opt_transmitter_id
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
576 movf gaslist_gas,W ; load index (0-9)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
577 rlncf WREG,W ; multiply by 2 because IDs are 2 byte in size
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
578 movff PLUSW1,lo ; copy opt_transmitter_id+0[gaslist_gas] to lo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
579 incf WREG,W ; increment index
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
580 movff PLUSW1,hi ; copy opt_transmitter_id+1[gaslist_gas] to hi
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
581 ; check if a transmitter is paired to this tank
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
582 tstfsz hi ; high byte of ID <> 0 ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
583 bra dyn_tank_id_pres_1 ; YES - a transmitter is paired to the tank
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
584 tstfsz lo ; low byte of ID <> 0 ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
585 bra dyn_tank_id_pres_1 ; YES - a transmitter is paired to the tank
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
586 STRCAT "----" ; NO - no transmitter paired
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
587 bcf imprint_xmitter_pres ; - stop imprinting of transmitter pressure data
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
588 return ; - done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
589 dyn_tank_id_pres_1: ; show ID
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
590 movf hi,W ; copy high byte of ID to WREG
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
591 output_hex ; print it
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
592 movf lo,W ; copy low byte of ID to WREG
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
593 output_hex ; print it
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
594 bsf imprint_xmitter_pres ; start imprinting of transmitter pressure data
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
595 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
596
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
597
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
598 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
599 ; Call Function - pair a Transmitter to a Tank
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
600 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
601 do_tank_pairing:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
602 incf pairing_slot,F ; goto next RX data slot
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
603 btfsc pairing_slot,3 ; slot = 8?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
604 bra do_tank_pairing_none ; YES - offer unpairing
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
605 movf pairing_slot,W ; NO - copy slot to WREG
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
606 call get_transmitter_id_by_slot ; WREG = slot (0-7) -> hi:lo = transmitter ID
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
607 tstfsz hi ; transmitter found (probe on high byte)?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
608 bra do_tank_pairing_common ; YES - select this transmitter
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
609 tstfsz hi ; transmitter found (probe on low byte)?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
610 bra do_tank_pairing_common ; YES - select this transmitter
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
611 bra do_tank_pairing ; NO - try next slot
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
612 do_tank_pairing_common:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
613 lfsr FSR1,opt_transmitter_id_1 ; load base address of opt_transmitter_id
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
614 movf gaslist_gas,W ; load index into WREG (0-9)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
615 rlncf WREG,W ; multiply by 2 because IDs are 2 byte in size
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
616 movff lo,PLUSW1 ; copy lo to opt_transmitter_id+0[gaslist_gas]
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
617 incf WREG,W ; increment index
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
618 movff hi,PLUSW1 ; copy hi to opt_transmitter_id+1[gaslist_gas]
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
619 bsf option_changed ; flag that EEPROM needs to be updated
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
620 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
621 do_tank_pairing_none:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
622 setf pairing_slot ; prime slot number with 255 aka -1
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
623 clrf hi ; adjust "no transmitter" ID
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
624 clrf lo ; adjust "no transmitter" ID
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
625 bra do_tank_pairing_common ; continue with common part
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
626
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
627 ENDIF ; _rx_functions
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
628
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
629
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
630 IFDEF _ccr_pscr
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
631
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
632 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
633 ; Call Function - copy Diluent Setup to OC Gases
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
634 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
635 do_copy_dil_to_oc:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
636 bcf copying_dil ; default to copying a gas
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
637 movf gaslist_gas,W ; copy current gas or diluent number to WREG
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
638 btfss is_diluent_menu ; setting up diluents?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
639 bra do_copy_dil_to_oc_1 ; NO - gaslist_gas is already pointing to an OC gas
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
640 addlw -.5 ; YES - subtract offset between diluents and gases
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
641 movwf gaslist_gas ; - let gaslist_gas point to the corresponding OC gas
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
642 bsf copying_dil ; - we are copying a diluent
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
643 bcf is_diluent_menu ; - pretend we are setting up OC gases
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
644 do_copy_dil_to_oc_1:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
645 lfsr FSR0,opt_dil_O2_ratio ; load base address of diluents settings, ASM variables
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
646 lfsr FSR1,opt_gas_O2_ratio ; load base address of gas settings, ASM variables
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
647 movff PLUSW0,PLUSW1 ; copy O2 ratio
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
648 addlw .10 ; add offset from O2 ratios to He ratios
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
649 movff PLUSW0,PLUSW1 ; copy He ratio
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
650 addlw .10 ; add offset from He ratios to types
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
651 movff PLUSW0,PLUSW1 ; copy type
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
652 addlw .10 ; add offset from type to change depth
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
653 movff PLUSW0,PLUSW1 ; copy change depth
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
654 addlw -.30 ; wind back to initial gas number
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
655 lfsr FSR0,char_I_gas_avail_size+5; load base address of diluents settings, shared variables
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
656 lfsr FSR1,char_I_gas_avail_size+0; load base address of gas settings, shared variables
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
657 movff PLUSW0,PLUSW1 ; copy tank size
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
658 addlw .10 ; add offset from tank sizes to pressure budget
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
659 movff PLUSW0,PLUSW1 ; copy pressure budget
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
660 call gaslist_cleanup_list ; make sure there is only one gas being first
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
661 bsf option_changed ; flag that EEPROM needs to be updated
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
662 btfss copying_dil ; are we copying a diluent?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
663 return ; NO - done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
664 bsf is_diluent_menu ; YES - restore to be setting up diluents
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
665 movlw .5 ; - offset between OC gases and diluents
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
666 addwf gaslist_gas,F ; - let gaslist_gas point to the diluent again
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
667 WIN_BOX_BLACK .30,.239,.0,.159 ; - create some visual effect to show activity
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
668 WAITMS .200 ; - pause for 200 ms
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
669 return ; - done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
670
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
671 ENDIF ; _ccr_pscr
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
672
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
673
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
674 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
675 ; return to Simulator (Deco Calculator) Menu from Sub-Menu
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
676 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
677 do_return_menu_simulator:
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
678 call menu_processor_double_pop ; drop exit line and back to last line
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
679 bra do_menu_simulator_common_2 ; continue
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
680
0
heinrichsweikamp
parents:
diff changeset
681
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
682 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
683 ; return to Simulator (Deco Calculator) Menu from Deco Calculator
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
684 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
685 global do_return_menu_simulator_planner
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
686 do_return_menu_simulator_planner:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
687 call menu_processor_pop ; back to last line
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
688 bra do_menu_simulator_common_1 ; continue
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
689
0
heinrichsweikamp
parents:
diff changeset
690
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
691 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
692 ; Simulator (Deco Calculator) Menu
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
693 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
694 do_menu_simulator:
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
695 ; reset planning parameters to default values
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
696 lfsr FSR0,odiveInterval ; surface interval
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
697 call option_reset ; reset to default
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
698 lfsr FSR0,obottomTime ; bottom time
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
699 call option_reset ; reset to default
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
700 lfsr FSR0,obottomDepth ; bottom depth
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
701 call option_reset ; reset to default
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
702 lfsr FSR0,oSimAGF ; GF/aGF
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
703 call option_reset ; reset to default
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
704
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
705 IFDEF _gas_contingency
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
706 lfsr FSR0,oGasContingencySim ; gas contingency
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
707 call option_reset ; reset to default (volatile option)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
708 ENDIF ; _gas_contingency
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
709
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
710 do_menu_simulator_common_1:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
711 call restart_set_modes_and_flags ; initialize dive mode settings
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
712
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
713 do_menu_simulator_common_2:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
714
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
715 IFDEF _ccr_pscr
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
716
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
717 movff opt_dive_mode,WREG ; get dive mode: 0=OC, 1=CCR, 2=Gauge, 3=Apnea, 4=pSCR
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
718 decfsz WREG,W ; subtract one, became zero?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
719 bra do_menu_simulator_common_oc ; NO - use OC version
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
720 ;bra do_menu_simulator_common_ccr; YES - use CCR version
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
721
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
722 do_menu_simulator_common_ccr:
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
723 MENU_BEGIN tSimulator, .7
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
724 MENU_OPT_INC tIntvl, odiveInterval
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
725 MENU_OPT_INC tBtDep, obottomDepth
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
726 MENU_CALL tInter, do_demo_divemode
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
727 MENU_OPT_INC tBtTm, obottomTime
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
728 MENU_CALL tCalculatorSetup, do_menu_simulator_more
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
729 MENU_CALL tDeco, do_demo_planner
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
730 MENU_CALL tBack, do_return_main_menu
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
731 MENU_END
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
732
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
733 ENDIF ; _ccr_pscr
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
734
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
735 do_menu_simulator_common_oc:
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
736 MENU_BEGIN tSimulator, .7
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
737 MENU_OPT_INC tIntvl, odiveInterval
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
738 MENU_OPT_INC tBtDep, obottomDepth
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
739 MENU_CALL tInter, do_demo_divemode
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
740 MENU_OPT_INC tBtTm, obottomTime
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
741 MENU_OPT_INC tuseAGF, oSimAGF
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
742 MENU_CALL tDeco, do_demo_planner
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
743 MENU_CALL tBack, do_return_main_menu
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
744 MENU_END
0
heinrichsweikamp
parents:
diff changeset
745
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
746
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
747 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
748 ; Call Function - start Simulator Mode
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
749 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
750 do_demo_divemode:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
751 goto demo_divemode ; code is hosted in divemode.asm
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
752
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
753
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
754 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
755 ; Call Function - start Deco Calculator
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
756 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
757 do_demo_planner:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
758 goto demo_planner ; code is hosted in simulator.asm
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
759
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
760
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
761 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
762 ; Simulator (Deco Calculator) Menu - 2nd Layer
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
763 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
764 do_menu_simulator_more:
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
765 IFDEF _gas_contingency
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
766 MENU_BEGIN tSimulator, .4
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
767 MENU_OPT_INC tSelectSetpoint, oSimSetpoint
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
768 MENU_OPT_INC tuseAGF, oSimAGF
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
769 MENU_OPT_INC tGasContingencySim, oGasContingencySim
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
770 MENU_CALL tBack, do_return_menu_simulator
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
771 MENU_END
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
772 ELSE
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
773 MENU_BEGIN tSimulator, .3
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
774 MENU_OPT_INC tSelectSetpoint, oSimSetpoint
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
775 MENU_OPT_INC tuseAGF, oSimAGF
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
776 MENU_CALL tBack, do_return_menu_simulator
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
777 MENU_END
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
778 ENDIF ; _gas_contingency
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
779
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
780
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
781 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
782 ; return to Dive Settings Menu from Sub-Menu
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
783 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
784 do_return_menu_dive:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
785 call menu_processor_double_pop ; drop exit line and back to last line
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
786 ;bra do_menu_dive ; continue
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
787
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
788 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
789 ; Dive Settings Menu - 1st Layer
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
790 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
791 do_menu_dive:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
792 MENU_BEGIN tDiveModeMenu, .6
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
793 MENU_CALL tDiveSetup, do_menu_dive_dive ; dive setup
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
794 MENU_CALL tDecoSetup, do_menu_dive_deco ; deco setup
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
795 MENU_CALL tSACSetup, do_menu_dive_SAC ; SAC setup
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
796 MENU_CALL tppO2Setup, do_menu_dive_ppO2 ; ppO2 limits
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
797 MENU_CALL tStopsSetup, do_menu_dive_stops ; stops setup
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
798 MENU_CALL tBack, do_return_main_menu
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
799 MENU_END
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
800
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
801 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
802 ; Dive Settings Menu - 2nd Layer - Dive Mode
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
803 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
804 do_menu_dive_dive:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
805 IFDEF _cave_mode
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
806 MENU_BEGIN tDiveModeMenu, .6
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
807 MENU_OPT_INC tDvMode, oDiveMode ; dive mode
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
808 MENU_OPT_INC tCvMode, oCaveMode ; cave mode
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
809 MENU_OPT_INC tFTTSMenu, oExtraTime ; fTTS/delay
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
810 MENU_OPT_INC tTimeoutDive, oDiveTimeout ; dive timeout
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
811 MENU_OPT_INC tStoreApnoeDive, oStoreApnoe ; store apnoe
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
812 MENU_CALL tBack, do_return_menu_dive
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
813 MENU_END
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
814 ELSE
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
815 MENU_BEGIN tDiveModeMenu, .5
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
816 MENU_OPT_INC tDvMode, oDiveMode ; dive mode
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
817 MENU_OPT_INC tFTTSMenu, oExtraTime ; fTTS/delay
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
818 MENU_OPT_INC tTimeoutDive, oDiveTimeout ; dive timeout
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
819 MENU_OPT_INC tStoreApnoeDive, oStoreApnoe ; store apnoe
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
820 MENU_CALL tBack, do_return_menu_dive
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
821 MENU_END
628
cd58f7fc86db 3.05 stable work
heinrichsweikamp
parents: 623
diff changeset
822 ENDIF
524
d2e52e6e1604 menu work
heinrichsweikamp
parents: 523
diff changeset
823
298
2fe34fc0e2ae new submenu for gas consumption, show actual mix instead of GAS1-GAS5 in deco planner
heinrichsweikamp
parents: 275
diff changeset
824
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
825 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
826 ; return to Dive Settings Menu from Sub-Menu
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
827 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
828 do_return_menu_dive_deco:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
829 call menu_processor_double_pop ; drop exit line and back to last line
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
830 ;bra do_menu_dive_deco ; continue
0
heinrichsweikamp
parents:
diff changeset
831
heinrichsweikamp
parents:
diff changeset
832
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
833 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
834 ; Dive Settings Menu - 2nd Layer - Deco Mode
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
835 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
836 do_menu_dive_deco:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
837 MENU_BEGIN tDecoSetup, .6
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
838 MENU_OPT_INC tDkMode, oDecoMode ; ZH-L16 /GF
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
839 MENU_OPT_INC tSaturationMult, osatmultgf ; saturation
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
840 MENU_OPT_INC tDesaturationMult, odesatmultgf ; desaturation
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
841 MENU_OPT_INC tAltMode, oAltMode ; altitude mode
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
842 MENU_CALL tGFMenu, do_menu_dive_deco_GF ; GF settings
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
843 MENU_CALL tBack, do_return_menu_dive
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
0
heinrichsweikamp
parents:
diff changeset
846
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
847 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
848 ; Dive Settings Menu - 3nd Layer - Deco Mode - GF Settings
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
849 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
850 do_menu_dive_deco_GF:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
851 MENU_BEGIN tGFMenu, .6
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
852 MENU_OPT_INC tGF_low, oGF_low ; GF low
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
853 MENU_OPT_INC tGF_high, oGF_high ; GF high
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
854 MENU_OPT_INC taGFenable, oEnable_aGF ; aGF selectable
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
855 MENU_OPT_INC taGF_low, oaGF_low ; aGF low
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
856 MENU_OPT_INC taGF_high, oaGF_high ; aGF high
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
857 MENU_CALL tBack, do_return_menu_dive_deco
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
858 MENU_END
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
859
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
860
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
861 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
862 ; Dive Settings Menu - 2nd Layer - SAC Setup
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
863 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
864 do_menu_dive_SAC:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
865 IFDEF _gas_contingency
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
866 MENU_BEGIN tSACSetup, .6
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
867 MENU_OPT_INC tCalcGasNeeds, oCalcAscGas ; calc.gas
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
868 MENU_OPT_INC tGasContingencyDive, oGasContingencyDive ; switch tank if used up
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
869 MENU_OPT_INC tGasChangeTime, oGasChangeTime ; gas change time
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
870 MENU_OPT_INC tSetWorkSAC, oWork_SAC ; work SAC
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
871 MENU_OPT_INC tSetDecoSAC, oDeco_SAC ; deco SAC
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
872 MENU_CALL tBack, do_return_menu_dive
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
873 MENU_END
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
874 ELSE
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
875 MENU_BEGIN tSACSetup, .5
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
876 MENU_OPT_INC tCalcGasNeeds, oCalcAscGas ; calc.gas
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
877 MENU_OPT_INC tGasChangeTime, oGasChangeTime ; gas change time
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
878 MENU_OPT_INC tSetWorkSAC, oWork_SAC ; work SAC
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
879 MENU_OPT_INC tSetDecoSAC, oDeco_SAC ; deco SAC
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
880 MENU_CALL tBack, do_return_menu_dive
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
881 MENU_END
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
882 ENDIF
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
883
104
223579e905c3 Show a Safety Stop if enabled (Menu "Deco Parameters")
heinrichsweikamp
parents: 90
diff changeset
884
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
885 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
886 ; Dive Settings Menu - 2nd Layer - ppO2 Setup
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
887 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
888 do_menu_dive_ppO2:
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
889 IFDEF _ccr_pscr
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
890 IFDEF _helium
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
891 MENU_BEGIN tppO2Setup, .6
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
892 MENU_DYNAMIC dyn_ppo2_max, do_toggle_ppO2_max_work ; max work
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
893 MENU_DYNAMIC dyn_ppo2_max_deco, do_toggle_ppO2_max_deco ; max deco
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
894 MENU_DYNAMIC dyn_ppo2_min, do_toggle_ppO2_min ; min OC
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
895 MENU_DYNAMIC dyn_ppo2_min_cc, do_toggle_ppO2_min_cc ; min loop
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
896 MENU_OPT_INC tIBCDwarning, oEnable_IBCD ; IBCD warning
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
897 MENU_CALL tBack, do_return_menu_dive
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
898 MENU_END
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
899 ELSE
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
900 MENU_BEGIN tppO2Setup, .5
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
901 MENU_DYNAMIC dyn_ppo2_max, do_toggle_ppO2_max_work ; max work
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
902 MENU_DYNAMIC dyn_ppo2_max_deco, do_toggle_ppO2_max_deco ; max deco
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
903 MENU_DYNAMIC dyn_ppo2_min, do_toggle_ppO2_min ; min OC
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
904 MENU_DYNAMIC dyn_ppo2_min_cc, do_toggle_ppO2_min_cc ; min loop
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
905 MENU_CALL tBack, do_return_menu_dive
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
906 MENU_END
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
907 ENDIF ; _helium
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
908 ELSE
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
909 IFDEF _helium
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
910 MENU_BEGIN tppO2Setup, .5
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
911 MENU_DYNAMIC dyn_ppo2_max, do_toggle_ppO2_max_work ; max work
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
912 MENU_DYNAMIC dyn_ppo2_max_deco, do_toggle_ppO2_max_deco ; max deco
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
913 MENU_DYNAMIC dyn_ppo2_min, do_toggle_ppO2_min ; min OC
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
914 MENU_OPT_INC tIBCDwarning, oEnable_IBCD ; IBCD warning
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
915 MENU_CALL tBack, do_return_menu_dive
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
916 ELSE
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
917 MENU_BEGIN tppO2Setup, .4
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
918 MENU_DYNAMIC dyn_ppo2_max, do_toggle_ppO2_max_work ; max work
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
919 MENU_DYNAMIC dyn_ppo2_max_deco, do_toggle_ppO2_max_deco ; max deco
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
920 MENU_DYNAMIC dyn_ppo2_min, do_toggle_ppO2_min ; min OC
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
921 MENU_CALL tBack, do_return_menu_dive
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
922 MENU_END
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
923 ENDIF ; _helium
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
924 ENDIF ; _ccr_pscr
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
925
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
926
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
927 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
928 ; dynamic Title - show maximum ppO2 - Work
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
929 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
930 dyn_ppo2_max:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
931 STRCAT_TEXT tPPO2Max ; print text
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
932 movff char_I_ppO2_max_work,lo ; get value
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
933 movlw ppo2_warning_high_default ; load default
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
934 bra dyn_ppo2_common ; continue with common part
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
935
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
936
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
937 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
938 ; dynamic Title - show maximum ppO2 - Deco
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
939 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
940 dyn_ppo2_max_deco:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
941 STRCAT_TEXT tPPO2DECO ; print text
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
942 movff char_I_ppO2_max_deco,lo ; get value
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
943 movlw ppo2_warning_deco_default ; load default
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
944 bra dyn_ppo2_common ; continue with common part
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
945
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
946
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
947 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
948 ; dynamic Title - show minimum ppO2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
949 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
950 dyn_ppo2_min:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
951 STRCAT_TEXT tPPO2MIN ; print text
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
952 movff char_I_ppO2_min,lo ; get value
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
953 movlw ppo2_warning_low_default ; load default
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
954 bra dyn_ppo2_common ; continue with common part
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
955
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
956
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
957 IFDEF _ccr_pscr
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
958
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
959 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
960 ; dynamic Title - show minimum ppO2 - Loop Modes
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
961 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
962 dyn_ppo2_min_cc:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
963 STRCAT_TEXT tPPO2MINCC ; print text
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
964 movff char_I_ppO2_min_loop,lo ; get value
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
965 movlw ppo2_warning_loop_default ; load default
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
966 ;bra dyn_ppo2_common ; continue with common part
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
967
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
968 ENDIF
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
969
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
970
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
971 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
972 ; Helper Function to all show ppO2 dynamic Titles
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
973 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
974 dyn_ppo2_common:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
975 movwf up ; copy default to up
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
976 clrf hi ; clear hi
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
977 bsf leftbind ; print left-aligned
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
978 bsf decimal_digit2 ; place a decimal point in front of digit 2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
979 output_256 ; print ppO2 as x.xx
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
980 STRCAT_TEXT tbar ; append unit
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
981 movf up,W ; get default value into WREG
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
982 cpfseq lo ; current value = default value ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
983 bra divesets_ppo2_common2 ; NO - add an "*"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
984 return ; YES - done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
985 divesets_ppo2_common2:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
986 PUTC "*" ; append a star
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
987 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
988
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
989
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
990 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
991 ; Call Function - increment maximum ppO2 - Work
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
992 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
993 do_toggle_ppO2_max_work: ; add 0.1 bar
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
994 movff char_I_ppO2_max_work,lo ; bank-safe copy
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
995 movlw .10
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
996 addwf lo,F
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
997 movlw ppo2_warning_high_highest
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
998 cpfsgt lo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
999 bra do_toggle_ppo2_max2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1000 movlw ppo2_warning_high_lowest
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1001 movwf lo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1002 do_toggle_ppo2_max2:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1003 movff lo,char_I_ppO2_max_work
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1004 return
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1005
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1006
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1007 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1008 ; Call Function - increment maximum ppO2 - Deco
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1009 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1010 do_toggle_ppO2_max_deco: ; add 0.1 bar
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1011 movff char_I_ppO2_max_deco,lo ; bank-safe copy
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1012 movlw .10
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1013 addwf lo,F
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1014 movlw ppo2_warning_deco_highest
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1015 cpfsgt lo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1016 bra do_toggle_ppO2_max_deco2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1017 movlw ppo2_warning_deco_lowest
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1018 movwf lo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1019 do_toggle_ppO2_max_deco2:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1020 movff lo,char_I_ppO2_max_deco
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1021 return
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1022
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1023
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1024 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1025 ; Call Function - increment minimum ppO2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1026 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1027 do_toggle_ppO2_min: ; sub 0.1 bar
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1028 movff char_I_ppO2_min,lo ; bank-safe copy
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1029 incf lo,F
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1030 movlw ppo2_warning_low_highest
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1031 cpfsgt lo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1032 bra do_toggle_ppO2_min2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1033 movlw ppo2_warning_low_lowest
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1034 movwf lo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1035 do_toggle_ppO2_min2:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1036 movff lo,char_I_ppO2_min
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1037 return
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1038
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1039
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1040 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1041 ; Call Function - increment minimum ppO2 - Loop Modes
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1042 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1043 do_toggle_ppO2_min_cc: ; sub 0.1 bar
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1044 movff char_I_ppO2_min_loop,lo ; bank-safe copy
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1045 incf lo,F
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1046 movlw ppo2_warning_loop_highest
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1047 cpfsgt lo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1048 bra do_toggle_ppO2_min_cc2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1049 movlw ppo2_warning_loop_lowest
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1050 movwf lo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1051 do_toggle_ppO2_min_cc2:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1052 movff lo,char_I_ppO2_min_loop
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1053 return
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1054
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1055
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1056 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1057 ; Dive Settings Menu - 2nd Layer - Stops & Depth
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1058 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1059 do_menu_dive_stops:
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
1060 MENU_BEGIN tStopsSetup, .6
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1061 MENU_OPT_INC tSafetyStop, oSafetyStop ; safety stop
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1062 MENU_OPT_INC tExtendedStops, oExtendedStops ; extended stops
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1063 MENU_OPT_INC tLastDecostop, oLastDeco ; last deco stop
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1064 MENU_OPT_INC tDvSalinity, oDiveSalinity ; salinity
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1065 MENU_OPT_INC tDepthWarn, oMaxDepth ; depth limit
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1066 MENU_CALL tBack, do_return_menu_dive
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1067 MENU_END
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 545
diff changeset
1068
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 545
diff changeset
1069
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1070 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1071 ; return to Settings Menu from Sub-Sub-Menu
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1072 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1073 do_return_menu_settings_deeper: ; entry point for return from info menu 2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1074 call menu_processor_pop ; drop one more stack entry
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1075 ;bra do_return_menu_settings ; continue
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 545
diff changeset
1076
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 545
diff changeset
1077
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1078 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1079 ; return to Settings Menu from Sub-Menu
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1080 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1081 do_return_menu_settings:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
1082 bcf imprint_time_date ; stop imprinting of current time & date
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1083 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
1084
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
1085 IFDEF _rx_mode
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
1086 bcf tr_functions_activated ; set TR functions as deactivated by default
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
1087 btfss ostc_rx_present ; TR model / TR module up & running?
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1088 bra do_menu_settings ; NO - keep deactivated
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
1089 movff opt_TR_mode,WREG ; YES - get TR mode
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
1090 tstfsz WREG ; - TR mode <> off ?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
1091 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
1092 ENDIF
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1093
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1094
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1095 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1096 ; Settings Menu - 1st Layer
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1097 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1098 do_menu_settings:
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
1099 IFDEF _hwos_sport
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1100 bsf ble_available ; required for very old OSTC sport
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
1101 ENDIF
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1102 btfsc ble_available ; BT available?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1103 bra do_menu_settings_bt ; YES - do BT menu
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
1104
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
1105 MENU_BEGIN tSystSets, .5
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1106 MENU_CALL tInfoMenu, do_menu_info
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1107 MENU_CALL tSetTimeDate, do_menu_date_time
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1108 MENU_CALL tDispSets, do_menu_dispsets
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1109 MENU_CALL tSysSets, do_menu_syssets
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
1110 MENU_CALL tBack, do_return_main_menu
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1111 MENU_END
155
5f71e31bd5b3 CHANGE: Re-arranged Settings Menu, add 180? rotate to menu
heinrichsweikamp
parents: 154
diff changeset
1112
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1113 do_menu_settings_bt:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
1114 IFDEF _rx_functions
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
1115 btfss ostc_rx_present ; TR model and TR activated?
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1116 bra do_menu_settings_noRX ; NO
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
1117
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
1118 MENU_BEGIN tSystSets, .7
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1119 MENU_CALL tInfoMenu, do_menu_info
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1120 MENU_CALL tBleTitle, do_comm_mode_bt
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1121 MENU_CALL tTrSettings, do_menu_settings_TR
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1122 MENU_CALL tSetTimeDate, do_menu_date_time
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1123 MENU_CALL tDispSets, do_menu_dispsets
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1124 MENU_CALL tSysSets, do_menu_syssets
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
1125 MENU_CALL tBack, do_return_main_menu
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
1126 MENU_END
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
1127 ENDIF
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
1128
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1129 do_menu_settings_noRX:
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
1130 MENU_BEGIN tSystSets, .6
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1131 MENU_CALL tInfoMenu, do_menu_info
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1132 MENU_CALL tBleTitle, do_comm_mode_bt
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1133 MENU_CALL tSetTimeDate, do_menu_date_time
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1134 MENU_CALL tDispSets, do_menu_dispsets
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1135 MENU_CALL tSysSets, do_menu_syssets
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
1136 MENU_CALL tBack, do_return_main_menu
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
1137 MENU_END
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
1138
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
1139
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1140 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1141 ; Call Function - start Communication Mode (BT)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1142 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1143 do_comm_mode_bt:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1144 goto comm_mode_bt ; code hosted in comm.asm
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1145
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1146
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1147 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1148 ; Settings Menu - 2nd Layer - System Infos - Page 1
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1149 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1150 do_menu_info:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
1151 IFDEF _rx_functions
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
1152 btfss ostc_rx_present ; TR model?
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1153 bra do_menu_info_noRX ; NO
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
1154
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
1155 MENU_BEGIN tInfoMenu, .7
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1156 MENU_DYNAMIC dyn_show_uptime, 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1157 MENU_DYNAMIC dyn_show_serial, 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1158 MENU_DYNAMIC dyn_show_firmware_ostc, 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1159 MENU_DYNAMIC dyn_show_fw_creation_date, 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1160 MENU_DYNAMIC dyn_show_firmware_rx, 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1161 MENU_DYNAMIC dyn_show_total_dives, 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1162 MENU_CALL tMore, do_menu_info2
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1163 MENU_END
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
1164 ENDIF
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
1165
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1166 do_menu_info_noRX:
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
1167 MENU_BEGIN tInfoMenu, .6
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1168 MENU_DYNAMIC dyn_show_uptime, 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1169 MENU_DYNAMIC dyn_show_serial, 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1170 MENU_DYNAMIC dyn_show_firmware_ostc, 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1171 MENU_DYNAMIC dyn_show_fw_creation_date, 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1172 MENU_DYNAMIC dyn_show_total_dives, 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1173 MENU_CALL tMore, do_menu_info2
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
1174 MENU_END
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
1175
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1176
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1177 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1178 ; dynamic Title - show Uptime
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1179 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1180 dyn_show_uptime:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1181 STRCAT_TEXT tUptime ; print title
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1182 SMOVQQ uptime,xC ; ISR-safe copy of uptime:4 to xC:4
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1183 goto output_secs_as_days_hours ; print seconds as days and hours and return
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1184
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1185
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1186 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1187 ; dynamic Title - show Uptime
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1188 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1189 dyn_show_serial:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1190 STRCAT_TEXT tSerial ; print title
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1191 goto TFT_cat_serial ; print serial number and return
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1192
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1193 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1194 ; dynamic Title - show Firmware Version
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1195 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1196 dyn_show_firmware_ostc:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1197 STRCAT_TEXT tFirmware ; print title
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1198 call TFT_cat_firmware ; print firmware version
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1199 PUTC " " ; print a dot
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1200 goto TFT_cat_beta_short ; print beta/release state and return
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1201
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1202
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1203 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1204 ; dynamic Title - show Firmware creation Date
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1205 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1206 dyn_show_fw_creation_date:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1207 STRCAT_TEXT tFirmwareDate ; print title
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1208 movlw firmware_creation_year ; get firmware creation year
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1209 movwf lo ; copy to lo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1210 movlw firmware_creation_month ; get firmware creation month
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1211 movwf hi ; copy to hi
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1212 movlw firmware_creation_day ; get firmware creation day
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1213 movwf up ; copy to up
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1214 goto output_date ; print date and return
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
1215
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
1216
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
1217 IFDEF _rx_functions
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
1218
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1219 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1220 ; dynamic Title - show RX Firmware Version (also used by start.asm)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1221 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1222 global dyn_show_firmware_rx
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1223 dyn_show_firmware_rx:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1224 STRCAT_TEXT tFirmware_rx ; print title
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1225 movff rx_firmware_cur_major,lo ; get major version
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1226 bsf leftbind ; print left-aligned
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1227 output_99 ; print major (0-99)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1228 PUTC '.' ; print a dot
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1229 movff rx_firmware_cur_minor,lo ; get minor
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1230 output_99x ; print minor (00-99)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1231 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1232
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1233 ENDIF ; _rx_functions
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1234
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1235
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1236 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1237 ; dynamic Title - show total Number of Dives
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1238 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1239 dyn_show_total_dives:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1240 STRCAT_TEXT tTotalDives ; print title
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1241 call eeprom_total_dives_read ; read total number of dives
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1242 bsf leftbind ; print left-aligned
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1243 output_65535 ; print number of total dives (0-65535)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1244 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1245
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1246
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1247 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1248 ; Settings Menu - 2nd Layer - System Infos - Page 2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1249 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1250 do_menu_info2:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1251 IFNDEF _comm_debug
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1252 MENU_BEGIN tInfoMenu, .5
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1253 MENU_DYNAMIC dyn_show_battery_volts, 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1254 MENU_DYNAMIC dyn_show_config, 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1255 MENU_DYNAMIC dyn_show_sensor_calib, 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1256 MENU_DYNAMIC dyn_show_sensor_offset, 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1257 MENU_CALL tBack, do_return_menu_settings_deeper
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1258 MENU_END
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1259 ELSE
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1260 MENU_BEGIN tInfoMenu, .6
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1261 MENU_DYNAMIC dyn_show_battery_volts, 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1262 MENU_DYNAMIC dyn_show_config, 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1263 MENU_DYNAMIC dyn_show_sensor_calib, 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1264 MENU_DYNAMIC dyn_show_sensor_offset, 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1265 MENU_OPT_INC tCommTimeout, oCommTimeout
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1266 MENU_CALL tBack, do_return_menu_settings_deeper
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1267 MENU_END
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1268 ENDIF
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1269
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1270
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1271 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1272 ; dynamic Title - show Battery Volts and Type
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1273 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1274 dyn_show_battery_volts:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1275 STRCAT_TEXT tBatteryV ; print text
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1276 MOVII batt_voltage,mpr ; get battery voltage
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1277 bsf decimal_digit3 ; place a decimal point in front of digit 3
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1278 bsf omit_digit_1 ; do not print 1st digit
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1279 output_9999 ; print as x.yy-
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1280 STRCAT " V(T" ; append fix legend
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1281 movff battery_type,lo ; =0:1.5V, =1:3.6V Saft, =2:LiIon 3.7V/0.8Ah, =3:LiIon 3.7V/3.1Ah, =4: LiIon 3.7V/2.3Ah
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1282 output_9 ; print battery type code (0-9)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1283 PUTC ")" ; append fix legend
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1284 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1285
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1286
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1287 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1288 ; dynamic Title - show Hardware / Software Configuration
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1289 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1290 dyn_show_config:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1291 STRCAT_TEXT tHardware ; print text
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1292 call I2C_init_compass ; start compass to get compass configuration
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1293 movf HW_descriptor,W ; copy hardware descriptor to WREG
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1294 output_hex ; print as hex
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1295 movf HW_variants,W ; copy hardware variants to WREG
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1296 output_hex ; print as hex
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1297 PUTC "-" ; print a separator
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1298 movlw FW_CONF ; get firmware configuration
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1299 output_hex ; print as hex
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1300 call get_cpu_version ; get CPU version
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1301 output_hex ; print as hex
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1302 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1303
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1304
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1305 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1306 ; dynamic Title - show Pressure Sensor Calibration Data C1 and C5
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1307 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1308 dyn_show_sensor_calib:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1309 STRCAT_TEXT tSensorC ; print label
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1310 movff C1+1,WREG ; get C1, high byte
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1311 output_hex ; print C1, high byte
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1312 movff C1+0,WREG ; get C1, low byte
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1313 output_hex ; print C1, low byte
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1314 PUTC "-" ; print a separator
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1315 movff C5+1,WREG ; get C5, high byte
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1316 output_hex ; print C5, high byte
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1317 movff C5+0,WREG ; get C5, low byte
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1318 output_hex ; print C5, low byte
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1319 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1320
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1321
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1322 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1323 ; dynamic Title - show Pressure Sensor Offset Setting
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1324 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1325 dyn_show_sensor_offset:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1326 STRCAT_TEXT tSensorD ; print label
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1327 movff opt_pressure_adjust,lo ; get pressure sensor offset
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1328 movf lo,F ; excite flags
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1329 bz dyn_show_sensor_offset_zero ; sensor offset = 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1330 bn dyn_show_sensor_offset_neg ; sensor offset < 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1331 ;bnn dyn_show_sensor_offset_pos ; sensor offset > 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1332 dyn_show_sensor_offset_pos:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1333 PUTC "+" ; print plus sign
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1334 bra dyn_show_sensor_offset_com ; continue with common part
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1335 dyn_show_sensor_offset_zero:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1336 PUTC " " ; print a space
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1337 bra dyn_show_sensor_offset_com ; continue with common part
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1338 dyn_show_sensor_offset_neg:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1339 PUTC "-" ; print a minus sign
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1340 negf lo ; negate lo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1341 ;bra dyn_show_sensor_offset_com ; continue with common part
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1342 dyn_show_sensor_offset_com:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1343 PUTC " " ; print a space
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1344 bsf leftbind ; print left-aligned
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1345 output_99 ; print value (0-99)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1346 PUTC " " ; print a space
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1347 STRCAT_TEXT tMBAR ; print unit
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1348 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1349
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1350
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1351 IFDEF _rx_functions
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1352
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1353 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1354 ; Settings Menu - 2nd Layer - TR Settings
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1355 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1356 do_menu_settings_TR:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
1357 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
1358 incf WREG,W ; add 1
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
1359 dcfsnz WREG,W ; subtract one, became zero?
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1360 bra do_menu_settings_TR_MaxDelta; YES - OC
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1361 dcfsnz WREG,W ; subtract one, became zero?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1362 bra do_menu_settings_TR_BailPres; YES - CCR
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
1363 dcfsnz WREG,W ; subtract one, became zero?
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1364 bra do_menu_settings_TR_MaxDelta; YES - Gauge
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
1365 dcfsnz WREG,W ; subtract one, became zero?
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1366 bra do_menu_settings_TR_abort ; YES - Apnea, abort
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
1367 dcfsnz WREG,W ; subtract one, became zero?
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1368 bra do_menu_settings_TR_both ; YES - pSCR
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1369
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1370 do_menu_settings_TR_abort:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1371 call menu_processor_pop ; drop button press
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1372 bra do_menu_settings ; back to same menu
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
1373
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1374
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1375 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1376 ; Settings Menu - 3rd Layer - TR Settings - Sidemount Mode
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1377 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1378 do_menu_settings_TR_MaxDelta: ; menu with oTrMaxDeltaPres
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
1379 MENU_BEGIN tTrSettings, .5
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1380 MENU_OPT_INC tTrMode, oTrMode
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1381 MENU_OPT_INC tTr1stPres, oTr1stPres
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1382 MENU_OPT_INC tTr2ndPres, oTr2ndPres
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1383 MENU_DYNAMIC dyn_toggle_max_pres_diff, do_toggle_max_pres_diff
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1384 MENU_CALL tBack, do_return_menu_settings
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
1385 MENU_END
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
1386
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
1387
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1388 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1389 ; Settings Menu - 3rd Layer - TR Settings - CCR Mode
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1390 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1391 do_menu_settings_TR_BailPres: ; menu with oTrBailPres
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1392 MENU_BEGIN tTrSettings, .5
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1393 MENU_OPT_INC tTrMode, oTrMode
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1394 MENU_OPT_INC tTr1stPres, oTr1stPres
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1395 MENU_OPT_INC tTr2ndPres, oTr2ndPres
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1396 MENU_OPT_INC tTrBailPres, oTrBailPres
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1397 MENU_CALL tBack, do_return_menu_settings
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1398 MENU_END
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1399
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1400
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1401 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1402 ; Settings Menu - 3rd Layer - TR Settings - pSCR Mode
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1403 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1404 do_menu_settings_TR_both: ; menu with oTrBailPres and oTrMaxDeltaPres
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1405 MENU_BEGIN tTrSettings, .6
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1406 MENU_OPT_INC tTrMode, oTrMode
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1407 MENU_OPT_INC tTr1stPres, oTr1stPres
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1408 MENU_OPT_INC tTr2ndPres, oTr2ndPres
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1409 MENU_OPT_INC tTrBailPres, oTrBailPres
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1410 MENU_DYNAMIC dyn_toggle_max_pres_diff, do_toggle_max_pres_diff
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1411 MENU_CALL tBack, do_return_menu_settings
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1412 MENU_END
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1413
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1414
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1415 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1416 ; dynamic Title - max. Delta Pressure for Swap Tanks Advice
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1417 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1418 dyn_toggle_max_pres_diff:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1419 movff opt_TR_mode,WREG ; get TR mode
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1420 xorlw .2 ; compare with 2 (ind.double)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1421 tstfsz WREG ; equal?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1422 FONT_COLOR_DISABLED ; NO - print in disabled color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1423 STRCAT_TEXT tTrMaxDeltaP ; output label
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1424 movff char_I_max_pres_diff,lo ; get configured deltaP
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1425 output_99 ; print deltaP (0-99)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1426 STRCAT_TEXT tbar ; append " bar"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1427 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1428
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1429
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1430 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1431 ; Call Function - adjust max. Delta Pressure for Swap Tanks Advice
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1432 ;
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
1433 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
1434 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
1435 movlw .5 ; load increment
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
1436 addwf lo,F ; add increment
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
1437 movlw max_pres_diff_max ; load maximum value
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
1438 cpfsgt lo ; above maximum value?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
1439 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
1440 movlw max_pres_diff_min ; YES - load minimum value
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
1441 movwf lo ; - into lo
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
1442 do_toggle_max_pres_diff_1:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
1443 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
1444 return ; done
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
1445
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
1446 ENDIF ; _rx_functions
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1447
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1448
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1449 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1450 ; return to Settings Menu from Sub-Menu
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1451 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1452 do_return_menu_date_time:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1453 call menu_processor_double_pop ; drop exit line and back to last line
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1454
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1455
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1456 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1457 ; Settings Menu - 2nd Layer - set Time & Date
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1458 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1459 do_menu_date_time:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1460 bsf imprint_time_date ; start imprinting current time & date
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1461 bcf block_option_value ; resume displaying of option values
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1462
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1463 MENU_BEGIN tSetTimeDate, .4
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1464 MENU_CALL tSetTime, do_menu_set_time
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1465 MENU_CALL tSetDate, do_menu_set_date
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1466 MENU_OPT_INC tDateFormat, oDateFormat
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1467 MENU_CALL tBack, do_return_menu_settings
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1468 MENU_END
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1469
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1470
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1471 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1472 ; Settings Menu - 3rd Layer - set Time & Date - set Time
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1473 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1474 do_menu_set_time:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1475 bsf block_option_value ; suspend displaying of option values
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1476
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1477 MENU_BEGIN tSetTime, .4
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1478 MENU_OPT_INC tSetHours, oSetHours
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1479 MENU_OPT_INC tSetMinutes, oSetMinutes
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1480 MENU_OPT_INC tSetSeconds, oClearSeconds
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1481 MENU_CALL tBack, do_return_menu_date_time
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1482 MENU_END
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1483
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
1484
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1485 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1486 ; Settings Menu - 3rd Layer - set Time & Date - set Date
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1487 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1488 do_menu_set_date:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1489 bsf block_option_value ; suspend displaying of option values
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1490
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1491 MENU_BEGIN tSetDate, .4
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1492 MENU_OPT_INC tSetDay, oSetDay
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1493 MENU_OPT_INC tSetMonth, oSetMonth
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1494 MENU_OPT_INC tSetYear, oSetYear
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1495 MENU_CALL tBack, do_return_menu_date_time
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1496 MENU_END
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1497
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1498
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1499 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1500 ; return to Display Settings from Sub-Menu
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1501 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1502 do_return_dispsets_menu:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1503 bcf imprint_color_schemes ; deactivate color schemes demonstration
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1504 call menu_processor_double_pop ; drop exit line and back to last line
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1505 ;bra do_menu_dispsets ; continue
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1506
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1507
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1508 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1509 ; Settings Menu - 2nd Layer - Display Settings - Page 1
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1510 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1511 do_menu_dispsets:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1512 IF _language_2!=none
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1513 MENU_BEGIN tDispSets, .7
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1514 MENU_OPT_INC tBright, oBrightness
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1515 MENU_OPT_INC tLayout, oLayout
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1516 MENU_OPT_INC tUnits, oUnits
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1517 MENU_OPT_INC tLanguage, oLanguage
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1518 MENU_OPT_INC tFlip, oFlipScreen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1519 MENU_CALL tColorScheme, do_menu_color_scheme
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1520 MENU_CALL tMore, do_menu_dispsets_more
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1521 MENU_END
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
1522 ELSE
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1523 MENU_BEGIN tDispSets, .6
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1524 MENU_OPT_INC tBright, oBrightness
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1525 MENU_OPT_INC tLayout, oLayout
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1526 MENU_OPT_INC tUnits, oUnits
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1527 MENU_OPT_INC tFlip, oFlipScreen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1528 MENU_CALL tColorScheme, do_menu_color_scheme
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1529 MENU_CALL tMore, do_menu_dispsets_more
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
1530 MENU_END
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1531 ENDIF
220
effd7259f5a5 make button sensitivity configurable (cR hardware)
heinrichsweikamp
parents: 218
diff changeset
1532
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1533
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1534 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1535 ; Settings Menu - 3rd Layer - Display Settings - Color Schemes
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1536 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1537 do_menu_color_scheme:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1538 bsf imprint_color_schemes ; activate color schemes demonstration
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1539
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1540 ; menu with 4 leading empty menu lines to give space for the color scheme imprinting
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1541 MENU_BEGIN_OFFSET tColorScheme, .2, .4
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1542 MENU_OPT_INC tColorSetDive, oColorSetDive
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1543 MENU_CALL tBack, do_return_dispsets_menu
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1544 MENU_END
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1545
524
d2e52e6e1604 menu work
heinrichsweikamp
parents: 523
diff changeset
1546
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1547 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1548 ; Settings Menu - 2nd Layer - Display Settings - Page 2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1549 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1550 do_menu_dispsets_more:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1551 IFDEF _helium
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1552 MENU_BEGIN tDispSets, .7
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1553 MENU_OPT_INC tVSIgraph, oVSIgraph
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1554 MENU_OPT_INC tVSItext2, oVSItext
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1555 MENU_OPT_INC tShowppO2, oShowppO2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1556 MENU_OPT_INC tDepthWarning, oDepthWarn
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1557 MENU_OPT_INC t2ndDepth, o2ndDepthDisp
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1558 MENU_OPT_INC tTissueGraphics, oTissueGraphics
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1559 MENU_CALL tBack, do_return_menu_settings_deeper
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1560 MENU_END
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
1561 ELSE
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1562 MENU_BEGIN tDispSets, .6
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1563 MENU_OPT_INC tVSIgraph, oVSIgraph
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1564 MENU_OPT_INC tVSItext2, oVSItext
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1565 MENU_OPT_INC tShowppO2, oShowppO2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1566 MENU_OPT_INC tDepthWarning, oDepthWarn
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1567 MENU_OPT_INC t2ndDepth, o2ndDepthDisp
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1568 MENU_CALL tBack, do_return_menu_settings_deeper
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1569 MENU_END
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
1570 ENDIF
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1571
243
ee81f46714cb auto-select correct settings menu
heinrichsweikamp
parents: 240
diff changeset
1572
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1573 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1574 ; return to System Settings Menu from Sub-Sub-Menu
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1575 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1576 do_return_menu_syssets_more_more: ; entry point for returns from reset sub-menu
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1577 call menu_processor_pop ; drop one more stack entry
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1578 ;bra do_return_menu_syssets_more ; continue
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1579
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1580
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1581 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1582 ; return to System Settings Menu from Sub-Menu
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1583 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1584 do_return_menu_syssets_more:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1585 call menu_processor_double_pop ; drop exit line and back to last line
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1586 bra do_menu_syssets ; continue
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1587
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1588
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1589 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1590 ; return to System Settings Menu from Piezo-Sub-Menu
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1591 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1592 do_return_menu_syssets_piezo:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1593 call menu_processor_double_pop ; drop exit line and back to last line
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1594 call TFT_ClearScreen ; clear the screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1595 call piezo_config ; configure buttons
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1596 ;bra do_menu_syssets ; continue
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1597
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1598
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1599 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1600 ; Settings Menu - 2nd Layer - System Settings
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1601 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1602 do_menu_syssets:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1603 btfsc battery_gauge_available ; piezo buttons available?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1604 bra do_menu_syssets_piezo ; YES
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1605
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1606 IFDEF _compass
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1607 MENU_BEGIN tSystSets, .4 ; All MENU_CALLs in this menu
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1608 MENU_CALL tCompassMenu, do_menu_compass ; need to stay together on this
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1609 MENU_CALL tLogOffset, do_menu_log_offset ; menu level in order to not
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1610 MENU_CALL tResetMenu, do_menu_reset ; mess up the menu stack on doing
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1611 MENU_CALL tBack, do_return_menu_settings ; the do_return_menu_settings !
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1612 MENU_END
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1613 ELSE
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1614 MENU_BEGIN tSystSets, .3 ; see above
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1615 MENU_CALL tLogOffset, do_menu_log_offset ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1616 MENU_CALL tResetMenu, do_menu_reset ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1617 MENU_CALL tBack, do_return_menu_settings ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1618 MENU_END
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1619 ENDIF ; _compass
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1620
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1621 do_menu_syssets_piezo:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1622 IFDEF _compass
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1623 MENU_BEGIN tSystSets, .5
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1624 MENU_CALL tCompassMenu, do_menu_compass ; see above
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1625 MENU_CALL tLogOffset, do_menu_log_offset ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1626 MENU_CALL tResetMenu, do_menu_reset ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1627 MENU_CALL tPiezo, do_menu_piezo ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1628 MENU_CALL tBack, do_return_menu_settings ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1629 MENU_END
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1630 ELSE
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1631 MENU_BEGIN tSystSets, .4
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1632 MENU_CALL tLogOffset, do_menu_log_offset ; see above
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1633 MENU_CALL tResetMenu, do_menu_reset ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1634 MENU_CALL tPiezo, do_menu_piezo ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1635 MENU_CALL tBack, do_return_menu_settings ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1636 MENU_END
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1637 ENDIF
220
effd7259f5a5 make button sensitivity configurable (cR hardware)
heinrichsweikamp
parents: 218
diff changeset
1638
effd7259f5a5 make button sensitivity configurable (cR hardware)
heinrichsweikamp
parents: 218
diff changeset
1639
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
1640 IFDEF _compass
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
1641
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1642 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1643 ; Settings Menu - 3rd Layer - System Settings - Compass
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1644 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1645 do_menu_compass:
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
1646 MENU_BEGIN tCompassMenu, .5
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1647 MENU_CALL tCompassCalibration, do_compass_calibration
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1648 ; MENU_OPT_INC tCompassGain, oCompassGain
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1649 MENU_DYNAMIC dyn_compass_cal_x, 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1650 MENU_DYNAMIC dyn_compass_cal_y, 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1651 MENU_DYNAMIC dyn_compass_cal_z, 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1652 MENU_CALL tBack, do_return_menu_syssets_more
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1653 MENU_END
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1654
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1655
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1656 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1657 ; Call Function - start Compass Calibration
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1658 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1659 do_compass_calibration:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1660 goto compass_calibration ; code hosted in compass_ops.asm
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1661
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1662
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1663 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1664 ; dynamic Title - Calibration Value X
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1665 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1666 dyn_compass_cal_x:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1667 STRCAT_TEXT tCalX ; print label
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1668 lfsr FSR0,compass_CX_f ; address calibration value X
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1669 bra dyn_compass_cal_common ; continue with common part
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1670
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1671
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1672 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1673 ; dynamic Title - Calibration Value Y
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1674 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1675 dyn_compass_cal_y:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1676 STRCAT_TEXT tCalY ; print label
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1677 lfsr FSR0,compass_CY_f ; address calibration value Y
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1678 bra dyn_compass_cal_common ; continue with common part
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1679
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1680
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1681 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1682 ; dynamic Title - Calibration Value Z
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1683 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1684 dyn_compass_cal_z:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1685 STRCAT_TEXT tCalZ ; print label
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1686 lfsr FSR0,compass_CZ_f ; address calibration value Z
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1687 ;bra dyn_compass_cal_common ; continue with common part
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1688
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1689
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1690 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1691 ; Helper Function to dynamic Titles - Calibration Value
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1692 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1693 dyn_compass_cal_common:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1694 movff POSTINC0,lo ; read calibration value, low byte
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1695 movff POSTINC0,hi ; read calibration value, high byte
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1696 PUTC ':' ; print ":"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1697 PUTC ' ' ; print a space
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1698 call convert_signed_16bit ; convert lo:hi into signed-short and adds '-' to POSTINC2 if required
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1699 btfsc neg_flag ; value negative?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1700 bra dyn_compass_cal_common_1 ; YES - print value
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1701 PUTC '+' ; NO - add a plus sign
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1702 dyn_compass_cal_common_1:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1703 output_65535 ; print value
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1704 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1705
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
1706 ENDIF ; _compass
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
1707
18
4e3f133dfbf4 add new opt_compass_gain option to work with more magnetic battery types
heinrichsweikamp
parents: 0
diff changeset
1708
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1709 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1710 ; Settings Menu - 3rd Layer - System Settings - Logbook Offset
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1711 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1712 do_menu_log_offset:
63
5c4d4a42e7a0 allow logbook erase from reset menu
heinrichsweikamp
parents: 50
diff changeset
1713
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1714 clrf WREG ; select an initial step size of 1
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1715 movff WREG,opt_logoffset_step ; bank-safe write to option variable (volatile option)
0
heinrichsweikamp
parents:
diff changeset
1716
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1717 MENU_BEGIN tLogOffset, .5
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1718 MENU_DYNAMIC dyn_logoffset_show_value, 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1719 MENU_OPT_INC tLogOffStepSize, oLogOffsetStep
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1720 MENU_CALL tLogOffsetplus, do_log_offset_plus
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1721 MENU_CALL tLogOffsetminus, do_log_offset_minus
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1722 MENU_CALL tBack, do_return_menu_syssets_more
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1723 MENU_END
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1724
0
heinrichsweikamp
parents:
diff changeset
1725
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1726 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1727 ; dynamic Title - show Logbook Offset
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1728 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1729 dyn_logoffset_show_value:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1730 STRCPY_TEXT tLogOffsetValue ; print "Offset" in selected language
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1731 call eeprom_log_offset_read ; read offset into lo:hi
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1732 output_9999 ; print offset (0-9999)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1733 return ; no "_PRINT" here...
0
heinrichsweikamp
parents:
diff changeset
1734
heinrichsweikamp
parents:
diff changeset
1735
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1736 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1737 ; Call Function - increment Logbook Offset
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1738 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1739 do_log_offset_plus:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1740 rcall do_logoffset_common ; load current offset and step size
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1741 ; add step size to current offset
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1742 movf mpr+2,W ; get step size, low byte
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1743 addwf mpr+0,F ; add to offset, low byte
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1744 movf mpr+3,W ; get step size, high byte
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1745 addwfc mpr+1,F ; add to offset, high byte, considering carry flag
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1746 ; check if new offset is within limit
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1747 MOVLI .9999,sub_a ; load max limit into sub_a
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1748 MOVII mpr, sub_b ; copy new offset into sub_b
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1749 call cmpU16 ; compute sub_a - sub_b, setting neg_flag if result becomes negative
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1750 btfss neg_flag ; neg_flag set, i.e. new offset > 9999 ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1751 bra do_logoffset_exit ; NO - store offset and return
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1752 MOVLI .9999,mpr ; YES - limit offset to 9999
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1753 bra do_logoffset_exit ; - store offset and return
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1754
0
heinrichsweikamp
parents:
diff changeset
1755
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1756 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1757 ; Call Function - decrement Logbook Offset
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1758 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1759 do_log_offset_minus:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1760 rcall do_logoffset_common ; load current offset and step size
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1761 ; subtract step size from current offset
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1762 movf mpr+2,W ; get step size, low byte
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1763 subwf mpr+0,F ; subtract from offset, low byte
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1764 movf mpr+3,W ; get step size, high byte
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1765 subwfb mpr+1,F ; subtract from offset, high byte, considering borrow flag
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1766 ; check if new offset is within limit
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1767 btfsc STATUS,C ; borrow to propagate (B == /CARRY) ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1768 bra do_logoffset_exit ; NO - result >= 0, store and return
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1769 ;bra do_logoffset_reset ; YES - revert offset to 0
0
heinrichsweikamp
parents:
diff changeset
1770
heinrichsweikamp
parents:
diff changeset
1771
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1772 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1773 ; Helper Functions - Logbook Offset Reset & Write-Back
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1774 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1775 do_logoffset_reset:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1776 CLRI mpr ; set offset to 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1777 do_logoffset_exit:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1778 goto eeprom_log_offset_write ; store offset and return
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1779
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1780
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1781 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1782 ; Helper Function - compute Step Size
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1783 ;
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
1784 do_logoffset_common:
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
1785 call eeprom_log_offset_read ; read current offset into mpr+1:mpr+0
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
1786 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
1787 incf ul,F ; 0...3 -> 1...4
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
1788 clrf mpr+3 ; clear step size, high byte
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
1789 movlw .1 ; set a step size of 1
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
1790 movwf mpr+2 ; copy to step size, low byte
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
1791 dcfsnz ul,F ; ul--, did ul became 0, i.e. step size = 1 ?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
1792 return ; YES - done
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
1793 movlw .10 ; NO - set a step size of 10
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
1794 movwf mpr+2 ; - copy to step size, low byte
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
1795 dcfsnz ul,F ; ul--, did ul became 0, i.e. step size = 10 ?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
1796 return ; YES - done
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
1797 movlw .100 ; NO - set a step size of 100
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
1798 movwf mpr+2 ; - copy to step size, low byte
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
1799 dcfsnz ul,F ; ul--, did ul became 0, i.e. step size = 100 ?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
1800 return ; YES - done
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1801 movlw LOW .1000 ; NO - set a step size of 1000, low byte
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1802 movwf mpr+2 ; - copy to step size, low byte
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
1803 movlw HIGH .1000 ; - set a step size of 1000, high byte
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
1804 movwf mpr+3 ; - copy to step size, high byte
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
1805 return ; - done
0
heinrichsweikamp
parents:
diff changeset
1806
heinrichsweikamp
parents:
diff changeset
1807
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1808 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1809 ; Settings Menu - 3rd Layer - System Settings - adjust Piezo Buttons
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1810 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1811 do_menu_piezo:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1812 MENU_BEGIN tPiezo, .3
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1813 MENU_OPT_INC tButtonleft, ocR_button_left ; left button sensitivity
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1814 MENU_OPT_INC tButtonright, ocR_button_right ; right button sensitivity
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1815 MENU_CALL tBack, do_return_menu_syssets_piezo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1816 MENU_END
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
1817
0
heinrichsweikamp
parents:
diff changeset
1818
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1819 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1820 ; Settings Menu - 3rd Layer - System Settings - Reset Menus
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1821 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1822 do_menu_reset:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1823 MENU_BEGIN tResetMenu, .6
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1824 MENU_CALL tBack, do_return_menu_syssets_more
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1825 MENU_CALL tReboot, do_menu_reset_reboot ; confirm
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1826 MENU_CALL tResetDeco, do_menu_reset_deco ; confirm
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1827 MENU_CALL tResetSettings, do_menu_reset_settings ; confirm
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1828 MENU_CALL tResetLogbook, do_menu_reset_logbook ; confirm
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1829 MENU_CALL tResetBattery, do_menu_reset_battery ; confirm
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1830 MENU_END
0
heinrichsweikamp
parents:
diff changeset
1831
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1832
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1833 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1834 ; Settings Menu - 4th Layer - System Settings - Reset - Reboot / FW Recovery
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1835 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1836 do_menu_reset_reboot:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1837 IFDEF _firmware_recovery
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1838 MENU_BEGIN tResetMenu2, .4
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1839 MENU_CALL tAbort, do_return_menu_syssets_more_more
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1840 MENU_CALL tRebootCurFirmware, do_reboot ; reboot current firmware
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1841 MENU_DYNAMIC dyn_menu_fw_backup, do_firmware_backup ; backup current firmware
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1842 MENU_DYNAMIC dyn_menu_fw_restore, do_firmware_restore ; restore backup firmware
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1843 MENU_END
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
1844 ELSE
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1845 MENU_BEGIN tResetMenu2, .2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1846 MENU_CALL tAbort, do_return_menu_syssets_more_more
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1847 MENU_CALL tReboot, do_reboot ; reboot (cold start)
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
1848 MENU_END
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
1849 ENDIF
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1850
335
3d43da7acfe1 Always show ppO2 (warning position, standard color) option
janos_kovacs <kovjanos@gmail.com>
parents: 333
diff changeset
1851
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1852 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1853 ; Call Function - Reboot
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1854 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1855 do_reboot:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1856 call ext_flash_enable_protection ; set write protection on external flash
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1857 call eeprom_deco_data_write ; update deco data in EEPROM
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1858 call eeprom_battery_gauge_write ; update battery gauge in EEPROM
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1859 btfsc option_changed ; do the options need to be stored to EEPROM ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1860 call option_check_and_store_all ; YES - check and store all option values in EEPROM
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1861 reset ; cold-start the processor
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1862
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1863
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1864 IFDEF _firmware_recovery
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1865
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1866 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1867 ; dynamic Title - Firmware Backup Option
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1868 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1869 dyn_menu_fw_backup:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1870 EEPROM_CC_READ eeprom_fw_chksum_current+.5,WREG ; read stored FW ID
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1871 xorlw FW_ID ; XOR with current FW ID, equal?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1872 bnz dyn_menu_fw_backup_unable ; NO - unable to make a backup
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1873 STRCPY_TEXT tBackupFirmware ; YES - print "Backup current Firmware"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1874 return ; - done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1875 dyn_menu_fw_backup_unable:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1876 STRCPY "-------" ; print dashes
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1877 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1878
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1879
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1880 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1881 ; dynamic Title - Firmware Restore Option
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1882 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1883 dyn_menu_fw_restore:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1884 STRCPY_TEXT tRecoverFirmware ; print "Recover"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1885 PUTC " " ; add a space
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1886 PUTC "V" ; add a V for Version
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1887 movlw 0x3C ; address firmware version in backup storage at 0x3C000A
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1888 movwf ext_flash_address+2 ; ...
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1889 clrf ext_flash_address+1 ; ...
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1890 movlw 0x0A ; ...
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1891 movwf ext_flash_address+0 ; ...
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1892 FLASH_RR_READ mpr,.3 ; read backup firmware version (lo: major, hi: minor, up: beta)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1893 infsnz lo,W ; major = 0xFF ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1894 bra dyn_menu_fw_restore_inop ; YES - no version to show
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1895 bsf leftbind ; NO - print left-aligned
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1896 output_99 ; - print major (0-99)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1897 PUTC '.' ; - add a dot
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1898 movff hi,lo ; - get minor
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1899 output_99x ; - print minor (00-99)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1900 PUTC ' ' ; - add a space
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1901 movff up,lo ; - get beta/release
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1902 tstfsz lo ; - release version?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1903 bra dyn_menu_fw_restore_beta ; - NO - beta
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1904 STRCAT "Rel." ; - YES - append "Rel(ease)"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1905 return ; - done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1906 dyn_menu_fw_restore_beta:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1907 PUTC 'B' ; append "B(eta)"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1908 bsf leftbind ; print left-aligned
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1909 output_256 ; print beta version (0-255)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1910 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1911 dyn_menu_fw_restore_inop:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1912 STRCAT "--.--" ; no recovery firmware available
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1913 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1914
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1915
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1916 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1917 ; Call Function - backup Firmware
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1918 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1919 do_firmware_backup:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1920 EEPROM_CC_READ eeprom_fw_chksum_current+.5,WREG ; read stored FW ID
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1921 xorlw FW_ID ; XOR with current FW ID, equal?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1922 bnz do_firmware_abort ; NO - abort
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1923 call TFT_ClearScreen ; YES - clear the screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1924 WIN_SMALL .0, .100 ; - set position
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1925 STRCPY_TEXT_PRINT tBackingUp ; - print "backing up..."
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1926 call copy_fw_active_to_backup ; - copy 0x3Exxxx -> 0x3Cxxxx
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1927 EEPROM_RR_READ eeprom_fw_chksum_current,buffer,.6 ; - retrieve checksum of current firmware
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1928 EEPROM_RR_WRITE buffer,eeprom_fw_chksum_recovry,.6 ; - store as checksum of recovery firmware
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1929 bra do_return_menu_syssets_more_more ; - done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1930
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1931
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1932 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1933 ; Call Function - restore Firmware
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1934 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1935 do_firmware_restore:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1936 EXT_FLASH_ADDR 0x3C000A ; address firmware version in backup storage at 0x3C000A
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1937 FLASH_CW_READ_0x40 ; read backup firmware major version into WREG
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1938 infsnz WREG ; major = 0xFF ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1939 bra do_firmware_abort ; YES - abort, no firmware available for restoration
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1940 call TFT_ClearScreen ; NO - clear the screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1941 WIN_SMALL .0, .100 ; - set position
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1942 STRCPY_TEXT_PRINT tRestoring ; - print "restoring..."
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1943 call copy_fw_backup_to_active ; - copy 0x3Cxxxx -> 0x3Exxxx
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1944 EEPROM_RR_READ eeprom_fw_chksum_recovry,buffer,.6 ; - retrieve checksum of recovery firmware
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1945 EEPROM_RR_WRITE buffer,eeprom_fw_chksum_current,.6 ; - store as checksum of current firmware (to be)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1946 goto comm_firmware_update_exec ; - initiate firmware update
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1947
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1948
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1949 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1950 ; Helper Function - back to same menu
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1951 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1952 do_firmware_abort:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1953 call menu_processor_pop ; back to last line
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1954 bra do_menu_reset_reboot ; back to same menu
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1955
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
1956 ENDIF
0
heinrichsweikamp
parents:
diff changeset
1957
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1958
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1959 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1960 ; Settings Menu - 4th Layer - System Settings - Reset - Reset Deco
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1961 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1962 do_menu_reset_deco:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1963 MENU_BEGIN tResetMenu2, .2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1964 MENU_CALL tAbort, do_return_menu_syssets_more_more
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1965 MENU_CALL tResetDeco, do_reset_deco ; reset deco and return to main reset menu
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1966 MENU_END
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1967
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1968
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1969 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1970 ; Call Function - Reset Deco
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1971 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1972 do_reset_deco:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1973 call deco_clear_tissue ; set all tissues to absolute pressure * N2_ratio (C-code)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1974 call deco_calc_dive_interval_1min; update tissues by 1 minute to calculate current GF factor (C-code)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1975 call deco_calc_desaturation_time ; calculate desaturation and no-fly/no-altitude time (C-code)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1976 banksel common
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1977 call eeprom_deco_data_write ; store updated deco data into EEPROM
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1978 bra do_return_menu_syssets_more_more
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1979
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1980
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1981 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1982 ; Settings Menu - 4th Layer - System Settings - Reset - Reset Settings
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1983 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1984 do_menu_reset_settings:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1985 MENU_BEGIN tResetMenu2, .2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1986 MENU_CALL tAbort, do_return_menu_syssets_more_more
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1987 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
1988 MENU_END
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 39
diff changeset
1989
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 39
diff changeset
1990
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1991 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1992 ; Call Function - Reset Settings
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1993 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1994 do_reset_settings:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1995 call TFT_ClearScreen ; clear screen to show start of activity
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1996 call option_reset_all ; reset all options to factory default
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1997 call do_logoffset_reset ; reset log offset
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1998 goto restart ; restart into surface mode
0
heinrichsweikamp
parents:
diff changeset
1999
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2000
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2001 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2002 ; Settings Menu - 4th Layer - System Settings - Reset - Reset Logbook
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2003 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2004 do_menu_reset_logbook:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2005 MENU_BEGIN tResetMenu2, .2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2006 MENU_CALL tAbort, do_return_menu_syssets_more_more
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2007 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
2008 MENU_END
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
2009
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2010
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2011 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2012 ; Call Function - Reset Logbook
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2013 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2014 do_reset_logbook:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2015 call erase_complete_logbook ; erase complete logbook
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2016 bra do_return_menu_syssets_more_more
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2017
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2018
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2019 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2020 ; Settings Menu - 4th Layer - System Settings - Reset - Reset Battery
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2021 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2022 do_menu_reset_battery:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2023 MENU_BEGIN tNewBattTitle, .2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2024 MENU_CALL tAbort, do_return_menu_syssets_more_more
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2025 MENU_CALL tYes, do_new_battery_select
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2026 MENU_END
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2027
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2028
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2029 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2030 ; Entry Point for Battery Selection after Power-Outage
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2031 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2032 global new_battery_select
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2033 new_battery_select:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2034 call TFT_boot ; initialize TFT (includes clear screen)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2035 call TFT_Display_FadeIn ; dim up the display
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2036 call menu_processor_reset ; reset menu stack
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2037 ;bra do_new_battery_select ; enter menu system
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2038
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2039
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2040 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2041 ; Settings Menu - 5th Layer - System Settings - Reset - Reset - Battery Selection
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2042 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2043 do_new_battery_select:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2044 movlw .100 ; set battery level to full
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2045 movwf batt_percent ; ...
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2046 ; default (in cases of timeout or USB) to use old battery:
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
2047 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
2048
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
2049 IFDEF _screendump
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2050 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
2051 ELSE
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2052 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
2053 ENDIF
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
2054
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2055 ; hardware descriptor: user changeable battery charger supported battery types
614
a32212cd5ea9 work on new battery menu
heinrichsweikamp
parents: 609
diff changeset
2056 ; -------------------------------------------------------------------------------------------------------------------------------------------------------
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2057 ; 0x11: BLE and battery gauge ---> OSTC 2 (old model) NO YES internal 18650
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2058 ; 0x05: analog input and battery gauge ---> OSTC 2 cR NO YES internal 18650
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2059 ; 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
2060 ; 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
2061 ; +-> OSTC Plus YES YES 1.5V ----- NO! ----- 3.6V rechargeable
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2062 ; 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
2063 ; 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
2064 ; 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
2065 ; 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
2066
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2067 movlw 0x11 ; OSTC 2 (old model)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2068 cpfseq HW_descriptor
614
a32212cd5ea9 work on new battery menu
heinrichsweikamp
parents: 609
diff changeset
2069 bra $+4
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2070 bra use_18650_battery
614
a32212cd5ea9 work on new battery menu
heinrichsweikamp
parents: 609
diff changeset
2071
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2072 movlw 0x05 ; OSTC 2 cR
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2073 cpfseq HW_descriptor
614
a32212cd5ea9 work on new battery menu
heinrichsweikamp
parents: 609
diff changeset
2074 bra $+4
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2075 bra use_18650_battery
76
a5ea132770db 1.21 release
heinrichsweikamp
parents: 66
diff changeset
2076
614
a32212cd5ea9 work on new battery menu
heinrichsweikamp
parents: 609
diff changeset
2077 movlw 0x33 ; OSTC 2 TR
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2078 cpfseq HW_descriptor
614
a32212cd5ea9 work on new battery menu
heinrichsweikamp
parents: 609
diff changeset
2079 bra $+4
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2080 bra do_use_16650_battery
614
a32212cd5ea9 work on new battery menu
heinrichsweikamp
parents: 609
diff changeset
2081
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2082 ; movlw 0xXX ; OSTC 2 (new model) TODO: define signature
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2083 ; cpfseq HW_descriptor
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2084 ; bra $+4
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2085 ; bra do_use_16650_battery
614
a32212cd5ea9 work on new battery menu
heinrichsweikamp
parents: 609
diff changeset
2086
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2087 movlw 0x13 ; OSTC Plus TODO: and OSTC 2 new model as of now
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2088 cpfseq HW_descriptor
614
a32212cd5ea9 work on new battery menu
heinrichsweikamp
parents: 609
diff changeset
2089 bra $+4
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2090 bra do_menu_new_battery_AA_charger
614
a32212cd5ea9 work on new battery menu
heinrichsweikamp
parents: 609
diff changeset
2091
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2092 ; movlw 0x0A ; OSTC 3 (USB model)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2093 ; cpfseq HW_descriptor
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2094 ; bra $+4
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2095 ; bra do_menu_new_battery_AA_no_charge
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2096
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2097 ; movlw 0x1A ; OSTC 3 (BLE model)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2098 ; cpfseq HW_descriptor
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2099 ; bra $+4
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2100 ; bra do_menu_new_battery_AA_no_charge
614
a32212cd5ea9 work on new battery menu
heinrichsweikamp
parents: 609
diff changeset
2101
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2102 ; movlw 0x02 ; OSTC Sport (USB model)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2103 ; cpfseq HW_descriptor
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2104 ; bra $+4
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2105 ; bra do_menu_new_battery_AA_no_charge
614
a32212cd5ea9 work on new battery menu
heinrichsweikamp
parents: 609
diff changeset
2106
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2107 ; movlw 0x52 ; OSTC Sport (BLE model)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2108 ; cpfseq HW_descriptor
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2109 ; bra $+4
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2110 ; bra do_menu_new_battery_AA_no_charge
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2111
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2112 bra do_menu_new_battery_AA_no_charge ; any other model
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
2113
614
a32212cd5ea9 work on new battery menu
heinrichsweikamp
parents: 609
diff changeset
2114
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2115 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2116 ; return from confirm 3.6 V rechargeable
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2117 ;
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2118 do_return_menu_new_bat_AA_chrg:
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2119 call menu_processor_double_pop ; drop exit line and back to last line
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2120 ;bra do_menu_new_battery_AA_charger ; continue
614
a32212cd5ea9 work on new battery menu
heinrichsweikamp
parents: 609
diff changeset
2121
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2122 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2123 ; Battery Selection for OSTC Plus (charging function) TODO: and OSTC 2 new model as of now
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2124 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2125 do_menu_new_battery_AA_charger:
614
a32212cd5ea9 work on new battery menu
heinrichsweikamp
parents: 609
diff changeset
2126 MENU_BEGIN tNewBattTitle, .4
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2127 MENU_CALL tNewBattOld, do_use_old_battery ; load data of old battery
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2128 MENU_CALL tNewBattNew15, do_use_15V_disposable ; not rechargeable
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2129 ; MENU_CALL tNewBattNew36, do_use_36V_disposable ; not rechargeable -> not allowed any more !!!
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2130 MENU_CALL tNewBattAccu, do_menu_new_battery_36V_charge ; rechargeable -> goto safety question
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2131 MENU_CALL tNew16650, do_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
2132 MENU_END
a32212cd5ea9 work on new battery menu
heinrichsweikamp
parents: 609
diff changeset
2133
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2134
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2135 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2136 ; Safety Question for 3.6 V rechargeable Battery
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2137 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2138 do_menu_new_battery_36V_charge:
614
a32212cd5ea9 work on new battery menu
heinrichsweikamp
parents: 609
diff changeset
2139 MENU_BEGIN tNewBattTitle, .5
a32212cd5ea9 work on new battery menu
heinrichsweikamp
parents: 609
diff changeset
2140 MENU_CALL tConfirmChargeable1, 0 ; safety question, line 1
a32212cd5ea9 work on new battery menu
heinrichsweikamp
parents: 609
diff changeset
2141 MENU_CALL tConfirmChargeable2, 0 ; safety question, line 2
a32212cd5ea9 work on new battery menu
heinrichsweikamp
parents: 609
diff changeset
2142 MENU_CALL tConfirmChargeable3, 0 ; safety question, line 3
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2143 MENU_CALL tNo, do_return_menu_new_bat_AA_chrg ; NO - go back
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2144 MENU_CALL tYes, do_use_36V_chargeable ; YES - confirmed rechargeable
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2145 MENU_END
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2146
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2147
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2148 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2149 ; Battery Selection for OSTC 3 and Sport (no charging function)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2150 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2151 do_menu_new_battery_AA_no_charge:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2152 MENU_BEGIN tNewBattTitle, .4
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2153 MENU_CALL tNewBattOld, do_use_old_battery ; load data of old battery
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2154 MENU_CALL tNewBattNew15, do_use_15V_disposable ; not rechargeable
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2155 MENU_CALL tNewBattNew36, do_use_36V_disposable ; not rechargeable
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2156 MENU_CALL tNewBattAccu, do_use_36V_chargeable ; rechargeable
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
2157 MENU_END
0
heinrichsweikamp
parents:
diff changeset
2158
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
2159
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2160 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2161 ; Call Function - keep old Battery
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2162 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2163 do_use_old_battery:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2164 rcall get_battery_data ; load data of old battery
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2165 goto surfloop ; proceed to surface mode
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2166
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2167
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2168 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2169 ; Call Function - new 1.5 V disposable
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2170 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2171 do_use_15V_disposable:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2172 rcall setup_new_15v
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2173 bra use_batt_exit
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2174
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2175
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2176 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2177 ; Call Function - new 3.6 V disposable
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2178 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2179 do_use_36V_disposable:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2180 rcall setup_new_saft
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2181 bra use_batt_exit
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2182
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2183
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2184 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2185 ; Call Function - new 3.6 V rechargeable
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2186 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2187 do_use_36V_chargeable:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2188 rcall setup_new_panasonic
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2189 call reset_battery_gauge
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2190 bra use_batt_exit_1
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2191
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2192
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2193 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2194 ; Call Function - build-in 16650
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2195 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2196 do_use_16650_battery:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2197 rcall setup_new_16650
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2198 bra use_batt_exit
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2199
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2200
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2201 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2202 ; Call Function - build-in 18650
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2203 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2204 use_18650_battery:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2205 rcall setup_new_18650
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2206 ;bra use_batt_exit
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2207
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2208
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2209 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2210 ; Helper Function - finish Battery Selection
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2211 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2212 use_batt_exit:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2213 call reset_battery_gauge_and_lt2942 ; reset battery hard- and software gauge
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2214
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2215 use_batt_exit_1:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2216 IFNDEF _screendump
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2217 bcf comm_mode_disabled ; re-enable COMM mode again
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2218 ENDIF
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2219 goto surfloop ; exit to surface mode
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2220
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2221
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2222 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2223 ; Migrate Battery Selection from Firmwares prior 2.09
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2224 ;
457
b4417044a042 recover old battery status prior 2.09
heinrichsweikamp
parents: 453
diff changeset
2225 global use_old_prior_209
b4417044a042 recover old battery status prior 2.09
heinrichsweikamp
parents: 453
diff changeset
2226 use_old_prior_209:
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
2227 EEPROM_CC_READ eeprom_battery_type,WREG ; read battery type from EEPROM
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
2228 incfsz WREG,W ; battery type = 0xFF (undefined) ?
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
2229 return ; NO - done
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
2230 call lt2942_get_status ; YES - check for gauge IC
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
2231 movlw .3 ; - default to a 18650 (LiIon 3.7V/3.1Ah)
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
2232 btfss battery_gauge_available ; - OSTC 2 or cR hardware?
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
2233 movlw .1 ; - NO - assume a Saft (disposable 3.6 V)
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
2234 EEPROM_CC_WRITE WREG,eeprom_battery_type; - write battery type to EEPROM
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
2235 return ; - done
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
2236
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
2237
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2238 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2239 ; Retrieve Battery Selection from EEPROM
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2240 ;
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2241 global get_battery_data
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2242 get_battery_data:
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
2243 call eeprom_battery_gauge_read ; retrieve stored battery gauge value from EEPROM
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2244 movff battery_type,lo ; copy retrieved battery type to lo
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2245 rcall setup_new_saft ; default battery configuration
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2246 incf lo,F ; (0-4) -> (1-5)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2247 dcfsnz lo,F
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2248 rcall setup_new_15v ; =0
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2249 dcfsnz lo,F
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2250 rcall setup_new_saft ; =1
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2251 dcfsnz lo,F
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2252 rcall setup_new_panasonic ; =2
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2253 dcfsnz lo,F
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2254 rcall setup_new_18650 ; =3
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2255 dcfsnz lo,F
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2256 rcall setup_new_16650 ; =4
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2257 bcf use_old_batt_flag ; clear flag
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2258 IFNDEF _screendump
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2259 bcf comm_mode_disabled ; re-enable COMM mode again
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2260 ENDIF
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2261 return ; done
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2262
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2263
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2264 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2265 ; Helper Functions - configure Battery Types
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2266
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2267 ; 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
2268 setup_new_15v:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2269 bsf charge_disable ; set charging-inhibit signal
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2270 bcf charge_enable ; activate charging-inhibit signal
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
2271 movlw .100
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
2272 movwf batt_percent ; to have 1.5V batteries right after firmware update
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
2273 movlw .0
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2274 movwf battery_type
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2275 return
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2276
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2277 ; disposable 3.6 Volt Lithium
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2278 setup_new_saft:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2279 bsf charge_disable ; set charging-inhibit signal
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2280 bcf charge_enable ; activate charging-inhibit signal
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2281 MOVLI capacity_saft_internal, battery_capacity_internal
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2282 MOVLI capacity_saft, battery_capacity
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2283 MOVLI offset_saft, battery_offset
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2284 movlw .1
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2285 movwf battery_type
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2286 return
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2287
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2288 ; rechargeable user-changeable 3.7 Volt Lithium-ion
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2289 setup_new_panasonic:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2290 bcf charge_disable ; release charging-inhibit signal
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2291 bsf charge_enable ; tristate charging-inhibit signal
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2292 MOVLI capacity_panasonic_internal, battery_capacity_internal
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2293 MOVLI capacity_panasonic, battery_capacity
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2294 MOVLI offset_panasonic, battery_offset
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2295 movlw .2
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2296 movwf battery_type
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2297 return
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2298
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2299 ; rechargeable internal Lithium-ion
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2300 setup_new_18650:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2301 bcf charge_disable ; release charging-inhibit signal
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2302 bsf charge_enable ; tristate charging-inhibit signal
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2303 CLRI battery_capacity_internal
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2304 MOVLI capacity_ncr18650, battery_capacity
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2305 MOVLI offset_ncr18650, battery_offset
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2306 movlw .3
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2307 movwf battery_type
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2308 return
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2309
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2310 ; rechargeable internal Lithium-ion
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2311 setup_new_16650:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2312 bcf charge_disable ; release charging-inhibit signal
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2313 bsf charge_enable ; tristate charging-inhibit signal
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2314 CLRI battery_capacity_internal
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2315 MOVLI capacity_ur16650, battery_capacity
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2316 MOVLI offset_ur16650, battery_offset
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2317 movlw .4
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2318 movwf battery_type
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
2319 return
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
2320
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2321 ;-----------------------------------------------------------------------------
0
heinrichsweikamp
parents:
diff changeset
2322
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2323 END