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