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