annotate src/menu_tree.asm @ 653:8bcd138ab744

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