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