annotate code_part1/OSTC_code_asm_part1/divemode_menu.asm @ 475:472bccc39aeb

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