Mercurial > public > mk2
annotate code_part1/OSTC_code_asm_part1/divemode_menu.asm @ 644:420e62cd88ad
point to correct diluent location
author | heinrichsweikamp |
---|---|
date | Wed, 03 Oct 2012 13:12:02 +0200 |
parents | 3b50c9949b84 |
children | e6ac142e82b0 |
rev | line source |
---|---|
0 | 1 ; OSTC - diving computer code |
2 ; Copyright (C) 2008 HeinrichsWeikamp GbR | |
3 | |
4 ; This program is free software: you can redistribute it and/or modify | |
5 ; it under the terms of the GNU General Public License as published by | |
6 ; the Free Software Foundation, either version 3 of the License, or | |
7 ; (at your option) any later version. | |
8 | |
9 ; This program is distributed in the hope that it will be useful, | |
10 ; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 ; GNU General Public License for more details. | |
13 | |
14 ; You should have received a copy of the GNU General Public License | |
15 ; along with this program. If not, see <http://www.gnu.org/licenses/>. | |
16 | |
17 | |
18 ; Underwater Menu (Set Gas, Decoplan, etc.) | |
19 ; written by: Matthias Heinrichs, info@heinrichsweikamp.com | |
20 ; written: 11/11/05 | |
21 ; last updated: 090305 | |
22 ; known bugs: | |
23 ; ToDo: | |
24 | |
25 | |
112 | 26 test_switches_divemode: ; checks switches in divemode |
337 | 27 btfsc uart_dump_screen ; Asked to dump screen contains ? |
28 call dump_screen ; Yes! | |
29 | |
0 | 30 btfsc switch_left |
31 bra test_switches_divemode2 | |
32 | |
33 btfss switch_right | |
34 return | |
576 | 35 |
36 call wait_switches ; Waits until switches are released, resets flag if button stays pressed! | |
0 | 37 |
38 bcf select_bailoutgas ; Clear Flag for Bailout list | |
277
46d1012d096a
Quick-access to menupos3 in divemode - ToDo: EAD and END in CCR mode
heinrichsweikamp
parents:
274
diff
changeset
|
39 |
46d1012d096a
Quick-access to menupos3 in divemode - ToDo: EAD and END in CCR mode
heinrichsweikamp
parents:
274
diff
changeset
|
40 btfsc premenu ; Pre-Menu? already shown? |
46d1012d096a
Quick-access to menupos3 in divemode - ToDo: EAD and END in CCR mode
heinrichsweikamp
parents:
274
diff
changeset
|
41 bra test_switches_divemode0 ; Yes, check if we should jump to menu Entry3 |
46d1012d096a
Quick-access to menupos3 in divemode - ToDo: EAD and END in CCR mode
heinrichsweikamp
parents:
274
diff
changeset
|
42 |
46d1012d096a
Quick-access to menupos3 in divemode - ToDo: EAD and END in CCR mode
heinrichsweikamp
parents:
274
diff
changeset
|
43 test_switches_divemode_a: |
46d1012d096a
Quick-access to menupos3 in divemode - ToDo: EAD and END in CCR mode
heinrichsweikamp
parents:
274
diff
changeset
|
44 |
0 | 45 bsf premenu ; Set Flag for premenu |
46 bcf menubit | |
47 clrf timeout_counter3 ; timeout_divemenu | |
48 | |
49 btfsc FLAG_apnoe_mode ; In Apnoe mode? | |
50 bra test_switches_divemode1 ; Yes! | |
51 | |
52 WIN_INVERT .1 | |
53 DISPLAYTEXT .4 ;Menu? | |
54 WIN_INVERT .0 | |
55 return | |
56 | |
277
46d1012d096a
Quick-access to menupos3 in divemode - ToDo: EAD and END in CCR mode
heinrichsweikamp
parents:
274
diff
changeset
|
57 test_switches_divemode0: |
46d1012d096a
Quick-access to menupos3 in divemode - ToDo: EAD and END in CCR mode
heinrichsweikamp
parents:
274
diff
changeset
|
58 btfss menu3_active ; Something to do at Menupos=3? |
46d1012d096a
Quick-access to menupos3 in divemode - ToDo: EAD and END in CCR mode
heinrichsweikamp
parents:
274
diff
changeset
|
59 bra test_switches_divemode_a ; No |
46d1012d096a
Quick-access to menupos3 in divemode - ToDo: EAD and END in CCR mode
heinrichsweikamp
parents:
274
diff
changeset
|
60 ; Yes! So show menu and jump to this position |
46d1012d096a
Quick-access to menupos3 in divemode - ToDo: EAD and END in CCR mode
heinrichsweikamp
parents:
274
diff
changeset
|
61 movlw d'3' |
46d1012d096a
Quick-access to menupos3 in divemode - ToDo: EAD and END in CCR mode
heinrichsweikamp
parents:
274
diff
changeset
|
62 movwf menupos |
46d1012d096a
Quick-access to menupos3 in divemode - ToDo: EAD and END in CCR mode
heinrichsweikamp
parents:
274
diff
changeset
|
63 bra test_switches_divemode2b ; Show menu with cursor at menupos=3 |
46d1012d096a
Quick-access to menupos3 in divemode - ToDo: EAD and END in CCR mode
heinrichsweikamp
parents:
274
diff
changeset
|
64 |
0 | 65 test_switches_divemode1: |
66 DISPLAYTEXT .141 ;Quit? | |
67 return | |
68 | |
69 test_switches_divemode2: | |
576 | 70 call wait_switches ; Waits until switches are released, resets flag if button stays pressed! |
0 | 71 |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
87
diff
changeset
|
72 btfsc premenu |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
87
diff
changeset
|
73 bra test_switches_divemode2_2 |
109
6e635bf5b7a7
fixed double-effect of ENTER button in divemode
heinrichsweikamp
parents:
107
diff
changeset
|
74 btfsc menubit |
6e635bf5b7a7
fixed double-effect of ENTER button in divemode
heinrichsweikamp
parents:
107
diff
changeset
|
75 bra test_switches_divemode2_2 ; Not in Premenu or Menu... |
0 | 76 |
112 | 77 bsf toggle_customview ; Toggle customview (Cleared in customview.asm) |
78 | |
79 btfsc standalone_simulator ; Standalone Simualtor active? | |
80 bra divemode_menu_simulator ; Yes, Show simulator menu! | |
81 return | |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
87
diff
changeset
|
82 |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
87
diff
changeset
|
83 test_switches_divemode2_2: |
0 | 84 btfss FLAG_apnoe_mode ; In Apnoe mode? |
85 bra test_switches_divemode2a; No! | |
86 | |
87 ; Yes, so quit Apnoe mode at once... | |
88 bcf divemode ; Clear Divemode flag... | |
89 bcf premenu ; clear premenu flag | |
90 return | |
91 | |
92 test_switches_divemode2a: | |
277
46d1012d096a
Quick-access to menupos3 in divemode - ToDo: EAD and END in CCR mode
heinrichsweikamp
parents:
274
diff
changeset
|
93 movlw d'1' |
46d1012d096a
Quick-access to menupos3 in divemode - ToDo: EAD and END in CCR mode
heinrichsweikamp
parents:
274
diff
changeset
|
94 movwf menupos ; reset cursor in divemode menu |
46d1012d096a
Quick-access to menupos3 in divemode - ToDo: EAD and END in CCR mode
heinrichsweikamp
parents:
274
diff
changeset
|
95 test_switches_divemode2b: |
0 | 96 bsf menubit ; Enter Divemode-Menu! |
97 bcf premenu ; clear premenu flag | |
98 call PLED_clear_divemode_menu ; Clear dive mode menu area | |
99 call PLED_divemode_menu_mask_first ; Write Divemode menu1 mask | |
100 bcf display_set_simulator ; Clear Simulator-Menu flag | |
101 call PLED_divemenu_cursor ; show cursor | |
576 | 102 call wait_switches ; Waits until switches are released, resets flag if button stays pressed! |
0 | 103 return |
104 | |
105 test_switches_divemode_menu: | |
337 | 106 btfsc uart_dump_screen ; Asked to dump screen contains ? |
107 call dump_screen ; Yes! | |
108 | |
0 | 109 btfsc switch_left |
110 bra test_switches_divemode_menu3 | |
111 btfss switch_right | |
112 return | |
113 | |
114 btfsc display_see_deco ; Is the Decoplan displayed? | |
115 bra divemenu_see_decoplan2 ; Yes, exit menu on left button press | |
116 | |
117 bcf switch_right ; Left button pressed | |
118 clrf timeout_counter3 ; timout_divemenu! | |
119 incf menupos,F | |
120 | |
121 ; Following routine configures the number of menu entries for the different modes | |
122 movlw d'6' ; number of available gases+1, ; number of menu options+1 | |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
87
diff
changeset
|
123 btfsc display_set_gas ; Are we in the "Gaslist" menu? |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
87
diff
changeset
|
124 movlw d'7' ; Yes, Number of entries for this menu+1 = 7 |
0 | 125 btfsc display_set_setpoint ; In SetPoint Menu? |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
87
diff
changeset
|
126 movlw d'5' ; Number of entries for this menu+1 = 5 |
219
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
127 btfsc display_set_active ; De/Activate gases underwater menu is visible? |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
128 movlw d'7' ; Number of entries for this menu+1 = 7 |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
129 btfsc display_set_xgas ; Are we in the Gas6 menu? |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
130 movlw d'7' ; Number of entries for this menu+1 = 7 |
352
544a96faa9f3
New "Quit sim" option in simulated dive mode, CF02 now allows more then 240seconds, Bugfix with runtime=1min in runtime simulator
Heinrichsweikamp
parents:
337
diff
changeset
|
131 btfsc display_set_simulator ; Are we in the simulator menu? |
544a96faa9f3
New "Quit sim" option in simulated dive mode, CF02 now allows more then 240seconds, Bugfix with runtime=1min in runtime simulator
Heinrichsweikamp
parents:
337
diff
changeset
|
132 movlw d'7' ; Number of entries for this menu+1 = 7 |
0 | 133 cpfseq menupos ; =limit? |
134 bra test_switches_divemode_menu1; No! | |
135 movlw d'1' ; Yes, reset to position 1! | |
136 movwf menupos | |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
87
diff
changeset
|
137 |
0 | 138 test_switches_divemode_menu1: |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
87
diff
changeset
|
139 ; Finally, check if menuposition 3 should be skipped (No customview with function displayed) |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
87
diff
changeset
|
140 |
219
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
141 btfsc display_set_gas ; Are we in the "Gaslist", "SetPoint" or De/Activate gases menu? |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
87
diff
changeset
|
142 bra test_switches_divemode_menu1a ; Skip test for sub menus |
219
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
143 btfsc display_set_xgas ; Are we in the "Gaslist", "SetPoint" or De/Activate gases menu? |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
144 bra test_switches_divemode_menu1a ; Skip test for sub menus |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
145 btfsc display_set_active ; Are we in the "Gaslist", "SetPoint" or De/Activate gases menu? |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
87
diff
changeset
|
146 bra test_switches_divemode_menu1a ; Skip test for sub menus |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
87
diff
changeset
|
147 |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
87
diff
changeset
|
148 movlw d'3' |
219
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
149 cpfseq menupos ; At position 3? |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
150 bra test_switches_divemode_menu1a ; No |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
151 btfss menu3_active ; Menu position 3 has functionality? |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
152 incf menupos,F ; No, +1, skip to menuos=4 |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
87
diff
changeset
|
153 |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
87
diff
changeset
|
154 test_switches_divemode_menu1a: |
0 | 155 call PLED_divemenu_cursor ; update cursor |
528
67ab3c028bc2
Show change gas depth below gaslist (in divemode)
heinrichsweikamp
parents:
525
diff
changeset
|
156 btfsc display_set_gas ; In Gaslist or Setpoint list menu? |
67ab3c028bc2
Show change gas depth below gaslist (in divemode)
heinrichsweikamp
parents:
525
diff
changeset
|
157 call PLED_show_change_depth ; Yes, show change depth for gas #menupos |
0 | 158 return |
159 | |
160 test_switches_divemode_menu3: | |
576 | 161 call wait_switches ; Waits until switches are released, resets flag if button stays pressed! |
0 | 162 bsf menubit ; Enter Divemode-Menu! |
163 bcf premenu ; clear premenu flag | |
164 clrf timeout_counter3 | |
165 | |
166 btfsc display_set_gas ; Are we in the "Gaslist" or "SetPoint" menu? | |
167 bra divemenu_set_gas2 ; Yes, so set gas and exit menu | |
168 | |
169 btfsc display_see_deco ; Is the Decoplan displayed? | |
170 bra divemenu_see_decoplan2 ; Yes, exit menu on right button press | |
171 | |
172 btfsc display_set_xgas ; Are we in the "Set Gas" menu? | |
173 bra divemenu_set_xgas2 ; Yes, so configure gas or set menu and exit menu | |
174 | |
219
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
175 btfsc display_set_active ; Are we in the "De/Activate gases menu?" menu? |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
176 bra divemenu_de_activate2 ; Yes, so toggle active flag |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
177 |
0 | 178 btfsc display_set_simulator ; Are we in the Divemode Simulator menu? |
179 goto divemode_menu_simulator2 ; Yes, so adjust depth or set and exit | |
180 | |
181 ; Options for Menu 1 | |
182 dcfsnz menupos,F | |
73
2227459e8ef2
Exchanged Decoplan and Gaslist in dive mode menu
heinrichsweikamp
parents:
71
diff
changeset
|
183 bra divemenu_set_gas ; Set gas sub-menu |
2227459e8ef2
Exchanged Decoplan and Gaslist in dive mode menu
heinrichsweikamp
parents:
71
diff
changeset
|
184 dcfsnz menupos,F |
0 | 185 bra divemenu_see_decoplan ; display the full decoplan |
186 dcfsnz menupos,F | |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
87
diff
changeset
|
187 bra divemode_menu3 ; Customview-function |
0 | 188 dcfsnz menupos,F |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
87
diff
changeset
|
189 bra divemode_toggle_brightness ; Toggle OLED-Brightness |
0 | 190 dcfsnz menupos,F |
169
e26f49674956
Merge decoplan display for both GF and Buhlmann models.
JeanDo
parents:
124
diff
changeset
|
191 bra timeout_divemenu2 ; Quit divemode menu |
119 | 192 bra timeout_divemenu2 ; Quit divemode menu |
0 | 193 |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
87
diff
changeset
|
194 divemode_menu3: |
479
9fc8feff27a5
Enable reset in cave bailout prediction, by using chrono average depth.
JeanDo
parents:
407
diff
changeset
|
195 dcfsnz menupos3,W ; copy |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
87
diff
changeset
|
196 bra toggle_stopwatch ; Toggle Stopwatch/Average register |
479
9fc8feff27a5
Enable reset in cave bailout prediction, by using chrono average depth.
JeanDo
parents:
407
diff
changeset
|
197 dcfsnz WREG,F |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
87
diff
changeset
|
198 bra set_marker ; Set Marker |
479
9fc8feff27a5
Enable reset in cave bailout prediction, by using chrono average depth.
JeanDo
parents:
407
diff
changeset
|
199 dcfsnz WREG,F |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
87
diff
changeset
|
200 bra divemode_menu3_nothing ; clock... |
479
9fc8feff27a5
Enable reset in cave bailout prediction, by using chrono average depth.
JeanDo
parents:
407
diff
changeset
|
201 dcfsnz WREG,F |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
87
diff
changeset
|
202 bra divemode_menu3_nothing ; leading tissue... |
479
9fc8feff27a5
Enable reset in cave bailout prediction, by using chrono average depth.
JeanDo
parents:
407
diff
changeset
|
203 dcfsnz WREG,F |
9fc8feff27a5
Enable reset in cave bailout prediction, by using chrono average depth.
JeanDo
parents:
407
diff
changeset
|
204 bra divemode_menu3_nothing ; Average depth (not resetable) |
9fc8feff27a5
Enable reset in cave bailout prediction, by using chrono average depth.
JeanDo
parents:
407
diff
changeset
|
205 dcfsnz WREG,F |
9fc8feff27a5
Enable reset in cave bailout prediction, by using chrono average depth.
JeanDo
parents:
407
diff
changeset
|
206 bra divemode_menu3_nothing ; Graphs... |
9fc8feff27a5
Enable reset in cave bailout prediction, by using chrono average depth.
JeanDo
parents:
407
diff
changeset
|
207 dcfsnz WREG,F |
9fc8feff27a5
Enable reset in cave bailout prediction, by using chrono average depth.
JeanDo
parents:
407
diff
changeset
|
208 bra divemode_menu3_nothing ; END/EAD in divemode |
9fc8feff27a5
Enable reset in cave bailout prediction, by using chrono average depth.
JeanDo
parents:
407
diff
changeset
|
209 dcfsnz WREG,F |
525 | 210 bra divemode_menu3_nothing ; Future TTS... |
479
9fc8feff27a5
Enable reset in cave bailout prediction, by using chrono average depth.
JeanDo
parents:
407
diff
changeset
|
211 dcfsnz WREG,F |
9fc8feff27a5
Enable reset in cave bailout prediction, by using chrono average depth.
JeanDo
parents:
407
diff
changeset
|
212 bra toggle_stopwatch ; Cave bailout prediction. |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
87
diff
changeset
|
213 |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
87
diff
changeset
|
214 divemode_menu3_nothing: |
0 | 215 bra timeout_divemenu2 ; Quit divemode menu |
216 | |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
87
diff
changeset
|
217 set_marker: |
169
e26f49674956
Merge decoplan display for both GF and Buhlmann models.
JeanDo
parents:
124
diff
changeset
|
218 movlw d'6' ; Type of Alarm (Manual Marker) |
e26f49674956
Merge decoplan display for both GF and Buhlmann models.
JeanDo
parents:
124
diff
changeset
|
219 movwf AlarmType ; Copy to Alarm Register |
e26f49674956
Merge decoplan display for both GF and Buhlmann models.
JeanDo
parents:
124
diff
changeset
|
220 bsf event_occured ; Set Event Flag |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
87
diff
changeset
|
221 bra timeout_divemenu2 ; quit menu! |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
87
diff
changeset
|
222 |
0 | 223 toggle_stopwatch: |
111 | 224 bsf reset_average_depth ; Average Depth will be resetted in divemode.asm |
0 | 225 bra timeout_divemenu2 ; quit menu! |
226 | |
227 divemode_toggle_brightness: | |
228 read_int_eeprom d'90' ; Brightness offset? (Dim>0, Normal = 0) | |
229 tstfsz EEDATA ; Was dimmed? | |
230 bra divemode_toggle_brightness1 ; Yes... | |
231 | |
232 call PLED_brightness_low | |
233 movlw d'1' | |
234 movwf EEDATA ; Copy to EEDATA | |
235 write_int_eeprom d'90' ; Brightness offset? (Dim=1, Normal = 0) | |
236 bra divemode_toggle_brightness3 | |
237 | |
238 divemode_toggle_brightness1: | |
239 call PLED_brightness_full | |
240 movlw d'0' | |
241 movwf EEDATA ; Copy to EEDATA | |
242 write_int_eeprom d'90' ; Brightness offset? (Dim=1, Normal = 0) | |
243 | |
244 divemode_toggle_brightness3: | |
245 ; Now, redraw all outputs (All modes) | |
246 call PLED_active_gas_divemode ; Display gas, if required | |
247 call PLED_temp_divemode ; Displays temperature | |
248 call PLED_depth ; Displays new depth... | |
249 call PLED_max_pressure ; ...and max. depth | |
250 | |
251 bra timeout_divemenu2 ; quit menu! | |
252 | |
219
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
253 divemenu_de_activate: |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
254 bsf display_set_active ; Set display flag |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
255 bcf display_set_xgas ; Clear Flag |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
256 call PLED_clear_divemode_menu ; Clear Menu |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
257 |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
258 call PLED_de_activelist ; show (de)active gaslist |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
259 |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
260 movlw d'1' |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
261 movwf menupos ; reset cursor |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
262 call PLED_divemenu_cursor ; update cursor |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
263 return |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
264 |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
265 divemenu_de_activate2: ; Toggle active flag |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
266 dcfsnz menupos,F |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
267 bra divemenu_de_activate2_exit ; Exit, Quit, Abort |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
268 dcfsnz menupos,F |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
269 bra divemenu_de_activate2_g1 ; Toggle Gas1 |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
270 dcfsnz menupos,F |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
271 bra divemenu_de_activate2_g2 ; Toggle Gas2 |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
272 dcfsnz menupos,F |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
273 bra divemenu_de_activate2_g3 ; Toggle Gas3 |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
274 dcfsnz menupos,F |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
275 bra divemenu_de_activate2_g4 ; Toggle Gas4 |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
276 dcfsnz menupos,F |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
277 bra divemenu_de_activate2_g5 ; Toggle Gas5 |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
278 return ; should never be here |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
279 |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
280 divemenu_de_activate2_exit: |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
281 bra timeout_divemenu2 ; quit underwater menu! |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
282 |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
283 divemenu_de_activate2_g1: |
290
4dbff2aa31ee
Hunting for refusing to ignore disabled gas in list...
JeanDo
parents:
286
diff
changeset
|
284 btg gaslist_active,0 ; Toggle flag |
219
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
285 movlw d'2' |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
286 movwf menupos ; reset cursor |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
287 call PLED_de_activelist ; show (de)active gaslist |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
288 return |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
289 |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
290 divemenu_de_activate2_g2: |
290
4dbff2aa31ee
Hunting for refusing to ignore disabled gas in list...
JeanDo
parents:
286
diff
changeset
|
291 btg gaslist_active,1 ; Toggle flag |
219
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
292 movlw d'3' |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
293 movwf menupos ; reset cursor |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
294 call PLED_de_activelist ; show (de)active gaslist |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
295 return |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
296 |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
297 divemenu_de_activate2_g3: |
290
4dbff2aa31ee
Hunting for refusing to ignore disabled gas in list...
JeanDo
parents:
286
diff
changeset
|
298 btg gaslist_active,2 ; Toggle flag |
219
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
299 movlw d'4' |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
300 movwf menupos ; reset cursor |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
301 call PLED_de_activelist ; show (de)active gaslist |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
302 return |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
303 |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
304 divemenu_de_activate2_g4: |
290
4dbff2aa31ee
Hunting for refusing to ignore disabled gas in list...
JeanDo
parents:
286
diff
changeset
|
305 btg gaslist_active,3 ; Toggle flag |
219
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
306 movlw d'5' |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
307 movwf menupos ; reset cursor |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
308 call PLED_de_activelist ; show (de)active gaslist |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
309 return |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
310 |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
311 divemenu_de_activate2_g5: |
290
4dbff2aa31ee
Hunting for refusing to ignore disabled gas in list...
JeanDo
parents:
286
diff
changeset
|
312 btg gaslist_active,4 ; Toggle flag |
219
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
313 movlw d'6' |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
314 movwf menupos ; reset cursor |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
315 call PLED_de_activelist ; show (de)active gaslist |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
316 return |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
317 |
0 | 318 divemode_set_xgas: ; Set the extra gas... |
319 bsf display_set_xgas ; Set Flag | |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
87
diff
changeset
|
320 bcf display_set_gas ; Clear Flag |
0 | 321 call PLED_clear_divemode_menu ; Clear Menu |
322 | |
323 movff char_I_O2_ratio, EEDATA ; Reset Gas6 to current gas | |
324 write_int_eeprom d'24' | |
325 movff char_I_He_ratio, EEDATA | |
326 write_int_eeprom d'25' | |
327 | |
328 call PLED_divemode_set_xgas ; Show mask | |
329 | |
330 movlw d'1' | |
331 movwf menupos ; reset cursor | |
332 call PLED_divemenu_cursor ; update cursor | |
333 return | |
334 | |
335 divemode_menu_simulator: | |
336 bsf menubit ; Enter Divemode-Menu! | |
337 bcf premenu ; clear premenu flag | |
576 | 338 call wait_switches ; Waits until switches are released, resets flag if button stays pressed! |
104 | 339 bsf display_set_simulator ; Set Flag |
340 bsf menu3_active ; So "+1" is accessible at all times | |
0 | 341 call PLED_clear_divemode_menu ; Clear Menu |
342 call PLED_divemode_simulator_mask; Show mask | |
343 movlw d'1' | |
344 movwf menupos ; reset cursor | |
345 call PLED_divemenu_cursor ; update cursor | |
346 return | |
347 | |
348 divemode_menu_simulator2: | |
349 dcfsnz menupos,F | |
119 | 350 bra timeout_divemenu2 ; close underwater menu! |
0 | 351 dcfsnz menupos,F |
352 bra divemode_menu_simulator_p1 ; Adjust +1m | |
353 dcfsnz menupos,F | |
354 bra divemode_menu_simulator_m1 ; Adjust -1m | |
355 dcfsnz menupos,F | |
356 bra divemode_menu_simulator_p10 ; Adjust +10m | |
357 dcfsnz menupos,F | |
358 bra divemode_menu_simulator_m10 ; Adjust -10m | |
352
544a96faa9f3
New "Quit sim" option in simulated dive mode, CF02 now allows more then 240seconds, Bugfix with runtime=1min in runtime simulator
Heinrichsweikamp
parents:
337
diff
changeset
|
359 dcfsnz menupos,F |
544a96faa9f3
New "Quit sim" option in simulated dive mode, CF02 now allows more then 240seconds, Bugfix with runtime=1min in runtime simulator
Heinrichsweikamp
parents:
337
diff
changeset
|
360 bra divemode_menu_simulator_quit; Adjust to zero m |
0 | 361 bra timeout_divemenu2 ; quit underwater menu! |
362 | |
363 divemode_menu_simulator_common: | |
364 call PLED_divemode_simulator_mask ; Redraw Simualtor mask | |
365 | |
119 | 366 ; Check limits (130m and 0m) |
236 | 367 movlw LOW d'14000' ; Compare to 14bar=14000mbar (130m). |
368 subwf sim_pressure+0,W | |
119 | 369 movlw HIGH d'14000' |
236 | 370 subwfb sim_pressure+1,W |
371 bnc divemode_menu_simulator_common2 ; No-carry = borrow = not deeper | |
372 | |
119 | 373 ; Too deep, limit to 130m |
374 movlw LOW d'14000' | |
0 | 375 movwf sim_pressure+0 |
119 | 376 movlw HIGH d'14000' |
0 | 377 movwf sim_pressure+1 |
378 return | |
379 divemode_menu_simulator_common2: | |
236 | 380 movlw LOW d'1000' ; Compare to 1bar == 0m == 1000 mbar. |
381 subwf sim_pressure+0,W | |
0 | 382 movlw HIGH d'1000' |
236 | 383 subwfb sim_pressure+1,W |
384 btfsc STATUS,C ; No-carry = borrow = not deeper. | |
385 return ; Deeper than 0m == Ok. | |
386 | |
0 | 387 ; Too shallow, limit to 1m |
388 movlw LOW d'1000' | |
389 movwf sim_pressure+0 | |
390 movlw HIGH d'1000' | |
391 movwf sim_pressure+1 | |
392 return | |
393 | |
394 divemode_menu_simulator_m10: | |
395 movlw LOW d'1000' | |
396 subwf sim_pressure+0,F | |
397 movlw HIGH d'1000' | |
398 subwfb sim_pressure+1,F | |
399 movlw d'5' | |
400 movwf menupos ; reset cursor | |
401 bra divemode_menu_simulator_common | |
402 | |
403 divemode_menu_simulator_p10: | |
404 movlw LOW d'1000' | |
405 addwf sim_pressure+0,F | |
406 movlw HIGH d'1000' | |
407 addwfc sim_pressure+1,F | |
236 | 408 |
0 | 409 movlw d'4' |
410 movwf menupos ; reset cursor | |
411 bra divemode_menu_simulator_common | |
412 | |
352
544a96faa9f3
New "Quit sim" option in simulated dive mode, CF02 now allows more then 240seconds, Bugfix with runtime=1min in runtime simulator
Heinrichsweikamp
parents:
337
diff
changeset
|
413 divemode_menu_simulator_quit: |
544a96faa9f3
New "Quit sim" option in simulated dive mode, CF02 now allows more then 240seconds, Bugfix with runtime=1min in runtime simulator
Heinrichsweikamp
parents:
337
diff
changeset
|
414 movlw LOW d'1000' |
544a96faa9f3
New "Quit sim" option in simulated dive mode, CF02 now allows more then 240seconds, Bugfix with runtime=1min in runtime simulator
Heinrichsweikamp
parents:
337
diff
changeset
|
415 movwf sim_pressure+0 |
544a96faa9f3
New "Quit sim" option in simulated dive mode, CF02 now allows more then 240seconds, Bugfix with runtime=1min in runtime simulator
Heinrichsweikamp
parents:
337
diff
changeset
|
416 movlw HIGH d'1000' |
544a96faa9f3
New "Quit sim" option in simulated dive mode, CF02 now allows more then 240seconds, Bugfix with runtime=1min in runtime simulator
Heinrichsweikamp
parents:
337
diff
changeset
|
417 movwf sim_pressure+1 |
544a96faa9f3
New "Quit sim" option in simulated dive mode, CF02 now allows more then 240seconds, Bugfix with runtime=1min in runtime simulator
Heinrichsweikamp
parents:
337
diff
changeset
|
418 bra timeout_divemenu2 ; quit menu |
544a96faa9f3
New "Quit sim" option in simulated dive mode, CF02 now allows more then 240seconds, Bugfix with runtime=1min in runtime simulator
Heinrichsweikamp
parents:
337
diff
changeset
|
419 |
0 | 420 divemode_menu_simulator_p1: |
421 movlw d'100' | |
422 addwf sim_pressure+0,F | |
423 movlw d'0' | |
424 addwfc sim_pressure+1,F | |
425 movlw d'2' | |
426 movwf menupos ; reset cursor | |
427 bra divemode_menu_simulator_common | |
428 | |
429 divemode_menu_simulator_m1: | |
430 movlw d'100' | |
431 subwf sim_pressure+0,F | |
432 movlw d'0' | |
433 subwfb sim_pressure+1,F | |
434 movlw d'3' | |
435 movwf menupos ; reset cursor | |
436 bra divemode_menu_simulator_common | |
437 | |
438 divemenu_see_decoplan: | |
439 bsf display_see_deco ; set flag | |
64 | 440 call PLED_clear_divemode_menu ; Clear Menu |
0 | 441 |
64 | 442 bcf last_ceiling_gf_shown ; Clear flag |
124 | 443 clrf decoplan_page ; Starts on page 0 |
169
e26f49674956
Merge decoplan display for both GF and Buhlmann models.
JeanDo
parents:
124
diff
changeset
|
444 bra divemenu_see_decoplan2_1 |
0 | 445 |
446 divemenu_see_decoplan2: | |
124 | 447 incf decoplan_page,F |
64 | 448 btfsc last_ceiling_gf_shown ; last ceiling shown? |
449 bra divemenu_see_decoplan2_0 ; All done, clear and return | |
450 | |
169
e26f49674956
Merge decoplan display for both GF and Buhlmann models.
JeanDo
parents:
124
diff
changeset
|
451 divemenu_see_decoplan2_1: |
64 | 452 clrf timeout_counter3 ; Clear timeout Divemode menu |
169
e26f49674956
Merge decoplan display for both GF and Buhlmann models.
JeanDo
parents:
124
diff
changeset
|
453 call PLED_decoplan ; Display the new screen |
e26f49674956
Merge decoplan display for both GF and Buhlmann models.
JeanDo
parents:
124
diff
changeset
|
454 return |
e26f49674956
Merge decoplan display for both GF and Buhlmann models.
JeanDo
parents:
124
diff
changeset
|
455 |
e26f49674956
Merge decoplan display for both GF and Buhlmann models.
JeanDo
parents:
124
diff
changeset
|
456 divemenu_see_decoplan2_0: |
e26f49674956
Merge decoplan display for both GF and Buhlmann models.
JeanDo
parents:
124
diff
changeset
|
457 bcf display_see_deco ; clear flag |
e26f49674956
Merge decoplan display for both GF and Buhlmann models.
JeanDo
parents:
124
diff
changeset
|
458 bra timeout_divemenu2 ; quit menu! |
64 | 459 |
0 | 460 divemenu_set_xgas2: |
461 dcfsnz menupos,F | |
462 bra divemenu_set_xgas2_exit ; Use the gas6 configured and exit | |
463 dcfsnz menupos,F | |
464 bra divemenu_set_xgas2_o2plus ; Adjust O2+ | |
465 dcfsnz menupos,F | |
466 bra divemenu_set_xgas2_o2minus ; Adjust O2- | |
467 dcfsnz menupos,F | |
468 bra divemenu_set_xgas2_heplus ; Adjust He+ | |
469 dcfsnz menupos,F | |
470 bra divemenu_set_xgas2_heminus ; Adjust He- | |
219
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
471 dcfsnz menupos,F |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
472 bra divemenu_de_activate ; Goto (De)active gases underwater list |
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
473 return ; should never be here |
0 | 474 |
475 divemenu_set_xgas2_heminus: | |
476 read_int_eeprom d'25' ; He value | |
477 movff EEDATA,lo | |
478 decf lo,F ; decrease He | |
479 movlw d'255' | |
480 cpfseq lo | |
481 bra divemenu_set_xgas2_heminus2 | |
482 incf lo,F ; limit to min=0 | |
483 divemenu_set_xgas2_heminus2: | |
484 movff lo, EEDATA | |
485 write_int_eeprom d'25' ; He Value | |
486 | |
487 call PLED_divemode_set_xgas ; Redraw menu | |
488 movlw d'5' | |
489 movwf menupos ; reset cursor | |
490 return | |
491 | |
492 divemenu_set_xgas2_heplus: | |
493 read_int_eeprom d'25' ; He value | |
494 movff EEDATA,lo | |
495 incf lo,F ; increase He | |
496 movlw d'101' | |
497 cpfseq lo | |
498 bra divemenu_set_xgas2_heplus2 | |
499 movlw d'4' ; O2 Limit | |
500 movwf lo | |
501 divemenu_set_xgas2_heplus2: ; test if O2+He>100... | |
502 read_int_eeprom d'24' ; O2 value | |
503 movf EEDATA,W | |
504 addwf lo,W ; add He value | |
505 movwf hi ; store in temp | |
506 movlw d'101' | |
507 cpfseq hi ; O2 and He > 100? | |
508 bra divemenu_set_xgas2_heplus3 ; No! | |
509 decf lo,F ; reduce He again = unchanged after operation | |
510 divemenu_set_xgas2_heplus3: ; save current value | |
511 movff lo, EEDATA | |
512 write_int_eeprom d'25' ; He Value | |
513 | |
514 call PLED_divemode_set_xgas ; Redraw menu | |
515 movlw d'4' | |
516 movwf menupos ; reset cursor | |
517 return | |
518 | |
519 divemenu_set_xgas2_o2minus: | |
520 read_int_eeprom d'24' ; O2 value | |
521 movff EEDATA,lo | |
522 decf lo,F ; decrease O2 | |
643 | 523 movlw d'0' |
0 | 524 cpfseq lo |
525 bra divemenu_set_xgas2_o2minus2 | |
643 | 526 read_int_eeprom d'25' ; Read He ratio |
527 movf EEDATA,W ; into WREG | |
528 sublw .100 ; 100% total... | |
529 movwf lo ; Set to Max. value | |
0 | 530 divemenu_set_xgas2_o2minus2: |
531 movff lo, EEDATA | |
532 write_int_eeprom d'24' ; O2 Value | |
533 | |
534 call PLED_divemode_set_xgas ; Redraw menu | |
535 movlw d'3' | |
536 movwf menupos ; reset cursor | |
537 return | |
538 | |
539 divemenu_set_xgas2_o2plus: | |
540 read_int_eeprom d'24' ; O2 value | |
541 movff EEDATA,lo | |
542 incf lo,F ; increase O2 | |
543 movlw d'101' | |
544 cpfseq lo | |
545 bra divemenu_set_xgas2_o2plus2 | |
546 movlw d'5' ; O2 limit | |
547 movwf lo | |
548 divemenu_set_xgas2_o2plus2: ; test if O2+He>100... | |
549 read_int_eeprom d'25' ; He value | |
550 movf EEDATA,W | |
551 addwf lo,W ; add O2 value | |
552 movwf hi ; store in temp | |
643 | 553 movlw d'100' |
554 cpfsgt hi ; O2 and He > 100? | |
0 | 555 bra divemenu_set_xgas2_o2plus3 ; No! |
556 decf lo,F ; reduce O2 again = unchanged after operation | |
557 divemenu_set_xgas2_o2plus3: ; save current value | |
558 movff lo, EEDATA | |
559 write_int_eeprom d'24' ; O2 Value | |
560 | |
561 call PLED_divemode_set_xgas ; Redraw menu | |
562 movlw d'2' | |
563 movwf menupos ; reset cursor | |
564 return | |
565 | |
566 divemenu_set_xgas2_exit: | |
567 read_int_eeprom d'25' ; Read He ratio | |
568 movff EEDATA,char_I_He_ratio ; And copy into hold register | |
569 | |
570 read_int_eeprom d'24' ; Read O2 ratio | |
571 movff EEDATA, char_I_O2_ratio ; O2 ratio | |
572 movff char_I_He_ratio, wait_temp ; copy into bank1 register | |
573 bsf STATUS,C ; | |
574 movlw d'100' ; 100% | |
575 subfwb wait_temp,W ; minus He | |
576 subfwb EEDATA,F ; minus O2 | |
577 movff EEDATA, char_I_N2_ratio ; = N2! | |
578 bsf manual_gas_changed ; set event flag | |
579 bsf event_occured ; set global event flag | |
99 | 580 bsf is_bailout ;=1: CC mode, but bailout active! |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
87
diff
changeset
|
581 clrf lo ; clear Setpoint, PLED_const_ppO2_value now displayes "Bail" |
353
b5b030c1ae7e
Avoid spurious switch-depth stops with 3 or more gas.
JeanDo
parents:
337
diff
changeset
|
582 movff lo,char_I_const_ppO2 |
b5b030c1ae7e
Avoid spurious switch-depth stops with 3 or more gas.
JeanDo
parents:
337
diff
changeset
|
583 movlw 6 |
b5b030c1ae7e
Avoid spurious switch-depth stops with 3 or more gas.
JeanDo
parents:
337
diff
changeset
|
584 movff WREG,char_I_current_gas ; Current gas is Gas6 (manual setting). |
0 | 585 bra timeout_divemenu2 ; quit underwater menu! |
586 | |
587 divemenu_set_gas: | |
588 btfsc FLAG_const_ppO2_mode ; in ppO2 mode? | |
17 | 589 bra divemenu_set_setpoint ; Yes, display SetPoint list |
0 | 590 |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
87
diff
changeset
|
591 divemenu_set_gas_2: |
0 | 592 bsf display_set_gas ; set flag |
593 call PLED_clear_divemode_menu ; Clear Menu | |
594 call PLED_gas_list ; Display all 5 gases | |
629
e755ed869a3b
2.51beta release - remove of MPLAB 8 workspace. Use of MPLAB X IDE recommended
heinrichsweikamp
parents:
598
diff
changeset
|
595 |
e755ed869a3b
2.51beta release - remove of MPLAB 8 workspace. Use of MPLAB X IDE recommended
heinrichsweikamp
parents:
598
diff
changeset
|
596 movlw d'1' ; Reset cursor |
e755ed869a3b
2.51beta release - remove of MPLAB 8 workspace. Use of MPLAB X IDE recommended
heinrichsweikamp
parents:
598
diff
changeset
|
597 btfsc better_gas_available ;=1: A better gas is available and a gas change is advised in divemode |
e755ed869a3b
2.51beta release - remove of MPLAB 8 workspace. Use of MPLAB X IDE recommended
heinrichsweikamp
parents:
598
diff
changeset
|
598 movf better_gas_number,W ; better gas 1-5 |
0 | 599 movwf menupos ; reset cursor |
600 call PLED_divemenu_cursor ; update cursor | |
528
67ab3c028bc2
Show change gas depth below gaslist (in divemode)
heinrichsweikamp
parents:
525
diff
changeset
|
601 call PLED_show_change_depth ; And show the first change depth |
0 | 602 return |
603 | |
604 divemenu_set_setpoint: | |
605 bsf display_set_setpoint ; set flag | |
606 bsf display_set_gas ; set flag | |
607 | |
608 call PLED_clear_divemode_menu ; Clear Menu | |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
87
diff
changeset
|
609 call PLED_splist_start ; Display SetPoints |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
87
diff
changeset
|
610 DISPLAYTEXT d'137' ; Bailout (as a sub-menu) |
0 | 611 movlw d'1' |
612 movwf menupos ; reset cursor | |
613 call PLED_divemenu_cursor ; update cursor | |
614 return | |
615 | |
616 | |
617 divemenu_set_gas2: | |
618 btfsc select_bailoutgas ; Are we in the Bailout list? | |
619 bra divemenu_set_gas2a ; Yes, choose gas | |
620 | |
621 btfss FLAG_const_ppO2_mode ; are we in ppO2 mode? | |
622 bra divemenu_set_gas2a ; no, choose gas | |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
87
diff
changeset
|
623 ; Yes, so select SP 1-3 |
3 | 624 bcf is_bailout ;=1: CC mode, but bailout active! |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
87
diff
changeset
|
625 call PLED_show_ppO2_clear ; Clear ppO2 value |
3 | 626 |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
87
diff
changeset
|
627 divemenu_set_gas1: |
525 | 628 movlw d'1' |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
87
diff
changeset
|
629 cpfseq menupos ; At the "Bailout" position? |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
87
diff
changeset
|
630 bra divemenu_set_gas1b ; No, select SetPoint 1-3 |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
87
diff
changeset
|
631 bsf select_bailoutgas ; Set Flag |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
87
diff
changeset
|
632 bcf display_set_setpoint ; Clear Flag |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
87
diff
changeset
|
633 bra divemenu_set_gas_2 ; Configure the extra gas / Select Bailout |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
87
diff
changeset
|
634 |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
87
diff
changeset
|
635 divemenu_set_gas1b: |
525 | 636 decf menupos,F ; Adjust 1-3 to 0-2... |
0 | 637 movlw d'35' ; offset in memory |
638 addwf menupos,W ; add SP number 0-2 | |
639 movwf EEADR | |
640 call read_eeprom ; Read SetPoint | |
641 movff EEDATA, char_I_const_ppO2 ; Use SetPoint | |
4 | 642 movff EEDATA, ppO2_setpoint_store ; Store also in this byte... |
274
a728b4a1b660
Setpoint changes stored in profile, EAD and END displayed in divemode (Customview 7)
heinrichsweikamp
parents:
236
diff
changeset
|
643 bsf setpoint_changed |
407 | 644 bsf event_occured ; set global event flag |
645 bra timeout_divemenu2 ; quit menu! | |
0 | 646 |
647 divemenu_set_gas1a: | |
648 bcf display_set_setpoint ; Clear Display Flag | |
649 bsf stored_gas_changed ; set event flag | |
650 bsf event_occured ; set global event flag | |
651 bra timeout_divemenu2 ; quit menu! | |
652 | |
653 divemenu_set_gas2a: | |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
87
diff
changeset
|
654 movlw d'6' |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
87
diff
changeset
|
655 cpfseq menupos ; At the "Gas 6.." position? |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
87
diff
changeset
|
656 bra divemenu_set_gas2b ; No, select Gas1-5 (Stored in Menupos) |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
87
diff
changeset
|
657 bra divemode_set_xgas ; Configure the extra gas |
353
b5b030c1ae7e
Avoid spurious switch-depth stops with 3 or more gas.
JeanDo
parents:
337
diff
changeset
|
658 |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
87
diff
changeset
|
659 divemenu_set_gas2b: |
3 | 660 bsf is_bailout ;=1: CC mode, but bailout active! |
0 | 661 clrf lo ; clear Setpoint, PLED_const_ppO2_value now displayes "Bail" |
662 movff lo,char_I_const_ppO2 | |
663 | |
664 bcf display_set_gas ; clear flag | |
665 movff menupos,active_gas ; copy into active gas register | |
666 decf menupos,W ; # of selected gas (0-4) | |
667 mullw d'4' ; times 4... | |
668 movf PRODL,W ; | |
669 addlw d'7' ; +7 = address for He ratio | |
670 movwf EEADR | |
671 call read_eeprom ; Read He ratio | |
672 movff EEDATA,char_I_He_ratio ; And copy into hold register | |
673 | |
674 decf menupos,W ; # of selected gas (0-4) | |
675 mullw d'4' ; times 4... | |
676 movf PRODL,W ; | |
677 addlw d'6' ; +6 = address for O2 ratio | |
678 movwf EEADR | |
679 call read_eeprom ; Read O2 ratio | |
680 movff EEDATA, char_I_O2_ratio ; O2 ratio | |
681 movff char_I_He_ratio, wait_temp ; copy into bank1 register | |
682 bsf STATUS,C ; | |
683 movlw d'100' ; 100% | |
684 subfwb wait_temp,W ; minus He | |
685 subfwb EEDATA,F ; minus O2 | |
686 movff EEDATA, char_I_N2_ratio ; = N2! | |
687 bsf stored_gas_changed ; set event flag | |
688 bsf event_occured ; set global event flag | |
353
b5b030c1ae7e
Avoid spurious switch-depth stops with 3 or more gas.
JeanDo
parents:
337
diff
changeset
|
689 |
b5b030c1ae7e
Avoid spurious switch-depth stops with 3 or more gas.
JeanDo
parents:
337
diff
changeset
|
690 movff menupos,char_I_current_gas ; Inform deco code too. |
0 | 691 bra timeout_divemenu2 ; quit menu! |
692 | |
693 timeout_divemenu: | |
694 btfss menubit ; is the Dive mode menu displayed? | |
695 return ; No | |
696 | |
697 btfsc display_set_simulator ; Is the Simulator Mask active? | |
698 bra timeout_divemenu6 ; Yes, update Simulator mask | |
699 | |
700 btfss display_see_deco ; Is the decoplan active? | |
701 bra timeout_divemenu1 ; No, skip updating the decoplan | |
169
e26f49674956
Merge decoplan display for both GF and Buhlmann models.
JeanDo
parents:
124
diff
changeset
|
702 bra timeout_divemenu3 ; Yes... |
0 | 703 |
704 timeout_divemenu1: | |
705 incf timeout_counter3,F ; increase timeout_counter3 | |
706 GETCUSTOM8 d'10' ; loads timeout_divemenu into WREG | |
707 cpfsgt timeout_counter3 ; ... longer then timeout_divemenu | |
708 return ; No! | |
169
e26f49674956
Merge decoplan display for both GF and Buhlmann models.
JeanDo
parents:
124
diff
changeset
|
709 |
0 | 710 timeout_divemenu2: ; quit divemode menu |
711 ; Restore some outputs | |
124 | 712 clrf decoplan_page ; Page 0-1 of deco list |
119 | 713 call PLED_clear_divemode_menu; Clear dive mode menu |
115 | 714 |
715 btfsc FLAG_apnoe_mode ; Ignore in Apnoe mode | |
716 bra timeout_divemenu2a ; skip! | |
717 btfsc gauge_mode ; Ignore in Gauge mode | |
718 bra timeout_divemenu2a ; skip! | |
719 | |
280 | 720 bcf menubit |
0 | 721 btfsc dekostop_active |
66 | 722 call PLED_display_deko_mask ; clear nostop time, display decodata |
0 | 723 btfss dekostop_active |
66 | 724 call PLED_display_ndl_mask ; Clear deco data, display nostop time |
0 | 725 |
281 | 726 btfsc dekostop_active |
727 call PLED_display_deko ; Update deco display at once | |
728 btfss dekostop_active | |
729 call PLED_display_ndl ; Update NDL display at once | |
730 | |
598
f3735da18809
NEW: CF65: Show a safety stop for no-deco dives
heinrichsweikamp
parents:
576
diff
changeset
|
731 btfsc safety_stop_active |
f3735da18809
NEW: CF65: Show a safety stop for no-deco dives
heinrichsweikamp
parents:
576
diff
changeset
|
732 bcf safety_stop_active ; Clear flag to rebuild the safety stop |
f3735da18809
NEW: CF65: Show a safety stop for no-deco dives
heinrichsweikamp
parents:
576
diff
changeset
|
733 |
0 | 734 timeout_divemenu2a: |
735 bcf menubit | |
736 bcf premenu ; Yes, clear flags and menu, display dive time and mask again | |
66 | 737 call PLED_active_gas_divemode; Display gas, if required |
0 | 738 call PLED_divemode_mask ; Display mask |
739 call PLED_divemins ; Display (new) divetime! | |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
87
diff
changeset
|
740 call customview_mask ; Redraw current customview mask |
0 | 741 clrf timeout_counter3 ; Also clear timeout |
742 bcf display_see_deco ; clear all display flags | |
743 bcf display_set_gas | |
744 bcf display_set_xgas | |
745 bcf display_set_setpoint | |
746 bcf display_set_simulator | |
219
b6dd54b3567c
NEW: De/Activate gases underwater (Gaslist -> Gas6.. -> Actve?)
heinrichsweikamp
parents:
169
diff
changeset
|
747 bcf display_set_active |
286 | 748 bcf menu3_active |
576 | 749 call wait_switches ; Waits until switches are released, resets flag if button stays pressed! |
0 | 750 return |
169
e26f49674956
Merge decoplan display for both GF and Buhlmann models.
JeanDo
parents:
124
diff
changeset
|
751 |
e26f49674956
Merge decoplan display for both GF and Buhlmann models.
JeanDo
parents:
124
diff
changeset
|
752 ; Re-Draw current page of decoplan (may have more stops) |
0 | 753 timeout_divemenu3: |
169
e26f49674956
Merge decoplan display for both GF and Buhlmann models.
JeanDo
parents:
124
diff
changeset
|
754 movff char_O_deco_status,WREG ; Get last computation state (BANK safe) |
e26f49674956
Merge decoplan display for both GF and Buhlmann models.
JeanDo
parents:
124
diff
changeset
|
755 iorwf WREG ; Is it zero ? |
e26f49674956
Merge decoplan display for both GF and Buhlmann models.
JeanDo
parents:
124
diff
changeset
|
756 btfsc STATUS,Z |
e26f49674956
Merge decoplan display for both GF and Buhlmann models.
JeanDo
parents:
124
diff
changeset
|
757 call PLED_decoplan ; Yes: new data available. |
0 | 758 bra timeout_divemenu1 ; Check timeout |
169
e26f49674956
Merge decoplan display for both GF and Buhlmann models.
JeanDo
parents:
124
diff
changeset
|
759 |
0 | 760 timeout_divemenu6: |
761 ; Update Simulator Mask | |
286 | 762 bsf menu3_active ; So "+1" is accessible at all times |
0 | 763 call PLED_divemode_simulator_mask; Show mask |
764 call PLED_divemenu_cursor ; update cursor | |
765 bra timeout_divemenu1 ; Check timeout |