annotate src/menu_tree.asm @ 646:5b7fe7777425

3.16 release
author heinrichs weikamp
date Thu, 14 Oct 2021 12:03:24 +0200
parents 8c1f1f334275
children 357341239438
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
heinrichsweikamp
parents:
diff changeset
1 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
2 ;
640
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 638
diff changeset
3 ; File menu_tree.asm * combined next generation V3.12.2
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
640
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 638
diff changeset
786 ;bra do_menu_dive ; continue
634
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
640
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 638
diff changeset
806 MENU_BEGIN tDiveSetup, .6
634
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
640
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 638
diff changeset
815 MENU_BEGIN tDiveSetup, .5
634
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
640
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 638
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:
640
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 638
diff changeset
837 MENU_BEGIN tDecoSetup, .5
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
838 MENU_OPT_INC tDkMode, oDecoMode ; ZH-L16 /GF
640
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 638
diff changeset
839 MENU_CALL tSDMenu, do_menu_dive_deco_SD ; SD settings
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 638
diff changeset
840 MENU_CALL tGFMenu, do_menu_dive_deco_GF ; GF settings
634
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 tBack, do_return_menu_dive
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
843 MENU_END
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
844
0
heinrichsweikamp
parents:
diff changeset
845
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
846 ;-----------------------------------------------------------------------------
640
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 638
diff changeset
847 ; Dive Settings Menu - 3nd Layer - Deco Mode - SD Settings
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 638
diff changeset
848 ;
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 638
diff changeset
849 do_menu_dive_deco_SD:
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 638
diff changeset
850 TSTOSS char_I_model ; in GF mode?
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 638
diff changeset
851 bra do_menu_dive_deco_SD_noGF ; NO
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 638
diff changeset
852 ;bra do_menu_dive_deco_SD_GF ; YES
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 638
diff changeset
853
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 638
diff changeset
854 do_menu_dive_deco_SD_GF:
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 638
diff changeset
855 MENU_BEGIN tSDMenu, .3
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 638
diff changeset
856 MENU_OPT_INC tSaturationMult, osatmultgf ; saturation GF mode
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 638
diff changeset
857 MENU_OPT_INC tDesaturationMult, odesatmultgf ; desaturation GF mode
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 638
diff changeset
858 MENU_CALL tBack, do_return_menu_dive_deco
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 638
diff changeset
859 MENU_END
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 638
diff changeset
860
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 638
diff changeset
861 do_menu_dive_deco_SD_noGF:
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 638
diff changeset
862 MENU_BEGIN tSDMenu, .3
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 638
diff changeset
863 MENU_OPT_INC tSaturationMult, osatmult ; saturation non-GF mode
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 638
diff changeset
864 MENU_OPT_INC tDesaturationMult, odesatmult ; desaturation non-GF mode
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 638
diff changeset
865 MENU_CALL tBack, do_return_menu_dive_deco
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 638
diff changeset
866 MENU_END
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 638
diff changeset
867
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 638
diff changeset
868
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 638
diff changeset
869 ;-----------------------------------------------------------------------------
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
870 ; Dive Settings Menu - 3nd Layer - Deco Mode - GF Settings
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
871 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
872 do_menu_dive_deco_GF:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
873 MENU_BEGIN tGFMenu, .6
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
874 MENU_OPT_INC tGF_low, oGF_low ; GF low
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
875 MENU_OPT_INC tGF_high, oGF_high ; GF high
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
876 MENU_OPT_INC taGFenable, oEnable_aGF ; aGF selectable
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
877 MENU_OPT_INC taGF_low, oaGF_low ; aGF low
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
878 MENU_OPT_INC taGF_high, oaGF_high ; aGF high
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
879 MENU_CALL tBack, do_return_menu_dive_deco
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
880 MENU_END
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
881
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
882
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
883 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
884 ; Dive Settings Menu - 2nd Layer - SAC Setup
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
885 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
886 do_menu_dive_SAC:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
887 IFDEF _gas_contingency
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
888 MENU_BEGIN tSACSetup, .6
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
889 MENU_OPT_INC tCalcGasNeeds, oCalcAscGas ; calc.gas
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
890 MENU_OPT_INC tGasContingencyDive, oGasContingencyDive ; switch tank if used up
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
891 MENU_OPT_INC tGasChangeTime, oGasChangeTime ; gas change time
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
892 MENU_OPT_INC tSetWorkSAC, oWork_SAC ; work SAC
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
893 MENU_OPT_INC tSetDecoSAC, oDeco_SAC ; deco SAC
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
894 MENU_CALL tBack, do_return_menu_dive
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
895 MENU_END
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
896 ELSE
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
897 MENU_BEGIN tSACSetup, .5
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
898 MENU_OPT_INC tCalcGasNeeds, oCalcAscGas ; calc.gas
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
899 MENU_OPT_INC tGasChangeTime, oGasChangeTime ; gas change time
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
900 MENU_OPT_INC tSetWorkSAC, oWork_SAC ; work SAC
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
901 MENU_OPT_INC tSetDecoSAC, oDeco_SAC ; deco SAC
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
902 MENU_CALL tBack, do_return_menu_dive
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
903 MENU_END
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
904 ENDIF
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
905
104
223579e905c3 Show a Safety Stop if enabled (Menu "Deco Parameters")
heinrichsweikamp
parents: 90
diff changeset
906
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
907 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
908 ; Dive Settings Menu - 2nd Layer - ppO2 Setup
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
909 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
910 do_menu_dive_ppO2:
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
911 IFDEF _ccr_pscr
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
912 IFDEF _helium
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
913 MENU_BEGIN tppO2Setup, .6
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
914 MENU_DYNAMIC dyn_ppo2_max, do_toggle_ppO2_max_work ; max work
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
915 MENU_DYNAMIC dyn_ppo2_max_deco, do_toggle_ppO2_max_deco ; max deco
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
916 MENU_DYNAMIC dyn_ppo2_min, do_toggle_ppO2_min ; min OC
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
917 MENU_DYNAMIC dyn_ppo2_min_cc, do_toggle_ppO2_min_cc ; min loop
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
918 MENU_OPT_INC tIBCDwarning, oEnable_IBCD ; IBCD warning
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
919 MENU_CALL tBack, do_return_menu_dive
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
920 MENU_END
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
921 ELSE
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
922 MENU_BEGIN tppO2Setup, .5
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
923 MENU_DYNAMIC dyn_ppo2_max, do_toggle_ppO2_max_work ; max work
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
924 MENU_DYNAMIC dyn_ppo2_max_deco, do_toggle_ppO2_max_deco ; max deco
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
925 MENU_DYNAMIC dyn_ppo2_min, do_toggle_ppO2_min ; min OC
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
926 MENU_DYNAMIC dyn_ppo2_min_cc, do_toggle_ppO2_min_cc ; min loop
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
927 MENU_CALL tBack, do_return_menu_dive
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
928 MENU_END
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
929 ENDIF ; _helium
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
930 ELSE
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
931 IFDEF _helium
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
932 MENU_BEGIN tppO2Setup, .5
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
933 MENU_DYNAMIC dyn_ppo2_max, do_toggle_ppO2_max_work ; max work
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
934 MENU_DYNAMIC dyn_ppo2_max_deco, do_toggle_ppO2_max_deco ; max deco
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
935 MENU_DYNAMIC dyn_ppo2_min, do_toggle_ppO2_min ; min OC
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
936 MENU_OPT_INC tIBCDwarning, oEnable_IBCD ; IBCD warning
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
937 MENU_CALL tBack, do_return_menu_dive
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
938 ELSE
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
939 MENU_BEGIN tppO2Setup, .4
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
940 MENU_DYNAMIC dyn_ppo2_max, do_toggle_ppO2_max_work ; max work
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
941 MENU_DYNAMIC dyn_ppo2_max_deco, do_toggle_ppO2_max_deco ; max deco
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
942 MENU_DYNAMIC dyn_ppo2_min, do_toggle_ppO2_min ; min OC
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
943 MENU_CALL tBack, do_return_menu_dive
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
944 MENU_END
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
945 ENDIF ; _helium
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
946 ENDIF ; _ccr_pscr
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
947
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
948
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
949 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
950 ; dynamic Title - show maximum ppO2 - Work
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
951 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
952 dyn_ppo2_max:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
953 STRCAT_TEXT tPPO2Max ; print text
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
954 movff char_I_ppO2_max_work,lo ; get value
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
955 movlw ppo2_warning_high_default ; load default
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
956 bra dyn_ppo2_common ; continue with common part
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
957
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 maximum ppO2 - Deco
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
961 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
962 dyn_ppo2_max_deco:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
963 STRCAT_TEXT tPPO2DECO ; print text
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
964 movff char_I_ppO2_max_deco,lo ; get value
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
965 movlw ppo2_warning_deco_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
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
969 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
970 ; dynamic Title - show minimum ppO2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
971 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
972 dyn_ppo2_min:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
973 STRCAT_TEXT tPPO2MIN ; print text
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
974 movff char_I_ppO2_min,lo ; get value
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
975 movlw ppo2_warning_low_default ; load default
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
976 bra dyn_ppo2_common ; continue with common part
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
977
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
978
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
979 IFDEF _ccr_pscr
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
980
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
981 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
982 ; dynamic Title - show minimum ppO2 - Loop Modes
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
983 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
984 dyn_ppo2_min_cc:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
985 STRCAT_TEXT tPPO2MINCC ; print text
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
986 movff char_I_ppO2_min_loop,lo ; get value
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
987 movlw ppo2_warning_loop_default ; load default
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
988 ;bra dyn_ppo2_common ; continue with common part
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
989
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
990 ENDIF
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
991
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
992
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
993 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
994 ; Helper Function to all show ppO2 dynamic Titles
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
995 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
996 dyn_ppo2_common:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
997 movwf up ; copy default to up
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
998 clrf hi ; clear hi
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
999 bsf leftbind ; print left-aligned
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1000 bsf decimal_digit2 ; place a decimal point in front of digit 2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1001 output_256 ; print ppO2 as x.xx
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1002 STRCAT_TEXT tbar ; append unit
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1003 movf up,W ; get default value into WREG
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1004 cpfseq lo ; current value = default value ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1005 bra divesets_ppo2_common2 ; NO - add an "*"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1006 return ; YES - done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1007 divesets_ppo2_common2:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1008 PUTC "*" ; append a star
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1009 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1010
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1011
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1012 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1013 ; Call Function - increment maximum ppO2 - Work
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1014 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1015 do_toggle_ppO2_max_work: ; add 0.1 bar
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1016 movff char_I_ppO2_max_work,lo ; bank-safe copy
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1017 movlw .10
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1018 addwf lo,F
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1019 movlw ppo2_warning_high_highest
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1020 cpfsgt lo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1021 bra do_toggle_ppo2_max2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1022 movlw ppo2_warning_high_lowest
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1023 movwf lo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1024 do_toggle_ppo2_max2:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1025 movff lo,char_I_ppO2_max_work
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1026 return
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1027
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1028
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1029 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1030 ; Call Function - increment maximum ppO2 - Deco
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1031 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1032 do_toggle_ppO2_max_deco: ; add 0.1 bar
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1033 movff char_I_ppO2_max_deco,lo ; bank-safe copy
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1034 movlw .10
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1035 addwf lo,F
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1036 movlw ppo2_warning_deco_highest
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1037 cpfsgt lo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1038 bra do_toggle_ppO2_max_deco2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1039 movlw ppo2_warning_deco_lowest
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1040 movwf lo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1041 do_toggle_ppO2_max_deco2:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1042 movff lo,char_I_ppO2_max_deco
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1043 return
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1044
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1045
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1046 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1047 ; Call Function - increment minimum ppO2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1048 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1049 do_toggle_ppO2_min: ; sub 0.1 bar
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1050 movff char_I_ppO2_min,lo ; bank-safe copy
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1051 incf lo,F
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1052 movlw ppo2_warning_low_highest
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1053 cpfsgt lo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1054 bra do_toggle_ppO2_min2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1055 movlw ppo2_warning_low_lowest
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1056 movwf lo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1057 do_toggle_ppO2_min2:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1058 movff lo,char_I_ppO2_min
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1059 return
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1060
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1061
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1062 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1063 ; Call Function - increment minimum ppO2 - Loop Modes
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1064 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1065 do_toggle_ppO2_min_cc: ; sub 0.1 bar
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1066 movff char_I_ppO2_min_loop,lo ; bank-safe copy
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1067 incf lo,F
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1068 movlw ppo2_warning_loop_highest
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1069 cpfsgt lo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1070 bra do_toggle_ppO2_min_cc2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1071 movlw ppo2_warning_loop_lowest
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1072 movwf lo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1073 do_toggle_ppO2_min_cc2:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1074 movff lo,char_I_ppO2_min_loop
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1075 return
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1076
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1077
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1078 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1079 ; Dive Settings Menu - 2nd Layer - Stops & Depth
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1080 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1081 do_menu_dive_stops:
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
1082 MENU_BEGIN tStopsSetup, .6
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1083 MENU_OPT_INC tSafetyStop, oSafetyStop ; safety stop
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1084 MENU_OPT_INC tExtendedStops, oExtendedStops ; extended stops
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1085 MENU_OPT_INC tLastDecostop, oLastDeco ; last deco stop
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1086 MENU_OPT_INC tDvSalinity, oDiveSalinity ; salinity
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1087 MENU_OPT_INC tDepthWarn, oMaxDepth ; depth limit
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1088 MENU_CALL tBack, do_return_menu_dive
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1089 MENU_END
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 545
diff changeset
1090
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 545
diff changeset
1091
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1092 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1093 ; return to Settings Menu from Sub-Sub-Menu
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1094 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1095 do_return_menu_settings_deeper: ; entry point for return from info menu 2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1096 call menu_processor_pop ; drop one more stack entry
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1097 ;bra do_return_menu_settings ; continue
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 545
diff changeset
1098
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 545
diff changeset
1099
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1100 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1101 ; return to Settings Menu from Sub-Menu
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1102 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1103 do_return_menu_settings:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
1104 bcf imprint_time_date ; stop imprinting of current time & date
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1105 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
1106
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
1107 IFDEF _rx_mode
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
1108 bcf tr_functions_activated ; set TR functions as deactivated by default
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
1109 btfss ostc_rx_present ; TR model / TR module up & running?
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1110 bra do_menu_settings ; NO - keep deactivated
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
1111 movff opt_TR_mode,WREG ; YES - get TR mode
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
1112 tstfsz WREG ; - TR mode <> off ?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
1113 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
1114 ENDIF
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1115
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1116
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1117 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1118 ; Settings Menu - 1st Layer
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1119 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1120 do_menu_settings:
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
1121 IFDEF _hwos_sport
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1122 bsf ble_available ; required for very old OSTC sport
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
1123 ENDIF
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1124 btfsc ble_available ; BT available?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1125 bra do_menu_settings_bt ; YES - do BT menu
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
1126
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
1127 MENU_BEGIN tSystSets, .5
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1128 MENU_CALL tInfoMenu, do_menu_info
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1129 MENU_CALL tSetTimeDate, do_menu_date_time
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1130 MENU_CALL tDispSets, do_menu_dispsets
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1131 MENU_CALL tSysSets, do_menu_syssets
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
1132 MENU_CALL tBack, do_return_main_menu
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1133 MENU_END
155
5f71e31bd5b3 CHANGE: Re-arranged Settings Menu, add 180? rotate to menu
heinrichsweikamp
parents: 154
diff changeset
1134
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1135 do_menu_settings_bt:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
1136 IFDEF _rx_functions
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
1137 btfss ostc_rx_present ; TR model and TR activated?
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1138 bra do_menu_settings_noRX ; NO
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
1139
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
1140 MENU_BEGIN tSystSets, .7
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1141 MENU_CALL tInfoMenu, do_menu_info
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1142 MENU_CALL tBleTitle, do_comm_mode_bt
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1143 MENU_CALL tTrSettings, do_menu_settings_TR
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1144 MENU_CALL tSetTimeDate, do_menu_date_time
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1145 MENU_CALL tDispSets, do_menu_dispsets
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1146 MENU_CALL tSysSets, do_menu_syssets
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
1147 MENU_CALL tBack, do_return_main_menu
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
1148 MENU_END
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
1149 ENDIF
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
1150
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1151 do_menu_settings_noRX:
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
1152 MENU_BEGIN tSystSets, .6
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1153 MENU_CALL tInfoMenu, do_menu_info
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1154 MENU_CALL tBleTitle, do_comm_mode_bt
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1155 MENU_CALL tSetTimeDate, do_menu_date_time
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1156 MENU_CALL tDispSets, do_menu_dispsets
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1157 MENU_CALL tSysSets, do_menu_syssets
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
1158 MENU_CALL tBack, do_return_main_menu
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
1159 MENU_END
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
1160
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
1161
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1162 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1163 ; Call Function - start Communication Mode (BT)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1164 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1165 do_comm_mode_bt:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1166 goto comm_mode_bt ; code hosted in comm.asm
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1167
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1168
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1169 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1170 ; Settings Menu - 2nd Layer - System Infos - Page 1
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1171 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1172 do_menu_info:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
1173 IFDEF _rx_functions
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
1174 btfss ostc_rx_present ; TR model?
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1175 bra do_menu_info_noRX ; NO
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
1176
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
1177 MENU_BEGIN tInfoMenu, .7
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1178 MENU_DYNAMIC dyn_show_uptime, 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1179 MENU_DYNAMIC dyn_show_serial, 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1180 MENU_DYNAMIC dyn_show_firmware_ostc, 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1181 MENU_DYNAMIC dyn_show_fw_creation_date, 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1182 MENU_DYNAMIC dyn_show_firmware_rx, 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1183 MENU_DYNAMIC dyn_show_total_dives, 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1184 MENU_CALL tMore, do_menu_info2
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1185 MENU_END
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
1186 ENDIF
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
1187
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1188 do_menu_info_noRX:
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
1189 MENU_BEGIN tInfoMenu, .6
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1190 MENU_DYNAMIC dyn_show_uptime, 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1191 MENU_DYNAMIC dyn_show_serial, 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1192 MENU_DYNAMIC dyn_show_firmware_ostc, 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1193 MENU_DYNAMIC dyn_show_fw_creation_date, 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1194 MENU_DYNAMIC dyn_show_total_dives, 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1195 MENU_CALL tMore, do_menu_info2
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
1196 MENU_END
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
1197
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1198
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1199 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1200 ; dynamic Title - show Uptime
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1201 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1202 dyn_show_uptime:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1203 STRCAT_TEXT tUptime ; print title
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1204 SMOVQQ uptime,xC ; ISR-safe copy of uptime:4 to xC:4
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1205 goto output_secs_as_days_hours ; print seconds as days and hours and return
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1206
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1207
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1208 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1209 ; dynamic Title - show Uptime
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1210 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1211 dyn_show_serial:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1212 STRCAT_TEXT tSerial ; print title
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1213 goto TFT_cat_serial ; print serial number and return
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1214
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1215 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1216 ; dynamic Title - show Firmware Version
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1217 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1218 dyn_show_firmware_ostc:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1219 STRCAT_TEXT tFirmware ; print title
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1220 call TFT_cat_firmware ; print firmware version
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1221 PUTC " " ; print a dot
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1222 goto TFT_cat_beta_short ; print beta/release state and return
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1223
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1224
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1225 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1226 ; dynamic Title - show Firmware creation Date
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1227 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1228 dyn_show_fw_creation_date:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1229 STRCAT_TEXT tFirmwareDate ; print title
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1230 movlw firmware_creation_year ; get firmware creation year
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1231 movwf lo ; copy to lo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1232 movlw firmware_creation_month ; get firmware creation month
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1233 movwf hi ; copy to hi
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1234 movlw firmware_creation_day ; get firmware creation day
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1235 movwf up ; copy to up
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1236 goto output_date ; print date and return
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
1237
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
1238
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
1239 IFDEF _rx_functions
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
1240
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1241 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1242 ; dynamic Title - show RX Firmware Version (also used by start.asm)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1243 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1244 global dyn_show_firmware_rx
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1245 dyn_show_firmware_rx:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1246 STRCAT_TEXT tFirmware_rx ; print title
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1247 movff rx_firmware_cur_major,lo ; get major version
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1248 bsf leftbind ; print left-aligned
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1249 output_99 ; print major (0-99)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1250 PUTC '.' ; print a dot
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1251 movff rx_firmware_cur_minor,lo ; get minor
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1252 output_99x ; print minor (00-99)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1253 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1254
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1255 ENDIF ; _rx_functions
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1256
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1257
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1258 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1259 ; dynamic Title - show total Number of Dives
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1260 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1261 dyn_show_total_dives:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1262 STRCAT_TEXT tTotalDives ; print title
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1263 call eeprom_total_dives_read ; read total number of dives
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1264 bsf leftbind ; print left-aligned
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1265 output_65535 ; print number of total dives (0-65535)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1266 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1267
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1268
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1269 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1270 ; Settings Menu - 2nd Layer - System Infos - Page 2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1271 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1272 do_menu_info2:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1273 IFNDEF _comm_debug
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1274 MENU_BEGIN tInfoMenu, .5
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1275 MENU_DYNAMIC dyn_show_battery_volts, 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1276 MENU_DYNAMIC dyn_show_config, 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1277 MENU_DYNAMIC dyn_show_sensor_calib, 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1278 MENU_DYNAMIC dyn_show_sensor_offset, 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1279 MENU_CALL tBack, do_return_menu_settings_deeper
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1280 MENU_END
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1281 ELSE
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1282 MENU_BEGIN tInfoMenu, .6
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1283 MENU_DYNAMIC dyn_show_battery_volts, 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1284 MENU_DYNAMIC dyn_show_config, 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1285 MENU_DYNAMIC dyn_show_sensor_calib, 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1286 MENU_DYNAMIC dyn_show_sensor_offset, 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1287 MENU_OPT_INC tCommTimeout, oCommTimeout
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1288 MENU_CALL tBack, do_return_menu_settings_deeper
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1289 MENU_END
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1290 ENDIF
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1291
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1292
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1293 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1294 ; dynamic Title - show Battery Volts and Type
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1295 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1296 dyn_show_battery_volts:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1297 STRCAT_TEXT tBatteryV ; print text
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1298 MOVII batt_voltage,mpr ; get battery voltage
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1299 bsf decimal_digit3 ; place a decimal point in front of digit 3
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1300 bsf omit_digit_1 ; do not print 1st digit
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1301 output_9999 ; print as x.yy-
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1302 STRCAT " V(T" ; append fix legend
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1303 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
1304 output_9 ; print battery type code (0-9)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1305 PUTC ")" ; append fix legend
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1306 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1307
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1308
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1309 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1310 ; dynamic Title - show Hardware / Software Configuration
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1311 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1312 dyn_show_config:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1313 STRCAT_TEXT tHardware ; print text
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1314 call I2C_init_compass ; start compass to get compass configuration
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1315 movf HW_descriptor,W ; copy hardware descriptor to WREG
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1316 output_hex ; print as hex
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1317 movf HW_variants,W ; copy hardware variants to WREG
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1318 output_hex ; print as hex
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1319 PUTC "-" ; print a separator
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1320 movlw FW_CONF ; get firmware configuration
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1321 output_hex ; print as hex
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1322 call get_cpu_version ; get CPU version
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1323 output_hex ; print as hex
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1324 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1325
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1326
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1327 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1328 ; dynamic Title - show Pressure Sensor Calibration Data C1 and C5
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1329 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1330 dyn_show_sensor_calib:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1331 STRCAT_TEXT tSensorC ; print label
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1332 movff C1+1,WREG ; get C1, high byte
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1333 output_hex ; print C1, high byte
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1334 movff C1+0,WREG ; get C1, low byte
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1335 output_hex ; print C1, low byte
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1336 PUTC "-" ; print a separator
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1337 movff C5+1,WREG ; get C5, high byte
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1338 output_hex ; print C5, high byte
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1339 movff C5+0,WREG ; get C5, low byte
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1340 output_hex ; print C5, low byte
646
5b7fe7777425 3.16 release
heinrichs weikamp
parents: 640
diff changeset
1341 btfss press_sensor_type ; =1: pressure sensor MS5837, =0: Pressure sensor MS5541
5b7fe7777425 3.16 release
heinrichs weikamp
parents: 640
diff changeset
1342 return ; MS5541, done
5b7fe7777425 3.16 release
heinrichs weikamp
parents: 640
diff changeset
1343 PUTC "*"
5b7fe7777425 3.16 release
heinrichs weikamp
parents: 640
diff changeset
1344 return ; MS5837, done
5b7fe7777425 3.16 release
heinrichs weikamp
parents: 640
diff changeset
1345
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1346
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1347
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1348 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1349 ; dynamic Title - show Pressure Sensor Offset Setting
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1350 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1351 dyn_show_sensor_offset:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1352 STRCAT_TEXT tSensorD ; print label
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1353 movff opt_pressure_adjust,lo ; get pressure sensor offset
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1354 movf lo,F ; excite flags
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1355 bz dyn_show_sensor_offset_zero ; sensor offset = 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1356 bn dyn_show_sensor_offset_neg ; sensor offset < 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1357 ;bnn dyn_show_sensor_offset_pos ; sensor offset > 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1358 dyn_show_sensor_offset_pos:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1359 PUTC "+" ; print plus sign
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1360 bra dyn_show_sensor_offset_com ; continue with common part
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1361 dyn_show_sensor_offset_zero:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1362 PUTC " " ; print a space
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1363 bra dyn_show_sensor_offset_com ; continue with common part
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1364 dyn_show_sensor_offset_neg:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1365 PUTC "-" ; print a minus sign
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1366 negf lo ; negate lo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1367 ;bra dyn_show_sensor_offset_com ; continue with common part
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1368 dyn_show_sensor_offset_com:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1369 PUTC " " ; print a space
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1370 bsf leftbind ; print left-aligned
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1371 output_99 ; print value (0-99)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1372 PUTC " " ; print a space
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1373 STRCAT_TEXT tMBAR ; print unit
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1374 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1375
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1376
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1377 IFDEF _rx_functions
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1378
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1379 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1380 ; Settings Menu - 2nd Layer - TR Settings
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1381 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1382 do_menu_settings_TR:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
1383 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
1384 incf WREG,W ; add 1
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
1385 dcfsnz WREG,W ; subtract one, became zero?
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1386 bra do_menu_settings_TR_MaxDelta; YES - OC
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1387 dcfsnz WREG,W ; subtract one, became zero?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1388 bra do_menu_settings_TR_BailPres; YES - CCR
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
1389 dcfsnz WREG,W ; subtract one, became zero?
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1390 bra do_menu_settings_TR_MaxDelta; YES - Gauge
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
1391 dcfsnz WREG,W ; subtract one, became zero?
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1392 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
1393 dcfsnz WREG,W ; subtract one, became zero?
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1394 bra do_menu_settings_TR_both ; YES - pSCR
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1395
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1396 do_menu_settings_TR_abort:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1397 call menu_processor_pop ; drop button press
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1398 bra do_menu_settings ; back to same menu
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
1399
634
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 - Sidemount 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_MaxDelta: ; menu with oTrMaxDeltaPres
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
1405 MENU_BEGIN tTrSettings, .5
634
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_DYNAMIC dyn_toggle_max_pres_diff, do_toggle_max_pres_diff
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1410 MENU_CALL tBack, do_return_menu_settings
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
1411 MENU_END
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
1412
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
1413
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1414 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1415 ; Settings Menu - 3rd Layer - TR Settings - CCR Mode
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1416 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1417 do_menu_settings_TR_BailPres: ; menu with oTrBailPres
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1418 MENU_BEGIN tTrSettings, .5
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1419 MENU_OPT_INC tTrMode, oTrMode
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1420 MENU_OPT_INC tTr1stPres, oTr1stPres
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1421 MENU_OPT_INC tTr2ndPres, oTr2ndPres
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1422 MENU_OPT_INC tTrBailPres, oTrBailPres
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1423 MENU_CALL tBack, do_return_menu_settings
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1424 MENU_END
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1425
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1426
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1427 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1428 ; Settings Menu - 3rd Layer - TR Settings - pSCR Mode
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1429 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1430 do_menu_settings_TR_both: ; menu with oTrBailPres and oTrMaxDeltaPres
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1431 MENU_BEGIN tTrSettings, .6
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1432 MENU_OPT_INC tTrMode, oTrMode
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1433 MENU_OPT_INC tTr1stPres, oTr1stPres
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1434 MENU_OPT_INC tTr2ndPres, oTr2ndPres
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1435 MENU_OPT_INC tTrBailPres, oTrBailPres
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1436 MENU_DYNAMIC dyn_toggle_max_pres_diff, do_toggle_max_pres_diff
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1437 MENU_CALL tBack, do_return_menu_settings
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1438 MENU_END
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1439
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1440
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1441 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1442 ; dynamic Title - max. Delta Pressure for Swap Tanks Advice
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1443 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1444 dyn_toggle_max_pres_diff:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1445 movff opt_TR_mode,WREG ; get TR mode
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1446 xorlw .2 ; compare with 2 (ind.double)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1447 tstfsz WREG ; equal?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1448 FONT_COLOR_DISABLED ; NO - print in disabled color
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1449 STRCAT_TEXT tTrMaxDeltaP ; output label
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1450 movff char_I_max_pres_diff,lo ; get configured deltaP
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1451 output_99 ; print deltaP (0-99)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1452 STRCAT_TEXT tbar ; append " bar"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1453 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1454
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 ; Call Function - adjust max. Delta Pressure for Swap Tanks Advice
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1458 ;
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
1459 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
1460 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
1461 movlw .5 ; load increment
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
1462 addwf lo,F ; add increment
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
1463 movlw max_pres_diff_max ; load maximum value
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
1464 cpfsgt lo ; above maximum value?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
1465 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
1466 movlw max_pres_diff_min ; YES - load minimum value
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
1467 movwf lo ; - into lo
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
1468 do_toggle_max_pres_diff_1:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
1469 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
1470 return ; done
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
1471
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
1472 ENDIF ; _rx_functions
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1473
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1474
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1475 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1476 ; return to Settings Menu from Sub-Menu
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1477 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1478 do_return_menu_date_time:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1479 call menu_processor_double_pop ; drop exit line and back to last line
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1480
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1481
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1482 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1483 ; Settings Menu - 2nd Layer - set Time & Date
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1484 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1485 do_menu_date_time:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1486 bsf imprint_time_date ; start imprinting current time & date
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1487 bcf block_option_value ; resume displaying of option values
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1488
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1489 MENU_BEGIN tSetTimeDate, .4
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1490 MENU_CALL tSetTime, do_menu_set_time
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1491 MENU_CALL tSetDate, do_menu_set_date
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1492 MENU_OPT_INC tDateFormat, oDateFormat
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1493 MENU_CALL tBack, do_return_menu_settings
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1494 MENU_END
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1495
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1496
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1497 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1498 ; Settings Menu - 3rd Layer - set Time & Date - set Time
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1499 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1500 do_menu_set_time:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1501 bsf block_option_value ; suspend displaying of option values
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1502
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1503 MENU_BEGIN tSetTime, .4
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1504 MENU_OPT_INC tSetHours, oSetHours
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1505 MENU_OPT_INC tSetMinutes, oSetMinutes
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1506 MENU_OPT_INC tSetSeconds, oClearSeconds
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1507 MENU_CALL tBack, do_return_menu_date_time
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1508 MENU_END
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1509
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
1510
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1511 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1512 ; Settings Menu - 3rd Layer - set Time & Date - set Date
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1513 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1514 do_menu_set_date:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1515 bsf block_option_value ; suspend displaying of option values
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1516
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1517 MENU_BEGIN tSetDate, .4
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1518 MENU_OPT_INC tSetDay, oSetDay
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1519 MENU_OPT_INC tSetMonth, oSetMonth
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1520 MENU_OPT_INC tSetYear, oSetYear
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1521 MENU_CALL tBack, do_return_menu_date_time
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1522 MENU_END
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1523
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1524
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1525 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1526 ; return to Display Settings from Sub-Menu
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1527 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1528 do_return_dispsets_menu:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1529 bcf imprint_color_schemes ; deactivate color schemes demonstration
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1530 call menu_processor_double_pop ; drop exit line and back to last line
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1531 ;bra do_menu_dispsets ; continue
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1532
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1533
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1534 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1535 ; Settings Menu - 2nd Layer - Display Settings - Page 1
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1536 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1537 do_menu_dispsets:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1538 IF _language_2!=none
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1539 MENU_BEGIN tDispSets, .7
646
5b7fe7777425 3.16 release
heinrichs weikamp
parents: 640
diff changeset
1540 MENU_CALL tBright, do_menu_Brightness
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1541 MENU_OPT_INC tLayout, oLayout
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1542 MENU_OPT_INC tUnits, oUnits
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1543 MENU_OPT_INC tLanguage, oLanguage
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1544 MENU_OPT_INC tFlip, oFlipScreen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1545 MENU_CALL tColorScheme, do_menu_color_scheme
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1546 MENU_CALL tMore, do_menu_dispsets_more
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1547 MENU_END
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
1548 ELSE
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1549 MENU_BEGIN tDispSets, .6
646
5b7fe7777425 3.16 release
heinrichs weikamp
parents: 640
diff changeset
1550 MENU_CALL tBright, do_menu_Brightness
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1551 MENU_OPT_INC tLayout, oLayout
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1552 MENU_OPT_INC tUnits, oUnits
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1553 MENU_OPT_INC tFlip, oFlipScreen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1554 MENU_CALL tColorScheme, do_menu_color_scheme
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1555 MENU_CALL tMore, do_menu_dispsets_more
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
1556 MENU_END
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1557 ENDIF
220
effd7259f5a5 make button sensitivity configurable (cR hardware)
heinrichsweikamp
parents: 218
diff changeset
1558
646
5b7fe7777425 3.16 release
heinrichs weikamp
parents: 640
diff changeset
1559 ;-----------------------------------------------------------------------------
5b7fe7777425 3.16 release
heinrichs weikamp
parents: 640
diff changeset
1560 ; Settings Menu - 3rd Layer - Display Settings - Brightness
5b7fe7777425 3.16 release
heinrichs weikamp
parents: 640
diff changeset
1561 ;
5b7fe7777425 3.16 release
heinrichs weikamp
parents: 640
diff changeset
1562 do_menu_Brightness:
5b7fe7777425 3.16 release
heinrichs weikamp
parents: 640
diff changeset
1563 MENU_BEGIN tBright, .3
5b7fe7777425 3.16 release
heinrichs weikamp
parents: 640
diff changeset
1564 MENU_OPT_INC tDvMode, oBrightness_dive
5b7fe7777425 3.16 release
heinrichs weikamp
parents: 640
diff changeset
1565 MENU_OPT_INC tBrightsurface, oBrightness_surface
5b7fe7777425 3.16 release
heinrichs weikamp
parents: 640
diff changeset
1566 MENU_CALL tBack, do_return_dispsets_menu
5b7fe7777425 3.16 release
heinrichs weikamp
parents: 640
diff changeset
1567 MENU_END
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1568
646
5b7fe7777425 3.16 release
heinrichs weikamp
parents: 640
diff changeset
1569
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1570 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1571 ; Settings Menu - 3rd Layer - Display Settings - Color Schemes
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1572 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1573 do_menu_color_scheme:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1574 bsf imprint_color_schemes ; activate color schemes demonstration
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1575
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1576 ; 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
1577 MENU_BEGIN_OFFSET tColorScheme, .2, .4
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1578 MENU_OPT_INC tColorSetDive, oColorSetDive
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1579 MENU_CALL tBack, do_return_dispsets_menu
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1580 MENU_END
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1581
524
d2e52e6e1604 menu work
heinrichsweikamp
parents: 523
diff changeset
1582
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1583 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1584 ; Settings Menu - 2nd Layer - Display Settings - Page 2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1585 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1586 do_menu_dispsets_more:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1587 IFDEF _helium
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1588 MENU_BEGIN tDispSets, .7
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1589 MENU_OPT_INC tVSIgraph, oVSIgraph
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1590 MENU_OPT_INC tVSItext2, oVSItext
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1591 MENU_OPT_INC tShowppO2, oShowppO2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1592 MENU_OPT_INC tDepthWarning, oDepthWarn
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1593 MENU_OPT_INC t2ndDepth, o2ndDepthDisp
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1594 MENU_OPT_INC tTissueGraphics, oTissueGraphics
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1595 MENU_CALL tBack, do_return_menu_settings_deeper
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1596 MENU_END
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
1597 ELSE
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1598 MENU_BEGIN tDispSets, .6
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1599 MENU_OPT_INC tVSIgraph, oVSIgraph
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1600 MENU_OPT_INC tVSItext2, oVSItext
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1601 MENU_OPT_INC tShowppO2, oShowppO2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1602 MENU_OPT_INC tDepthWarning, oDepthWarn
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1603 MENU_OPT_INC t2ndDepth, o2ndDepthDisp
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1604 MENU_CALL tBack, do_return_menu_settings_deeper
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1605 MENU_END
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
1606 ENDIF
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1607
243
ee81f46714cb auto-select correct settings menu
heinrichsweikamp
parents: 240
diff changeset
1608
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1609 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1610 ; return to System Settings Menu from Sub-Sub-Menu
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1611 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1612 do_return_menu_syssets_more_more: ; entry point for returns from reset sub-menu
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1613 call menu_processor_pop ; drop one more stack entry
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1614 ;bra do_return_menu_syssets_more ; continue
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1615
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1616
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1617 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1618 ; return to System Settings Menu from Sub-Menu
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1619 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1620 do_return_menu_syssets_more:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1621 call menu_processor_double_pop ; drop exit line and back to last line
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1622 bra do_menu_syssets ; continue
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1623
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1624
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1625 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1626 ; return to System Settings Menu from Piezo-Sub-Menu
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1627 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1628 do_return_menu_syssets_piezo:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1629 call menu_processor_double_pop ; drop exit line and back to last line
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1630 call TFT_ClearScreen ; clear the screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1631 call piezo_config ; configure buttons
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1632 ;bra do_menu_syssets ; continue
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1633
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1635 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1636 ; Settings Menu - 2nd Layer - System Settings
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1637 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1638 do_menu_syssets:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1639 btfsc battery_gauge_available ; piezo buttons available?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1640 bra do_menu_syssets_piezo ; YES
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1641
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1642 IFDEF _compass
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1643 MENU_BEGIN tSystSets, .4 ; All MENU_CALLs in this menu
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1644 MENU_CALL tCompassMenu, do_menu_compass ; need to stay together on this
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1645 MENU_CALL tLogOffset, do_menu_log_offset ; menu level in order to not
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1646 MENU_CALL tResetMenu, do_menu_reset ; mess up the menu stack on doing
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1647 MENU_CALL tBack, do_return_menu_settings ; the do_return_menu_settings !
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1648 MENU_END
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1649 ELSE
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1650 MENU_BEGIN tSystSets, .3 ; see above
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1651 MENU_CALL tLogOffset, do_menu_log_offset ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1652 MENU_CALL tResetMenu, do_menu_reset ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1653 MENU_CALL tBack, do_return_menu_settings ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1654 MENU_END
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1655 ENDIF ; _compass
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1656
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1657 do_menu_syssets_piezo:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1658 IFDEF _compass
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1659 MENU_BEGIN tSystSets, .5
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1660 MENU_CALL tCompassMenu, do_menu_compass ; see above
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1661 MENU_CALL tLogOffset, do_menu_log_offset ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1662 MENU_CALL tResetMenu, do_menu_reset ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1663 MENU_CALL tPiezo, do_menu_piezo ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1664 MENU_CALL tBack, do_return_menu_settings ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1665 MENU_END
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1666 ELSE
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1667 MENU_BEGIN tSystSets, .4
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1668 MENU_CALL tLogOffset, do_menu_log_offset ; see above
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1669 MENU_CALL tResetMenu, do_menu_reset ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1670 MENU_CALL tPiezo, do_menu_piezo ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1671 MENU_CALL tBack, do_return_menu_settings ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1672 MENU_END
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1673 ENDIF
220
effd7259f5a5 make button sensitivity configurable (cR hardware)
heinrichsweikamp
parents: 218
diff changeset
1674
effd7259f5a5 make button sensitivity configurable (cR hardware)
heinrichsweikamp
parents: 218
diff changeset
1675
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
1676 IFDEF _compass
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
1677
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1678 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1679 ; Settings Menu - 3rd Layer - System Settings - Compass
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1680 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1681 do_menu_compass:
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
1682 MENU_BEGIN tCompassMenu, .5
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1683 MENU_CALL tCompassCalibration, do_compass_calibration
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1684 ; MENU_OPT_INC tCompassGain, oCompassGain
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1685 MENU_DYNAMIC dyn_compass_cal_x, 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1686 MENU_DYNAMIC dyn_compass_cal_y, 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1687 MENU_DYNAMIC dyn_compass_cal_z, 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1688 MENU_CALL tBack, do_return_menu_syssets_more
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1689 MENU_END
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1690
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1691
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1692 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1693 ; Call Function - start Compass Calibration
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1694 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1695 do_compass_calibration:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1696 goto compass_calibration ; code hosted in compass_ops.asm
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1697
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1698
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1699 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1700 ; dynamic Title - Calibration Value X
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1701 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1702 dyn_compass_cal_x:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1703 STRCAT_TEXT tCalX ; print label
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1704 lfsr FSR0,compass_CX_f ; address calibration value X
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1705 bra dyn_compass_cal_common ; continue with common part
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1706
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1707
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1708 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1709 ; dynamic Title - Calibration Value Y
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1710 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1711 dyn_compass_cal_y:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1712 STRCAT_TEXT tCalY ; print label
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1713 lfsr FSR0,compass_CY_f ; address calibration value Y
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1714 bra dyn_compass_cal_common ; continue with common part
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1715
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1716
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1717 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1718 ; dynamic Title - Calibration Value Z
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1719 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1720 dyn_compass_cal_z:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1721 STRCAT_TEXT tCalZ ; print label
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1722 lfsr FSR0,compass_CZ_f ; address calibration value Z
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1723 ;bra dyn_compass_cal_common ; continue with common part
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1724
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1725
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1726 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1727 ; Helper Function to dynamic Titles - Calibration Value
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1728 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1729 dyn_compass_cal_common:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1730 movff POSTINC0,lo ; read calibration value, low byte
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1731 movff POSTINC0,hi ; read calibration value, high byte
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1732 PUTC ':' ; print ":"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1733 PUTC ' ' ; print a space
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1734 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
1735 btfsc neg_flag ; value negative?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1736 bra dyn_compass_cal_common_1 ; YES - print value
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1737 PUTC '+' ; NO - add a plus sign
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1738 dyn_compass_cal_common_1:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1739 output_65535 ; print value
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1740 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1741
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
1742 ENDIF ; _compass
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
1743
18
4e3f133dfbf4 add new opt_compass_gain option to work with more magnetic battery types
heinrichsweikamp
parents: 0
diff changeset
1744
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1745 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1746 ; Settings Menu - 3rd Layer - System Settings - Logbook Offset
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1747 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1748 do_menu_log_offset:
63
5c4d4a42e7a0 allow logbook erase from reset menu
heinrichsweikamp
parents: 50
diff changeset
1749
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1750 clrf WREG ; select an initial step size of 1
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1751 movff WREG,opt_logoffset_step ; bank-safe write to option variable (volatile option)
0
heinrichsweikamp
parents:
diff changeset
1752
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1753 MENU_BEGIN tLogOffset, .5
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1754 MENU_DYNAMIC dyn_logoffset_show_value, 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1755 MENU_OPT_INC tLogOffStepSize, oLogOffsetStep
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1756 MENU_CALL tLogOffsetplus, do_log_offset_plus
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1757 MENU_CALL tLogOffsetminus, do_log_offset_minus
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1758 MENU_CALL tBack, do_return_menu_syssets_more
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1759 MENU_END
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1760
0
heinrichsweikamp
parents:
diff changeset
1761
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1762 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1763 ; dynamic Title - show Logbook Offset
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1764 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1765 dyn_logoffset_show_value:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1766 STRCPY_TEXT tLogOffsetValue ; print "Offset" in selected language
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1767 call eeprom_log_offset_read ; read offset into lo:hi
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1768 output_9999 ; print offset (0-9999)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1769 return ; no "_PRINT" here...
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 ; Call Function - increment Logbook Offset
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1774 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1775 do_log_offset_plus:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1776 rcall do_logoffset_common ; load current offset and step size
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1777 ; add step size to current offset
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1778 movf mpr+2,W ; get step size, low byte
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1779 addwf mpr+0,F ; add to offset, low byte
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1780 movf mpr+3,W ; get step size, high byte
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1781 addwfc mpr+1,F ; add to offset, high byte, considering carry flag
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1782 ; check if new offset is within limit
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1783 MOVLI .9999,sub_a ; load max limit into sub_a
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1784 MOVII mpr, sub_b ; copy new offset into sub_b
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1785 call cmpU16 ; compute sub_a - sub_b, setting neg_flag if result becomes negative
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1786 btfss neg_flag ; neg_flag set, i.e. new offset > 9999 ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1787 bra do_logoffset_exit ; NO - store offset and return
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1788 MOVLI .9999,mpr ; YES - limit offset to 9999
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1789 bra do_logoffset_exit ; - store offset and return
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1790
0
heinrichsweikamp
parents:
diff changeset
1791
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1792 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1793 ; Call Function - decrement Logbook Offset
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1794 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1795 do_log_offset_minus:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1796 rcall do_logoffset_common ; load current offset and step size
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1797 ; subtract step size from current offset
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1798 movf mpr+2,W ; get step size, low byte
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1799 subwf mpr+0,F ; subtract from offset, low byte
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1800 movf mpr+3,W ; get step size, high byte
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1801 subwfb mpr+1,F ; subtract from offset, high byte, considering borrow flag
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1802 ; check if new offset is within limit
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1803 btfsc STATUS,C ; borrow to propagate (B == /CARRY) ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1804 bra do_logoffset_exit ; NO - result >= 0, store and return
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1805 ;bra do_logoffset_reset ; YES - revert offset to 0
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 ; Helper Functions - Logbook Offset Reset & Write-Back
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1810 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1811 do_logoffset_reset:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1812 CLRI mpr ; set offset to 0
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1813 do_logoffset_exit:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1814 goto eeprom_log_offset_write ; store offset and return
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1815
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1816
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1817 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1818 ; Helper Function - compute Step Size
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1819 ;
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
1820 do_logoffset_common:
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
1821 call eeprom_log_offset_read ; read current offset into mpr+1:mpr+0
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
1822 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
1823 incf ul,F ; 0...3 -> 1...4
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
1824 clrf mpr+3 ; clear step size, high byte
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
1825 movlw .1 ; set a step size of 1
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
1826 movwf mpr+2 ; copy to step size, low byte
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
1827 dcfsnz ul,F ; ul--, did ul became 0, i.e. step size = 1 ?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
1828 return ; YES - done
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
1829 movlw .10 ; NO - set a step size of 10
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
1830 movwf mpr+2 ; - copy to step size, low byte
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
1831 dcfsnz ul,F ; ul--, did ul became 0, i.e. step size = 10 ?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
1832 return ; YES - done
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
1833 movlw .100 ; NO - set a step size of 100
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
1834 movwf mpr+2 ; - copy to step size, low byte
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
1835 dcfsnz ul,F ; ul--, did ul became 0, i.e. step size = 100 ?
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
1836 return ; YES - done
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1837 movlw LOW .1000 ; NO - set a step size of 1000, low byte
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1838 movwf mpr+2 ; - copy to step size, low byte
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
1839 movlw HIGH .1000 ; - set a step size of 1000, high byte
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
1840 movwf mpr+3 ; - copy to step size, high byte
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
1841 return ; - done
0
heinrichsweikamp
parents:
diff changeset
1842
heinrichsweikamp
parents:
diff changeset
1843
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1844 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1845 ; Settings Menu - 3rd Layer - System Settings - adjust Piezo Buttons
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1846 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1847 do_menu_piezo:
640
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 638
diff changeset
1848 MENU_BEGIN tPiezo, .5
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 638
diff changeset
1849 MENU_CALL tButtonExplain1, 0
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 638
diff changeset
1850 MENU_CALL tButtonExplain2, 0
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1851 MENU_OPT_INC tButtonleft, ocR_button_left ; left button sensitivity
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1852 MENU_OPT_INC tButtonright, ocR_button_right ; right button sensitivity
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1853 MENU_CALL tBack, do_return_menu_syssets_piezo
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1854 MENU_END
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
1855
0
heinrichsweikamp
parents:
diff changeset
1856
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1857 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1858 ; Settings Menu - 3rd Layer - System Settings - Reset Menus
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1859 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1860 do_menu_reset:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1861 MENU_BEGIN tResetMenu, .6
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1862 MENU_CALL tBack, do_return_menu_syssets_more
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1863 MENU_CALL tReboot, do_menu_reset_reboot ; confirm
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1864 MENU_CALL tResetDeco, do_menu_reset_deco ; confirm
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1865 MENU_CALL tResetSettings, do_menu_reset_settings ; confirm
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1866 MENU_CALL tResetLogbook, do_menu_reset_logbook ; confirm
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1867 MENU_CALL tResetBattery, do_menu_reset_battery ; confirm
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1868 MENU_END
0
heinrichsweikamp
parents:
diff changeset
1869
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1870
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1871 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1872 ; Settings Menu - 4th Layer - System Settings - Reset - Reboot / FW Recovery
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1873 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1874 do_menu_reset_reboot:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1875 IFDEF _firmware_recovery
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1876 MENU_BEGIN tResetMenu2, .4
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1877 MENU_CALL tAbort, do_return_menu_syssets_more_more
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1878 MENU_CALL tRebootCurFirmware, do_reboot ; reboot current firmware
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1879 MENU_DYNAMIC dyn_menu_fw_backup, do_firmware_backup ; backup current firmware
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1880 MENU_DYNAMIC dyn_menu_fw_restore, do_firmware_restore ; restore backup firmware
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1881 MENU_END
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
1882 ELSE
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1883 MENU_BEGIN tResetMenu2, .2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1884 MENU_CALL tAbort, do_return_menu_syssets_more_more
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1885 MENU_CALL tReboot, do_reboot ; reboot (cold start)
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
1886 MENU_END
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
1887 ENDIF
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1888
335
3d43da7acfe1 Always show ppO2 (warning position, standard color) option
janos_kovacs <kovjanos@gmail.com>
parents: 333
diff changeset
1889
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1890 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1891 ; Call Function - Reboot
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1892 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1893 do_reboot:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1894 call ext_flash_enable_protection ; set write protection on external flash
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1895 call eeprom_deco_data_write ; update deco data in EEPROM
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1896 call eeprom_battery_gauge_write ; update battery gauge in EEPROM
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1897 btfsc option_changed ; do the options need to be stored to EEPROM ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1898 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
1899 reset ; cold-start the processor
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1900
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1901
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1902 IFDEF _firmware_recovery
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1903
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1904 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1905 ; dynamic Title - Firmware Backup Option
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1906 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1907 dyn_menu_fw_backup:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1908 EEPROM_CC_READ eeprom_fw_chksum_current+.5,WREG ; read stored FW ID
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1909 xorlw FW_ID ; XOR with current FW ID, equal?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1910 bnz dyn_menu_fw_backup_unable ; NO - unable to make a backup
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1911 STRCPY_TEXT tBackupFirmware ; YES - print "Backup current Firmware"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1912 return ; - done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1913 dyn_menu_fw_backup_unable:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1914 STRCPY "-------" ; print dashes
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1915 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1916
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1917
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1918 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1919 ; dynamic Title - Firmware Restore Option
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1920 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1921 dyn_menu_fw_restore:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1922 STRCPY_TEXT tRecoverFirmware ; print "Recover"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1923 PUTC " " ; add a space
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1924 PUTC "V" ; add a V for Version
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1925 movlw 0x3C ; address firmware version in backup storage at 0x3C000A
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1926 movwf ext_flash_address+2 ; ...
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1927 clrf ext_flash_address+1 ; ...
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1928 movlw 0x0A ; ...
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1929 movwf ext_flash_address+0 ; ...
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1930 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
1931 infsnz lo,W ; major = 0xFF ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1932 bra dyn_menu_fw_restore_inop ; YES - no version to show
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1933 bsf leftbind ; NO - print left-aligned
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1934 output_99 ; - print major (0-99)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1935 PUTC '.' ; - add a dot
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1936 movff hi,lo ; - get minor
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1937 output_99x ; - print minor (00-99)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1938 PUTC ' ' ; - add a space
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1939 movff up,lo ; - get beta/release
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1940 tstfsz lo ; - release version?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1941 bra dyn_menu_fw_restore_beta ; - NO - beta
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1942 STRCAT "Rel." ; - YES - append "Rel(ease)"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1943 return ; - done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1944 dyn_menu_fw_restore_beta:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1945 PUTC 'B' ; append "B(eta)"
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1946 bsf leftbind ; print left-aligned
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1947 output_256 ; print beta version (0-255)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1948 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1949 dyn_menu_fw_restore_inop:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1950 STRCAT "--.--" ; no recovery firmware available
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1951 return ; done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1952
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1953
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1954 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1955 ; Call Function - backup Firmware
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1956 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1957 do_firmware_backup:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1958 EEPROM_CC_READ eeprom_fw_chksum_current+.5,WREG ; read stored FW ID
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1959 xorlw FW_ID ; XOR with current FW ID, equal?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1960 bnz do_firmware_abort ; NO - abort
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1961 call TFT_ClearScreen ; YES - clear the screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1962 WIN_SMALL .0, .100 ; - set position
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1963 STRCPY_TEXT_PRINT tBackingUp ; - print "backing up..."
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1964 call copy_fw_active_to_backup ; - copy 0x3Exxxx -> 0x3Cxxxx
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1965 EEPROM_RR_READ eeprom_fw_chksum_current,buffer,.6 ; - retrieve checksum of current firmware
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1966 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
1967 bra do_return_menu_syssets_more_more ; - done
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1968
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1969
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1970 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1971 ; Call Function - restore Firmware
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1972 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1973 do_firmware_restore:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1974 EXT_FLASH_ADDR 0x3C000A ; address firmware version in backup storage at 0x3C000A
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1975 FLASH_CW_READ_0x40 ; read backup firmware major version into WREG
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1976 infsnz WREG ; major = 0xFF ?
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1977 bra do_firmware_abort ; YES - abort, no firmware available for restoration
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1978 call TFT_ClearScreen ; NO - clear the screen
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1979 WIN_SMALL .0, .100 ; - set position
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1980 STRCPY_TEXT_PRINT tRestoring ; - print "restoring..."
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1981 call copy_fw_backup_to_active ; - copy 0x3Cxxxx -> 0x3Exxxx
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1982 EEPROM_RR_READ eeprom_fw_chksum_recovry,buffer,.6 ; - retrieve checksum of recovery firmware
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1983 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
1984 goto comm_firmware_update_exec ; - initiate firmware update
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1985
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1986
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1987 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1988 ; Helper Function - back to same menu
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1989 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1990 do_firmware_abort:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1991 call menu_processor_pop ; back to last line
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1992 bra do_menu_reset_reboot ; back to same menu
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1993
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
1994 ENDIF
0
heinrichsweikamp
parents:
diff changeset
1995
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1996
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1997 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1998 ; Settings Menu - 4th Layer - System Settings - Reset - Reset Deco
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
1999 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2000 do_menu_reset_deco:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2001 MENU_BEGIN tResetMenu2, .2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2002 MENU_CALL tAbort, do_return_menu_syssets_more_more
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2003 MENU_CALL tResetDeco, do_reset_deco ; reset deco and return to main reset menu
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2004 MENU_END
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2005
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
2006
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2007 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2008 ; Call Function - Reset Deco
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2009 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2010 do_reset_deco:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2011 call deco_clear_tissue ; set all tissues to absolute pressure * N2_ratio (C-code)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2012 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
2013 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
2014 banksel common
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2015 call eeprom_deco_data_write ; store updated deco data into EEPROM
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 Settings
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_settings:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2023 MENU_BEGIN tResetMenu2, .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 tResetSettings, do_reset_settings ; reset all settings and go to surface mode
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
2026 MENU_END
50
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 39
diff changeset
2027
ec4d8503ec45 NEW: user-selectable color schemes
heinrichsweikamp
parents: 39
diff changeset
2028
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2029 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2030 ; Call Function - Reset Settings
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2031 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2032 do_reset_settings:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2033 call TFT_ClearScreen ; clear screen to show start of activity
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2034 call option_reset_all ; reset all options to factory default
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2035 call do_logoffset_reset ; reset log offset
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2036 goto restart ; restart into surface mode
0
heinrichsweikamp
parents:
diff changeset
2037
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2038
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2039 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2040 ; Settings Menu - 4th Layer - System Settings - Reset - Reset Logbook
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2041 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2042 do_menu_reset_logbook:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2043 MENU_BEGIN tResetMenu2, .2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2044 MENU_CALL tAbort, do_return_menu_syssets_more_more
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2045 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
2046 MENU_END
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
2047
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2048
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2049 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2050 ; Call Function - Reset Logbook
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2051 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2052 do_reset_logbook:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2053 call erase_complete_logbook ; erase complete logbook
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2054 bra do_return_menu_syssets_more_more
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2055
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2056
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2057 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2058 ; Settings Menu - 4th Layer - System Settings - Reset - Reset Battery
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2059 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2060 do_menu_reset_battery:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2061 MENU_BEGIN tNewBattTitle, .2
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2062 MENU_CALL tAbort, do_return_menu_syssets_more_more
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2063 MENU_CALL tYes, do_new_battery_select
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2064 MENU_END
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2065
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2066
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2067 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2068 ; Entry Point for Battery Selection after Power-Outage
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2069 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2070 global new_battery_select
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2071 new_battery_select:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2072 call TFT_boot ; initialize TFT (includes clear screen)
640
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 638
diff changeset
2073 call TFT_load_std_color_pallet ; load standard color pallet
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2074 call TFT_Display_FadeIn ; dim up the display
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2075 call menu_processor_reset ; reset menu stack
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2076 ;bra do_new_battery_select ; enter menu system
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2077
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2078
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2079 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2080 ; Settings Menu - 5th Layer - System Settings - Reset - Reset - Battery Selection
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2081 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2082 do_new_battery_select:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2083 movlw .100 ; set battery level to full
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2084 movwf batt_percent ; ...
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2085 ; default (in cases of timeout or USB) to use old battery:
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
2086 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
2087
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
2088 IFDEF _screendump
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2089 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
2090 ELSE
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2091 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
2092 ENDIF
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
2093
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2094 ; hardware descriptor: user changeable battery charger supported battery types
614
a32212cd5ea9 work on new battery menu
heinrichsweikamp
parents: 609
diff changeset
2095 ; -------------------------------------------------------------------------------------------------------------------------------------------------------
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2096 ; 0x11: BLE and battery gauge ---> OSTC 2 (old model) NO YES internal 18650
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2097 ; 0x05: analog input and battery gauge ---> OSTC 2 cR NO YES internal 18650
640
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 638
diff changeset
2098 ; 0x15: BLE and analog input and battery gauge ---> OSTC 2 cR (2020 model) NO YES internal 18650
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2099 ; 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
2100 ; 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
2101 ; +-> OSTC Plus YES YES 1.5V ----- NO! ----- 3.6V rechargeable
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2102 ; 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
2103 ; 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
2104 ; 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
2105 ; 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
2106
635
9a64914a8fca 3.10 re-release addressing some minor issues and language fixes
heinrichsweikamp
parents: 634
diff changeset
2107 movlw 0x11 ; OSTC 2 (2015 model)
9a64914a8fca 3.10 re-release addressing some minor issues and language fixes
heinrichsweikamp
parents: 634
diff changeset
2108 cpfseq HW_descriptor
9a64914a8fca 3.10 re-release addressing some minor issues and language fixes
heinrichsweikamp
parents: 634
diff changeset
2109 bra $+4
9a64914a8fca 3.10 re-release addressing some minor issues and language fixes
heinrichsweikamp
parents: 634
diff changeset
2110 bra use_18650_battery
9a64914a8fca 3.10 re-release addressing some minor issues and language fixes
heinrichsweikamp
parents: 634
diff changeset
2111
9a64914a8fca 3.10 re-release addressing some minor issues and language fixes
heinrichsweikamp
parents: 634
diff changeset
2112 movlw 0x91 ; OSTC 2 (2015 model) with block write
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2113 cpfseq HW_descriptor
614
a32212cd5ea9 work on new battery menu
heinrichsweikamp
parents: 609
diff changeset
2114 bra $+4
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2115 bra use_18650_battery
614
a32212cd5ea9 work on new battery menu
heinrichsweikamp
parents: 609
diff changeset
2116
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2117 movlw 0x05 ; OSTC 2 cR
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2118 cpfseq HW_descriptor
614
a32212cd5ea9 work on new battery menu
heinrichsweikamp
parents: 609
diff changeset
2119 bra $+4
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2120 bra use_18650_battery
76
a5ea132770db 1.21 release
heinrichsweikamp
parents: 66
diff changeset
2121
640
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 638
diff changeset
2122 movlw 0x15 ; OSTC 2 cR (2020 model)
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 638
diff changeset
2123 cpfseq HW_descriptor
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 638
diff changeset
2124 bra $+4
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 638
diff changeset
2125 bra use_18650_battery
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 638
diff changeset
2126
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 638
diff changeset
2127
635
9a64914a8fca 3.10 re-release addressing some minor issues and language fixes
heinrichsweikamp
parents: 634
diff changeset
2128 movlw 0x85 ; OSTC 2 cR with block write
9a64914a8fca 3.10 re-release addressing some minor issues and language fixes
heinrichsweikamp
parents: 634
diff changeset
2129 cpfseq HW_descriptor
9a64914a8fca 3.10 re-release addressing some minor issues and language fixes
heinrichsweikamp
parents: 634
diff changeset
2130 bra $+4
9a64914a8fca 3.10 re-release addressing some minor issues and language fixes
heinrichsweikamp
parents: 634
diff changeset
2131 bra use_18650_battery
9a64914a8fca 3.10 re-release addressing some minor issues and language fixes
heinrichsweikamp
parents: 634
diff changeset
2132
9a64914a8fca 3.10 re-release addressing some minor issues and language fixes
heinrichsweikamp
parents: 634
diff changeset
2133 movlw 0xB3 ; OSTC 2 TR
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2134 cpfseq HW_descriptor
614
a32212cd5ea9 work on new battery menu
heinrichsweikamp
parents: 609
diff changeset
2135 bra $+4
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2136 bra do_use_16650_battery
614
a32212cd5ea9 work on new battery menu
heinrichsweikamp
parents: 609
diff changeset
2137
637
cdff88f5a4a0 Battery menu for OSTC plus
heinrichsweikamp
parents: 635
diff changeset
2138 movlw 0x93 ; OSTC Plus and OSTC 2 (2017 model)
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2139 cpfseq HW_descriptor
614
a32212cd5ea9 work on new battery menu
heinrichsweikamp
parents: 609
diff changeset
2140 bra $+4
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2141 bra do_menu_new_battery_AA_charger
614
a32212cd5ea9 work on new battery menu
heinrichsweikamp
parents: 609
diff changeset
2142
640
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 638
diff changeset
2143 movlw 0x13 ; OSTC Plus and OSTC 2 (2017 model), w/o block write
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2144 cpfseq HW_descriptor
614
a32212cd5ea9 work on new battery menu
heinrichsweikamp
parents: 609
diff changeset
2145 bra $+4
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2146 bra do_menu_new_battery_AA_charger
614
a32212cd5ea9 work on new battery menu
heinrichsweikamp
parents: 609
diff changeset
2147
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2148
640
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 638
diff changeset
2149 movlw 0x0A ; OSTC 3 (USB model)
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 638
diff changeset
2150 cpfseq HW_descriptor
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 638
diff changeset
2151 bra $+4
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 638
diff changeset
2152 bra do_menu_new_battery_AA_no_charge
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 638
diff changeset
2153
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 638
diff changeset
2154 movlw 0x1A ; OSTC 3 (BLE model)
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 638
diff changeset
2155 cpfseq HW_descriptor
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 638
diff changeset
2156 bra $+4
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 638
diff changeset
2157 bra do_menu_new_battery_AA_no_charge
614
a32212cd5ea9 work on new battery menu
heinrichsweikamp
parents: 609
diff changeset
2158
640
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 638
diff changeset
2159 movlw 0x02 ; OSTC Sport (USB model)
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 638
diff changeset
2160 cpfseq HW_descriptor
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 638
diff changeset
2161 bra $+4
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 638
diff changeset
2162 bra do_menu_new_battery_AA_no_charge
614
a32212cd5ea9 work on new battery menu
heinrichsweikamp
parents: 609
diff changeset
2163
640
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 638
diff changeset
2164 movlw 0x52 ; OSTC Sport (BLE model)
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 638
diff changeset
2165 cpfseq HW_descriptor
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 638
diff changeset
2166 bra $+4
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 638
diff changeset
2167 bra do_menu_new_battery_AA_no_charge
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2168
640
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 638
diff changeset
2169 bra do_menu_new_battery_other_model ; any other model
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
2170
614
a32212cd5ea9 work on new battery menu
heinrichsweikamp
parents: 609
diff changeset
2171
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2172 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2173 ; return from confirm 3.6 V rechargeable
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2174 ;
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2175 do_return_menu_new_bat_AA_chrg:
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2176 call menu_processor_double_pop ; drop exit line and back to last line
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2177 ;bra do_menu_new_battery_AA_charger ; continue
614
a32212cd5ea9 work on new battery menu
heinrichsweikamp
parents: 609
diff changeset
2178
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2179 ;-----------------------------------------------------------------------------
640
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 638
diff changeset
2180 ; Battery Selection for OSTC (Full selection)
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 638
diff changeset
2181
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 638
diff changeset
2182 do_menu_new_battery_other_model:
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 638
diff changeset
2183 MENU_BEGIN tNewBattTitle, .6
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 638
diff changeset
2184 MENU_CALL tNewBattOld, do_use_old_battery ; load data of old battery
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 638
diff changeset
2185 MENU_CALL tNewBattNew15, do_use_15V_disposable ; not rechargeable
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 638
diff changeset
2186 MENU_CALL tNewBattNew36, do_use_36V_disposable ; not rechargeable
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 638
diff changeset
2187 MENU_CALL tNewBattAccu, do_menu_new_battery_36V_charge ; rechargeable -> goto safety question
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 638
diff changeset
2188 MENU_CALL tNew16650, do_use_16650_battery ; OSTC 2 new model
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 638
diff changeset
2189 MENU_CALL tNew18650, use_18650_battery ; OSTC 2 (2015 model)
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 638
diff changeset
2190 MENU_END
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 638
diff changeset
2191
8c1f1f334275 3.13 release
heinrichsweikamp
parents: 638
diff changeset
2192 ;-----------------------------------------------------------------------------
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2193 ; 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
2194 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2195 do_menu_new_battery_AA_charger:
614
a32212cd5ea9 work on new battery menu
heinrichsweikamp
parents: 609
diff changeset
2196 MENU_BEGIN tNewBattTitle, .4
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2197 MENU_CALL tNewBattOld, do_use_old_battery ; load data of old battery
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2198 MENU_CALL tNewBattNew15, do_use_15V_disposable ; not rechargeable
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2199 ; MENU_CALL tNewBattNew36, do_use_36V_disposable ; not rechargeable -> not allowed any more !!!
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2200 MENU_CALL tNewBattAccu, do_menu_new_battery_36V_charge ; rechargeable -> goto safety question
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2201 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
2202 MENU_END
a32212cd5ea9 work on new battery menu
heinrichsweikamp
parents: 609
diff changeset
2203
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2204
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2205 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2206 ; Safety Question for 3.6 V rechargeable Battery
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2207 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2208 do_menu_new_battery_36V_charge:
614
a32212cd5ea9 work on new battery menu
heinrichsweikamp
parents: 609
diff changeset
2209 MENU_BEGIN tNewBattTitle, .5
a32212cd5ea9 work on new battery menu
heinrichsweikamp
parents: 609
diff changeset
2210 MENU_CALL tConfirmChargeable1, 0 ; safety question, line 1
a32212cd5ea9 work on new battery menu
heinrichsweikamp
parents: 609
diff changeset
2211 MENU_CALL tConfirmChargeable2, 0 ; safety question, line 2
a32212cd5ea9 work on new battery menu
heinrichsweikamp
parents: 609
diff changeset
2212 MENU_CALL tConfirmChargeable3, 0 ; safety question, line 3
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2213 MENU_CALL tNo, do_return_menu_new_bat_AA_chrg ; NO - go back
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2214 MENU_CALL tYes, do_use_36V_chargeable ; YES - confirmed rechargeable
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2215 MENU_END
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2216
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2217
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2218 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2219 ; Battery Selection for OSTC 3 and Sport (no charging function)
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2220 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2221 do_menu_new_battery_AA_no_charge:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2222 MENU_BEGIN tNewBattTitle, .4
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2223 MENU_CALL tNewBattOld, do_use_old_battery ; load data of old battery
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2224 MENU_CALL tNewBattNew15, do_use_15V_disposable ; not rechargeable
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2225 MENU_CALL tNewBattNew36, do_use_36V_disposable ; not rechargeable
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2226 MENU_CALL tNewBattAccu, do_use_36V_chargeable ; rechargeable
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
2227 MENU_END
0
heinrichsweikamp
parents:
diff changeset
2228
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
2229
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2230 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2231 ; Call Function - keep old Battery
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2232 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2233 do_use_old_battery:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2234 rcall get_battery_data ; load data of old battery
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2235 goto surfloop ; proceed to surface mode
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2236
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2237
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2238 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2239 ; Call Function - new 1.5 V disposable
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2240 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2241 do_use_15V_disposable:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2242 rcall setup_new_15v
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2243 bra use_batt_exit
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2244
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2245
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2246 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2247 ; Call Function - new 3.6 V disposable
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2248 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2249 do_use_36V_disposable:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2250 rcall setup_new_saft
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2251 bra use_batt_exit
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2252
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2253
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2254 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2255 ; Call Function - new 3.6 V rechargeable
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2256 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2257 do_use_36V_chargeable:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2258 rcall setup_new_panasonic
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2259 call reset_battery_gauge
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2260 bra use_batt_exit_1
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2261
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2262
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2263 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2264 ; Call Function - build-in 16650
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2265 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2266 do_use_16650_battery:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2267 rcall setup_new_16650
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2268 bra use_batt_exit
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2269
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2270
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2271 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2272 ; Call Function - build-in 18650
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2273 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2274 use_18650_battery:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2275 rcall setup_new_18650
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2276 ;bra use_batt_exit
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2277
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2278
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2279 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2280 ; Helper Function - finish Battery Selection
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2281 ;
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2282 use_batt_exit:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2283 call reset_battery_gauge_and_lt2942 ; reset battery hard- and software gauge
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2284
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2285 use_batt_exit_1:
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2286 IFNDEF _screendump
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2287 bcf comm_mode_disabled ; re-enable COMM mode again
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2288 ENDIF
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2289 goto surfloop ; exit to surface mode
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2290
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2291
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2292 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2293 ; Migrate Battery Selection from Firmwares prior 2.09
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2294 ;
457
b4417044a042 recover old battery status prior 2.09
heinrichsweikamp
parents: 453
diff changeset
2295 global use_old_prior_209
b4417044a042 recover old battery status prior 2.09
heinrichsweikamp
parents: 453
diff changeset
2296 use_old_prior_209:
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
2297 EEPROM_CC_READ eeprom_battery_type,WREG ; read battery type from EEPROM
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
2298 incfsz WREG,W ; battery type = 0xFF (undefined) ?
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
2299 return ; NO - done
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
2300 call lt2942_get_status ; YES - check for gauge IC
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
2301 movlw .3 ; - default to a 18650 (LiIon 3.7V/3.1Ah)
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
2302 btfss battery_gauge_available ; - OSTC 2 or cR hardware?
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
2303 movlw .1 ; - NO - assume a Saft (disposable 3.6 V)
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
2304 EEPROM_CC_WRITE WREG,eeprom_battery_type; - write battery type to EEPROM
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
2305 return ; - done
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
2306
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
2307
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2308 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2309 ; Retrieve Battery Selection from EEPROM
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2310 ;
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2311 global get_battery_data
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2312 get_battery_data:
631
185ba2f91f59 3.09 beta 1 release
heinrichsweikamp
parents: 629
diff changeset
2313 call eeprom_battery_gauge_read ; retrieve stored battery gauge value from EEPROM
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2314 movff battery_type,lo ; copy retrieved battery type to lo
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2315 rcall setup_new_saft ; default battery configuration
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2316 incf lo,F ; (0-4) -> (1-5)
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2317 dcfsnz lo,F
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2318 rcall setup_new_15v ; =0
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2319 dcfsnz lo,F
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2320 rcall setup_new_saft ; =1
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2321 dcfsnz lo,F
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2322 rcall setup_new_panasonic ; =2
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2323 dcfsnz lo,F
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2324 rcall setup_new_18650 ; =3
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2325 dcfsnz lo,F
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2326 rcall setup_new_16650 ; =4
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2327 bcf use_old_batt_flag ; clear flag
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2328 IFNDEF _screendump
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2329 bcf comm_mode_disabled ; re-enable COMM mode again
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2330 ENDIF
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2331 return ; done
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2332
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2333
634
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2334 ;-----------------------------------------------------------------------------
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2335 ; Helper Functions - configure Battery Types
4050675965ea 3.10 stable release
heinrichsweikamp
parents: 631
diff changeset
2336
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2337 ; 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
2338 setup_new_15v:
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2339 bsf charge_disable ; set charging-inhibit signal
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2340 bcf charge_enable ; activate charging-inhibit signal
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
2341 movlw .100
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 600
diff changeset
2342 movwf batt_percent ; to have 1.5V batteries right after firmware update
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
2343 movlw .0
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2344 movwf battery_type
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2345 return
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2346
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2347 ; disposable 3.6 Volt Lithium
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2348 setup_new_saft:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2349 bsf charge_disable ; set charging-inhibit signal
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2350 bcf charge_enable ; activate charging-inhibit signal
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2351 MOVLI capacity_saft_internal, battery_capacity_internal
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2352 MOVLI capacity_saft, battery_capacity
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2353 MOVLI offset_saft, battery_offset
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2354 movlw .1
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2355 movwf battery_type
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2356 return
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2357
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2358 ; rechargeable user-changeable 3.7 Volt Lithium-ion
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2359 setup_new_panasonic:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2360 bcf charge_disable ; release charging-inhibit signal
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2361 bsf charge_enable ; tristate charging-inhibit signal
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2362 MOVLI capacity_panasonic_internal, battery_capacity_internal
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2363 MOVLI capacity_panasonic, battery_capacity
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2364 MOVLI offset_panasonic, battery_offset
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2365 movlw .2
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2366 movwf battery_type
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2367 return
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2368
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2369 ; rechargeable internal Lithium-ion
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2370 setup_new_18650:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2371 bcf charge_disable ; release charging-inhibit signal
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2372 bsf charge_enable ; tristate charging-inhibit signal
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2373 CLRI battery_capacity_internal
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2374 MOVLI capacity_ncr18650, battery_capacity
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2375 MOVLI offset_ncr18650, battery_offset
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2376 movlw .3
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2377 movwf battery_type
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2378 return
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2379
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2380 ; rechargeable internal Lithium-ion
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2381 setup_new_16650:
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2382 bcf charge_disable ; release charging-inhibit signal
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2383 bsf charge_enable ; tristate charging-inhibit signal
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2384 CLRI battery_capacity_internal
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2385 MOVLI capacity_ur16650, battery_capacity
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2386 MOVLI offset_ur16650, battery_offset
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2387 movlw .4
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2388 movwf battery_type
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
2389 return
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
2390
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2391 ;-----------------------------------------------------------------------------
0
heinrichsweikamp
parents:
diff changeset
2392
623
c40025d8e750 3.03 beta released
heinrichsweikamp
parents: 618
diff changeset
2393 END