annotate code_part1/OSTC_code_asm_part1/divemode_menu.asm @ 666:3282581fe178

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