annotate code_part1/OSTC_code_asm_part1/menu_gassetup.asm @ 297:ceedf078b2d8

Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
author Heinrichsweikamp
date Fri, 29 Apr 2011 20:17:32 +0200
parents 4dbff2aa31ee
children eac799f69360
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
2 ; OSTC - diving computer code
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
3 ; Copyright (C) 2008 HeinrichsWeikamp GbR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
4
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
5 ; This program is free software: you can redistribute it and/or modify
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
6 ; it under the terms of the GNU General Public License as published by
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
7 ; the Free Software Foundation, either version 3 of the License, or
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
8 ; (at your option) any later version.
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
9
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
10 ; This program is distributed in the hope that it will be useful,
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
11 ; but WITHOUT ANY WARRANTY; without even the implied warranty of
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
12 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
13 ; GNU General Public License for more details.
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
14
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
15 ; You should have received a copy of the GNU General Public License
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
16 ; along with this program. If not, see <http://www.gnu.org/licenses/>.
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
17
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
18
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
19 ; Gas Setup menu
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
20 ; written by: Matthias Heinrichs, info@heinrichsweikamp.com
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
21 ; written: 10/08/07
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
22 ; last updated: 080906
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
23 ; known bugs:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
24 ; ToDo:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
25
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
26 menu_gassetup:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
27 movlw d'1'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
28 movwf menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
29
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
30 menu_gassetup_prelist:
36
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
31 call PLED_ClearScreen
47
56aea9fcdd8f 1.65beta release
heinrichsweikamp
parents: 45
diff changeset
32 call gassetup_sort_gaslist ; Sorts Gaslist according to change depth
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
33 clrf timeout_counter2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
34 bcf sleepmode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
35 bcf menubit2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
36 bcf menubit3
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
37 call PLED_topline_box
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
38 WIN_INVERT .1 ; Init new Wordprocessor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
39 DISPLAYTEXT .106 ; Gas List
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
40 WIN_INVERT .0 ; Init new Wordprocessor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
41 clrf decodata+0 ; Here: # of gas 0-4
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
42 clrf divemins+0 ; Here: # of Gas * 4
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
43 movlw d'5'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
44 movwf waitms_temp ; here: stores row for gas list
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
45 movlw d'2'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
46 movwf wait_temp ; here: stores eeprom address for gas list
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
47
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
48 ; Changed v1.44se
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
49 menu_gassetup_list:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
50 WIN_LEFT .20
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
51 movlw d'4'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
52 addwf wait_temp,F ; Increase eeprom address for gas list
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
53 movlw d'30'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
54 addwf waitms_temp,F ; Increase row
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
55 movf waitms_temp,W ; Load row into WREG
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
56 movff WREG,win_top
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
57 lfsr FSR2,letter
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 121
diff changeset
58 PUTC 'G'
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
59 movff decodata+0,lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
60 incf lo,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
61 bsf leftbind
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
62 output_99
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 121
diff changeset
63 PUTC ':'
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
64
121
e0f29e20bd24 Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents: 115
diff changeset
65 movf decodata+0,W
e0f29e20bd24 Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents: 115
diff changeset
66 call PLED_grey_inactive_gas ; Sets Greyvalue for inactive gases
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
67 call word_processor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
68 WIN_LEFT .40
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
69 movf waitms_temp,W ; Load row into WREG
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
70 movff WREG,win_top
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
71 lfsr FSR2,letter
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
72
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
73 movlw d'33'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
74 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
75 call read_eeprom ; Get current startgas 1-5 # into EEDATA
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
76 decf EEDATA,W ; 0-4
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
77 cpfseq decodata+0 ; =current displayed gas #?
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
78 bra menu_gassetup_Tx ; no, do not display *
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 121
diff changeset
79 PUTC '*' ; display *
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
80
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
81 ; New v1.44se
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
82 menu_gassetup_Tx:
121
e0f29e20bd24 Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents: 115
diff changeset
83 movf decodata+0,W
e0f29e20bd24 Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents: 115
diff changeset
84 call PLED_grey_inactive_gas ; Sets Greyvalue for inactive gases
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
85 call word_processor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
86
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
87 WIN_LEFT .48
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
88 movf waitms_temp,W ; Load row into WREG
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
89 movff WREG,win_top
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
90 lfsr FSR2,letter
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
91
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
92 movff wait_temp, EEADR ; Gas %He - Set address in internal EEPROM
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
93 incf EEADR,F ; Gas %He - Set address in internal EEPROM
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
94 call read_eeprom ; Read He value from EEPROM
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
95 movff EEDATA,lo ; Move EEDATA -> lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
96 movf lo,f ; Move lo -> f
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
97 movlw d'0' ; Move 0 -> WREG
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
98 cpfsgt lo ; He > 0?
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
99 bra menu_gassetup_Nx ; NO check o2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
100
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
101 ; YES Write TX 15/55
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
102 call gassetup_write_Tx
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
103 movff wait_temp, EEADR ; Gas %O2 - Set address in internal EEPROM
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
104 call read_eeprom ; O2 value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
105 movff EEDATA,lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
106 output_8
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 121
diff changeset
107 PUTC '/'
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
108 incf EEADR,F ; Gas #hi: %He - Set address in internal EEPROM
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
109 call read_eeprom ; He value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
110 movff EEDATA,lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
111 output_8
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
112 bra menu_gassetup_list0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
113
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
114 ; New v1.44se
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
115 menu_gassetup_Nx:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
116 movff wait_temp, EEADR ; Gas %O2 - Set address in internal EEPROM
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
117 call read_eeprom ; Read O2 value from EEPROM
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
118 movff EEDATA,lo ; Move EEDATA -> lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
119 movf lo,f ; Move lo -> f
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
120 movlw d'21' ; Move 21 -> WREG
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
121 cpfsgt lo ; o2 > 21%
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
122 bra menu_gassetup_Air ; NO AIR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
123 movlw d'100' ; Move 100 -> WREG
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
124 cpfslt lo ; o2 < 100%
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
125 bra menu_gassetup_O2 ; NO write O2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
126
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
127 ; YES Write NX 32
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
128 call gassetup_write_Nx
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
129 output_8
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
130 bra menu_gassetup_list0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
131
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
132 ; New v1.44se
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
133 menu_gassetup_O2:
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 121
diff changeset
134 STRCAT "O2 "
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
135 output_8
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
136 bra menu_gassetup_list0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
137
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
138 ; New v1.44se
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
139 menu_gassetup_Air:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
140 cpfseq lo ; o2 = 21%
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
141 call menu_gassetup_Err
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
142
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 121
diff changeset
143 STRCAT "AIR "
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
144 output_8
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
145 bra menu_gassetup_list0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
146
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
147 ; New v1.44se
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
148 menu_gassetup_Err:
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 121
diff changeset
149 STRCAT "ERR "
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
150 output_8
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
151
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
152 ; Changed v1.44se
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
153 menu_gassetup_list0:
121
e0f29e20bd24 Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents: 115
diff changeset
154 movf decodata+0,W
e0f29e20bd24 Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents: 115
diff changeset
155 call PLED_grey_inactive_gas ; Sets Greyvalue for inactive gases
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
156 call word_processor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
157
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
158 WIN_LEFT .105
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
159 movf waitms_temp,W ; Load row into WREG
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
160 movff WREG,win_top
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
161 lfsr FSR2,letter
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
162
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 121
diff changeset
163 STRCAT " in "
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
164 movf decodata+0,W ; read current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
165 addlw d'28' ; offset in memory
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
166 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
167 call read_eeprom ; Low-value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
168 movff EEDATA,lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
169 output_8
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 121
diff changeset
170 PUTC 'm'
121
e0f29e20bd24 Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents: 115
diff changeset
171 movf decodata+0,W
e0f29e20bd24 Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents: 115
diff changeset
172 call PLED_grey_inactive_gas ; Sets Greyvalue for inactive gases
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
173 call word_processor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
174
3
3cf8af30b36e v1.51 beta
heinrichsweikamp
parents: 0
diff changeset
175 call PLED_standard_color
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
176
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
177 incf decodata+0,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
178 movlw d'5'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
179 cpfseq decodata+0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
180 goto menu_gassetup_list
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
181
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
182 DISPLAYTEXT .11 ; Exit
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
183 call wait_switches ; Waits until switches are released, resets flag if button stays pressed!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
184 call PLED_menu_cursor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
185
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
186 gassetup_list_loop:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
187 call check_switches_logbook
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
188
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
189 btfsc menubit3
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
190 bra gassetup_list2 ; move cursor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
191
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
192 btfsc menubit2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
193 bra do_gassetup_list; call gas-specific submenu
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
194
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
195 btfsc divemode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
196 goto restart ; dive started!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
197
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
198 btfsc onesecupdate
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
199 call timeout_surfmode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
200
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
201 btfsc onesecupdate
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
202 call set_dive_modes
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
203
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
204 bcf onesecupdate ; 1 sec. functions done
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
205
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
206 btfsc sleepmode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
207 bra exit_gassetup_list
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
208
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
209 bra gassetup_list_loop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
210
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
211 gassetup_list2:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
212 incf menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
213 movlw d'7'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
214 cpfseq menupos ; =7?
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
215 bra gassetup_list3 ; No
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
216 movlw d'1'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
217 movwf menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
218
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
219 gassetup_list3:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
220 clrf timeout_counter2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
221 call PLED_menu_cursor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
222
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
223 call wait_switches ; Waits until switches are released, resets flag if button stays pressed!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
224
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
225 bcf menubit3 ; clear flag
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
226 bra gassetup_list_loop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
227
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
228 exit_gassetup_list: ; exit...
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
229 movlw d'2'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
230 movwf menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
231 goto menu2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
232
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
233 do_gassetup_list:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
234 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
235 bra gassetup_list_edit_gas1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
236 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
237 bra gassetup_list_edit_gas2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
238 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
239 bra gassetup_list_edit_gas3
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
240 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
241 bra gassetup_list_edit_gas4
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
242 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
243 bra gassetup_list_edit_gas5
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
244 bra exit_gassetup_list ; Exit List
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
245
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
246 gassetup_list_edit_gas1:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
247 movlw d'0'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
248 movwf decodata+0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
249 movlw d'0'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
250 movwf divemins+0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
251 bra menu_gassetup_page1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
252
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
253 gassetup_list_edit_gas2:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
254 movlw d'1'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
255 movwf decodata+0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
256 movlw d'4'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
257 movwf divemins+0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
258 bra menu_gassetup_page1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
259
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
260 gassetup_list_edit_gas3:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
261 movlw d'2'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
262 movwf decodata+0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
263 movlw d'8'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
264 movwf divemins+0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
265 bra menu_gassetup_page1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
266
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
267 gassetup_list_edit_gas4:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
268 movlw d'3'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
269 movwf decodata+0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
270 movlw d'12'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
271 movwf divemins+0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
272 bra menu_gassetup_page1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
273
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
274 gassetup_list_edit_gas5:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
275 movlw d'4'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
276 movwf decodata+0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
277 movlw d'16'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
278 movwf divemins+0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
279 bra menu_gassetup_page1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
280
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
281 menu_gassetup_page1:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
282 movlw d'1'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
283 movwf menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
284 bcf gas_setup_page2 ; Page 1 of gassetup
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
285 bcf menubit4
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
286 bcf cursor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
287 bcf sleepmode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
288 bcf first_FA ; Here: =1: -, =0: +
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
289
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
290 menu_gassetup0:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
291 call PLED_ClearScreen
98
6f8e3a08011e 1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents: 50
diff changeset
292 DISPLAYTEXT .147 ; More...
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
293 DISPLAYTEXT .11 ; Exit
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
294
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
295 menu_gassetup1:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
296 clrf timeout_counter2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
297 bcf menubit2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
298 bcf menubit3
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
299
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
300 rcall gassetup_title_bar2 ; Displays the title bar with the current Gas info
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
301
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
302 WIN_LEFT .20
199
f5e9db793dd3 Minor missing translations
JeanDo
parents: 123
diff changeset
303 WIN_TOP .65
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 121
diff changeset
304 STRCPY "O2: "
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
305
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
306 movf divemins+0,W
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
307 addlw 0x06
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
308 movwf EEADR
199
f5e9db793dd3 Minor missing translations
JeanDo
parents: 123
diff changeset
309 call read_eeprom ; O2 value
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
310 movff EEDATA,lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
311 output_8
199
f5e9db793dd3 Minor missing translations
JeanDo
parents: 123
diff changeset
312 STRCAT_PRINT "% "
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
313
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
314 ; Show MOD in m
199
f5e9db793dd3 Minor missing translations
JeanDo
parents: 123
diff changeset
315 WIN_LEFT .90
f5e9db793dd3 Minor missing translations
JeanDo
parents: 123
diff changeset
316 lfsr FSR2, letter
f5e9db793dd3 Minor missing translations
JeanDo
parents: 123
diff changeset
317 OUTPUTTEXTH .297 ; MOD:
f5e9db793dd3 Minor missing translations
JeanDo
parents: 123
diff changeset
318
f5e9db793dd3 Minor missing translations
JeanDo
parents: 123
diff changeset
319 GETCUSTOM8 .18 ; ppO2 warnvalue in WREG
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
320 mullw d'10'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
321 movff PRODL,xA+0
199
f5e9db793dd3 Minor missing translations
JeanDo
parents: 123
diff changeset
322 movff PRODH,xA+1 ; ppO2 in [0.01Bar] * 10
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
323
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
324 movf divemins+0,W
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
325 addlw 0x06
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
326 movwf EEADR
199
f5e9db793dd3 Minor missing translations
JeanDo
parents: 123
diff changeset
327 call read_eeprom ; O2 value
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
328 movff EEDATA,xB+0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
329 clrf xB+1
199
f5e9db793dd3 Minor missing translations
JeanDo
parents: 123
diff changeset
330 call div16x16 ; xA/xB=xC with xA as remainder
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
331 movlw d'10'
199
f5e9db793dd3 Minor missing translations
JeanDo
parents: 123
diff changeset
332 subwf xC+0,F ; Subtract 10m...
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
333 movff xC+0,lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
334 movlw d'0'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
335 subwfb xC+1,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
336 movff xC+1,hi
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
337 output_16
199
f5e9db793dd3 Minor missing translations
JeanDo
parents: 123
diff changeset
338 STRCAT_PRINT "m "
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
339
199
f5e9db793dd3 Minor missing translations
JeanDo
parents: 123
diff changeset
340 WIN_LEFT .20
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
341 WIN_TOP .95
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 121
diff changeset
342 STRCPY "He: "
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
343 movf divemins+0,W
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
344 addlw 0x07
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
345 movwf EEADR
199
f5e9db793dd3 Minor missing translations
JeanDo
parents: 123
diff changeset
346 call read_eeprom ; He value
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
347 movff EEDATA,lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
348 output_8
199
f5e9db793dd3 Minor missing translations
JeanDo
parents: 123
diff changeset
349 STRCAT_PRINT "% "
105
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
350
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
351 ; Show END in m
199
f5e9db793dd3 Minor missing translations
JeanDo
parents: 123
diff changeset
352 lfsr FSR2, letter
f5e9db793dd3 Minor missing translations
JeanDo
parents: 123
diff changeset
353 WIN_LEFT .90
f5e9db793dd3 Minor missing translations
JeanDo
parents: 123
diff changeset
354 OUTPUTTEXTH .298 ; END:
f5e9db793dd3 Minor missing translations
JeanDo
parents: 123
diff changeset
355 GETCUSTOM8 .18 ; ppO2 warnvalue in WREG
105
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
356 mullw d'10'
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
357 movff PRODL,xA+0
199
f5e9db793dd3 Minor missing translations
JeanDo
parents: 123
diff changeset
358 movff PRODH,xA+1 ; ppO2 in [0.01Bar] * 10
105
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
359 movf divemins+0,W
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
360 addlw 0x06
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
361 movwf EEADR
199
f5e9db793dd3 Minor missing translations
JeanDo
parents: 123
diff changeset
362 call read_eeprom ; O2 value
105
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
363 movff EEDATA,xB+0
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
364 clrf xB+1
199
f5e9db793dd3 Minor missing translations
JeanDo
parents: 123
diff changeset
365 call div16x16 ; xA/xB=xC with xA as remainder
105
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
366 movlw d'10'
199
f5e9db793dd3 Minor missing translations
JeanDo
parents: 123
diff changeset
367 subwf xC+0,F ; Subtract 10m...
105
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
368 movff xC+0,lo
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
369 movlw d'0'
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
370 subwfb xC+1,F
199
f5e9db793dd3 Minor missing translations
JeanDo
parents: 123
diff changeset
371 movff xC+1,hi ; lo:hi holding MOD in meters
105
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
372 movlw d'10'
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
373 addwf lo,F
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
374 movlw d'0'
199
f5e9db793dd3 Minor missing translations
JeanDo
parents: 123
diff changeset
375 addwfc hi,F ; lo:hi holding MOD+10m
105
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
376
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
377 movf divemins+0,W
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
378 addlw 0x07
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
379 movwf EEADR
199
f5e9db793dd3 Minor missing translations
JeanDo
parents: 123
diff changeset
380 call read_eeprom ; He value in % -> EEDATA
105
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
381 movlw d'100'
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
382 movwf xA+0
199
f5e9db793dd3 Minor missing translations
JeanDo
parents: 123
diff changeset
383 movf EEDATA,W ; He value in % -> EEDATA
f5e9db793dd3 Minor missing translations
JeanDo
parents: 123
diff changeset
384 subwf xA+0,F ; xA+0 = 100 - He Value in %
105
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
385 clrf xA+1
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
386 movff lo,xB+0
199
f5e9db793dd3 Minor missing translations
JeanDo
parents: 123
diff changeset
387 movff hi,xB+1 ; Copy MOD+10
f5e9db793dd3 Minor missing translations
JeanDo
parents: 123
diff changeset
388 call mult16x16 ; xA*xB=xC
105
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
389 movff xC+0,xA+0
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
390 movff xC+1,xA+1
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
391 movlw d'100'
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
392 movwf xB+0
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
393 clrf xB+1
199
f5e9db793dd3 Minor missing translations
JeanDo
parents: 123
diff changeset
394 call div16x16 ; xA/xB=xC with xA as remainder
105
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
395 ; xC:2 = ((MOD+10) * 100 - HE Value in %) / 100
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
396 movlw d'10'
199
f5e9db793dd3 Minor missing translations
JeanDo
parents: 123
diff changeset
397 subwf xC+0,F ; Subtract 10m...
105
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
398 movff xC+0,lo
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
399 movlw d'0'
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
400 subwfb xC+1,F
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
401 movff xC+1,hi
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
402 output_16
199
f5e9db793dd3 Minor missing translations
JeanDo
parents: 123
diff changeset
403 STRCAT_PRINT "m "
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
404
199
f5e9db793dd3 Minor missing translations
JeanDo
parents: 123
diff changeset
405 WIN_LEFT .20
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
406 WIN_TOP .125
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 121
diff changeset
407 STRCPY "+/-: "
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
408 movlw '+'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
409 btfsc first_FA
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
410 movlw '-'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
411 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
412 call word_processor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
413
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
414 WIN_TOP .155
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
415 lfsr FSR2,letter
199
f5e9db793dd3 Minor missing translations
JeanDo
parents: 123
diff changeset
416 OUTPUTTEXT .89 ; Default:
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
417 movf divemins+0,W
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
418 addlw 0x04
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
419 movwf EEADR
199
f5e9db793dd3 Minor missing translations
JeanDo
parents: 123
diff changeset
420 call read_eeprom ; Default O2 value
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
421 movff EEDATA,lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
422 output_8
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 121
diff changeset
423 PUTC '/'
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
424 movf divemins+0,W
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
425 addlw 0x05
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
426 movwf EEADR
199
f5e9db793dd3 Minor missing translations
JeanDo
parents: 123
diff changeset
427 call read_eeprom ; Default He value
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
428 movff EEDATA,lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
429 output_8
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 121
diff changeset
430 STRCAT_PRINT " "
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
431
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
432 call wait_switches ; Waits until switches are released, resets flag if button stays pressed!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
433 call PLED_menu_cursor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
434
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
435 gassetup_loop:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
436 call check_switches_logbook
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
437
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
438 btfsc menubit3
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
439 bra gassetup2 ; move cursor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
440
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
441 btfsc menubit2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
442 bra do_gassetup ; call submenu
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
443
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
444 btfsc divemode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
445 goto restart ; dive started!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
446
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
447 btfsc onesecupdate
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
448 call timeout_surfmode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
449
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
450 btfsc onesecupdate
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
451 call set_dive_modes
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
452
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
453 bcf onesecupdate ; 1 sec. functions done
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
454
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
455 btfsc sleepmode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
456 bra exit_gassetup
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
457
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
458 bra gassetup_loop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
459
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
460 gassetup2:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
461 incf menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
462 movlw d'7'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
463 cpfseq menupos ; =7?
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
464 bra gassetup3 ; No
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
465 movlw d'1'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
466 movwf menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
467
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
468 gassetup3:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
469
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
470 clrf timeout_counter2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
471 call PLED_menu_cursor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
472
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
473 call wait_switches ; Waits until switches are released, resets flag if button stays pressed!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
474
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
475 bcf menubit3 ; clear flag
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
476 bra gassetup_loop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
477
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
478 do_gassetup:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
479 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
480 bra next_gas_page
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
481 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
482 bra adjust_o2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
483 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
484 bra adjust_he
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
485 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
486 bra toggle_plus_minus_gassetup
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
487 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
488 bra restore_gas
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
489 exit_gassetup: ; exit...
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
490 movff decodata+0,menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
491 incf menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
492 bra menu_gassetup_prelist
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
493
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
494 toggle_plus_minus_gassetup:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
495 btg first_FA
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
496 movlw d'4'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
497 movwf menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
498 bra menu_gassetup1 ; return
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
499
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
500 next_gas:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
501 movlw d'1'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
502 movwf menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
503 bra menu_gassetup0 ; incl. clear screen
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
504
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
505 adjust_o2:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
506 movf divemins+0,W ; read current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
507 addlw 0x06
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
508 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
509 call read_eeprom ; Low-value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
510 movff EEDATA,lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
511
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
512 btfsc first_FA ; Minus?
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
513 bra adjust_o2_1 ; yes, minus!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
514
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
515 incf lo,F ; increase O2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
516 movlw d'101'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
517 cpfseq lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
518 bra adjust_o2_2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
519 movlw d'4' ; LOWER O2 Limit
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
520 movwf lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
521 bra adjust_o2_2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
522
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
523 adjust_o2_1:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
524 decf lo,F ; decrease O2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
525 movlw d'3'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
526 cpfseq lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
527 bra adjust_o2_2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
528
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
529 movf divemins+0,W
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
530 addlw 0x07
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
531 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
532 call read_eeprom ; read He value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
533
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
534 movlw d'100'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
535 movwf lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
536 movf EEDATA,W ; He value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
537 subwf lo,F ; lo=100% - He%
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
538
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
539 adjust_o2_2: ; test if O2+He>100...
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
540 movf divemins+0,W
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
541 addlw 0x07
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
542 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
543 call read_eeprom ; read He value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
544 movf EEDATA,W ; He value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
545 addwf lo,W ; add O2 value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
546 movwf hi ; store in temp
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
547 movlw d'101'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
548 cpfseq hi ; O2 and He > 100?
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
549 bra adjust_o2_3 ; No!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
550
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
551 movlw d'4' ; LOWER O2 Limit
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
552 movwf lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
553
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
554 adjust_o2_3:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
555 movf divemins+0,W ; save current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
556 addlw 0x06
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
557 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
558 movff lo,EEDATA
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
559 call write_eeprom ; Low-value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
560
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
561 movlw d'2'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
562 movwf menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
563 bra menu_gassetup1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
564
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
565 adjust_he:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
566 movf divemins+0,W ; read current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
567 addlw 0x07
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
568 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
569 call read_eeprom ; Low-value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
570 movff EEDATA,lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
571
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
572 btfsc first_FA ; Minus?
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
573 bra adjust_he_1 ; yes, minus!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
574
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
575 incf lo,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
576 movlw d'92' ; He limited to (useless) 90%
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
577 cpfseq lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
578 bra adjust_he_2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
579 clrf lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
580 bra adjust_he_2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
581
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
582 adjust_he_1:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
583 decf lo,F ; decrease He
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
584 movlw d'255'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
585 cpfseq lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
586 bra adjust_he_2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
587 clrf lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
588
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
589 adjust_he_2: ; test if O2+He>100...
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
590 movf divemins+0,W
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
591 addlw 0x06
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
592 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
593 call read_eeprom ; read He value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
594 movf EEDATA,W ; He value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
595 addwf lo,W ; add O2 value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
596 movwf hi ; store in temp
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
597 movlw d'101'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
598 cpfseq hi ; O2 and He > 100?
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
599 bra adjust_he_3 ; No!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
600 ; clrf lo ; Yes, clear He to zero
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
601 decf lo,F ; reduce He again = unchanged after operation
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
602
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
603 adjust_he_3:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
604 movf divemins+0,W ; save current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
605 addlw 0x07
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
606 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
607 movff lo,EEDATA
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
608 call write_eeprom ; Low-value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
609
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
610 movlw d'3'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
611 movwf menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
612 bra menu_gassetup1 ;
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
613
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
614 restore_gas:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
615 movf divemins+0,W ; read Default value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
616 addlw 0x04
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
617 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
618 call read_eeprom ; Low-value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
619 movff EEDATA,lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
620 movf divemins+0,W
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
621 addlw 0x05
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
622 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
623 call read_eeprom ; High-value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
624 movff EEDATA,hi
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
625
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
626 movf divemins+0,W ; save Default value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
627 addlw 0x06
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
628 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
629 movff lo,EEDATA
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
630 call write_eeprom ; Low-value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
631 movf divemins+0,W
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
632 addlw 0x07
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
633 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
634 movff hi,EEDATA
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
635 call write_eeprom ; High-value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
636
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
637 movlw d'5'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
638 movwf menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
639 bra menu_gassetup1 ;
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
640
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
641
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
642 next_gas_page:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
643 call PLED_ClearScreen
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
644 movlw d'1'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
645 movwf menupos
297
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
646 bcf first_FA ; Here: =1: -, =0: +
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
647 bcf second_FA ; Here: =1: Is first gas
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
648 DISPLAYTEXT .107 ; Depth +/-
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
649 DISPLAYTEXT .108 ; Change:
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
650 DISPLAYTEXT .109 ; Default:
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
651 DISPLAYTEXT .11 ; Exit
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
652
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
653 next_gas_page1:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
654 clrf timeout_counter2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
655 bcf menubit2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
656 bcf menubit3
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
657
297
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
658 WIN_TOP .65
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
659 WIN_LEFT .20
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
660 lfsr FSR2,letter
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
661 OUTPUTTEXT .88 ; First Gas?
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
662 PUTC ' '
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
663
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
664 movlw d'33'
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
665 movwf EEADR
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
666 call read_eeprom ; Get current startgas 1-5 # into EEDATA
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
667 decf EEDATA,W ; 0-4
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
668 cpfseq decodata+0 ; =current displayed gas #?
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
669 bra menu_firstgas0 ; no, display three spaces
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
670
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
671 OUTPUTTEXT .96 ; Yes
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
672 bsf second_FA ; Is first gas
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
673
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
674 movf decodata+0,W ; read current value
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
675 addlw d'28' ; offset in memory
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
676 movwf EEADR
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
677 call read_eeprom ; Low-value
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
678 clrf EEDATA ; Set change depth to zero
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
679 call write_eeprom ; save result in EEPROM
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
680
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
681 bra menu_firstgas1
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
682
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
683 menu_firstgas0:
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
684 bcf second_FA ; Is not first gas
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
685 STRCAT " " ; 3 spaces.
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
686
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
687 menu_firstgas1:
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
688 call word_processor
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
689
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
690
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
691 rcall gassetup_title_bar2 ; Displays the title bar with the current Gas info
297
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
692 WIN_TOP .125
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
693 WIN_LEFT .70
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
694 lfsr FSR2,letter
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
695 ; lo still holds change depth
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
696 bsf leftbind
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
697 output_8
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
698 STRCAT_PRINT "m "
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
699
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
700 WIN_TOP .125
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
701 WIN_LEFT .100
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
702 lfsr FSR2,letter
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
703
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
704 rcall gassetup_show_ppO2 ; Display the ppO2 of the change depth with the current gas
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
705
297
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
706 movff xC+0,sub_a+0
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
707 movff xC+1,sub_a+1
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
708 GETCUSTOM8 d'46' ; color-code ppO2 warning [cBar]
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
709 mullw d'1' ; ppo2_warning_high*1
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
710 movff PRODL,sub_b+0
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
711 movff PRODH,sub_b+1
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
712 call sub16 ; sub_c = sub_a - sub_b
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
713 btfss neg_flag
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
714 bra gassetup_color_code_ppo2_1; too high -> Warning Color!
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
715 call PLED_standard_color
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
716 bra gassetup_color_code_ppo2_2
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
717 gassetup_color_code_ppo2_1:
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
718 call PLED_warnings_color
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
719 gassetup_color_code_ppo2_2:
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
720 call word_processor
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
721 call PLED_standard_color
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
722
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
723 WIN_TOP .95
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
724 WIN_LEFT .95
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
725 lfsr FSR2,letter
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
726 movlw '+'
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
727 btfsc first_FA
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
728 movlw '-'
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
729 movwf POSTINC2
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
730 call word_processor
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
731
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
732 ; Show MOD as "default"
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
733 WIN_TOP .155
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
734 WIN_LEFT .78
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
735 lfsr FSR2, letter
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
736 GETCUSTOM8 .18 ; ppO2 warnvalue in WREG
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
737 mullw d'10'
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
738 movff PRODL,xA+0
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
739 movff PRODH,xA+1 ; ppO2 in [0.01Bar] * 10
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
740
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
741 movf divemins+0,W
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
742 addlw 0x06
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
743 movwf EEADR
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
744 call read_eeprom ; O2 value
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
745 movff EEDATA,xB+0
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
746 clrf xB+1
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
747 call div16x16 ; xA/xB=xC with xA as remainder
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
748 movlw d'10'
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
749 subwf xC+0,F ; Subtract 10m...
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
750 movff xC+0,lo
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
751 movlw d'0'
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
752 subwfb xC+1,F
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
753 movff xC+1,hi
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
754
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
755 btfsc second_FA ; Is first gas?
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
756 clrf lo ; Yes, display 0m
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
757 btfsc second_FA ; Is first gas?
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
758 clrf hi ; Yes, display 0m
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
759
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
760 output_16
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
761 STRCAT_PRINT "m "
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
762
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
763 WIN_TOP .35
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
764 WIN_LEFT .20
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
765 lfsr FSR2,letter
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
766 OUTPUTTEXT .105 ; "Active Gas? "
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
767
287
5f2fe81fde9f Don't force gas with depth>0 to be active.
JeanDo
parents: 286
diff changeset
768 ; Active gas flags in BIT0:4 ....
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
769 movff decodata+0,lo ; Gas 0-4
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
770 incf lo,F ; Gas 1-5
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
771
287
5f2fe81fde9f Don't force gas with depth>0 to be active.
JeanDo
parents: 286
diff changeset
772 read_int_eeprom d'27' ; read flag register
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
773 active_gas_display:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
774 rrcf EEDATA ; roll flags into carry
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
775 decfsz lo,F ; max. 5 times...
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
776 bra active_gas_display
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
777
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
778 btfss STATUS,C ; test carry
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
779 bra active_gas_display_no
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
780
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
781 OUTPUTTEXT .96 ; Yes
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
782 bra active_gas_display_end
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
783
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
784 active_gas_display_no:
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 121
diff changeset
785 STRCAT " " ; three spaces instead of "Yes"
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
786
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
787 active_gas_display_end:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
788 call word_processor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
789
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
790 call wait_switches ; Waits until switches are released, resets flag if button stays pressed!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
791 call PLED_menu_cursor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
792
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
793 next_gas_page_loop:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
794 call check_switches_logbook
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
795
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
796 btfsc menubit3
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
797 bra next_gas_page2 ; move cursor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
798
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
799 btfsc menubit2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
800 bra do_next_gas_page ; call submenu
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
801
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
802 btfsc divemode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
803 goto restart ; dive started!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
804
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
805 btfsc onesecupdate
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
806 call timeout_surfmode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
807
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
808 btfsc onesecupdate
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
809 call set_dive_modes
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
810
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
811 bcf onesecupdate ; 1 sec. functions done
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
812
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
813 btfsc sleepmode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
814 bra exit_gassetup
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
815
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
816 bra next_gas_page_loop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
817
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
818 next_gas_page2:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
819 incf menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
820
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
821 movlw d'7'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
822 cpfseq menupos ; =7?
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
823 bra next_gas_page3 ; No
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
824 movlw d'1'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
825 movwf menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
826
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
827 next_gas_page3:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
828 clrf timeout_counter2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
829 call PLED_menu_cursor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
830
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
831 call wait_switches ; Waits until switches are released, resets flag if button stays pressed!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
832
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
833 bcf menubit3 ; clear flag
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
834 bra next_gas_page_loop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
835
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
836 do_next_gas_page:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
837 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
838 bra toggle_active_gas
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
839 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
840 bra make_first_gas
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
841 dcfsnz menupos,F
297
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
842 bra change_gas_depth_plus_minus
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
843 dcfsnz menupos,F
297
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
844 bra change_gas_depth_apply
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
845 dcfsnz menupos,F
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
846 bra change_gas_depth_default
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
847 bra next_gas
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
848
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
849 make_first_gas:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
850 movff decodata+0,EEDATA ; current gas (0-4) into EEDATA
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
851 incf EEDATA,F ; current gas (1-5) into EEDATA
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
852 movlw d'33'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
853 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
854 call write_eeprom ; store in internal EEPROM
115
50a06adabc67 First gas is active, Gauge mode display
heinrichsweikamp
parents: 105
diff changeset
855
50a06adabc67 First gas is active, Gauge mode display
heinrichsweikamp
parents: 105
diff changeset
856 ; Set First gas to "Active"
50a06adabc67 First gas is active, Gauge mode display
heinrichsweikamp
parents: 105
diff changeset
857 read_int_eeprom d'27' ; read flag register
50a06adabc67 First gas is active, Gauge mode display
heinrichsweikamp
parents: 105
diff changeset
858 movff decodata+0,lo ; selected gas 0-4
50a06adabc67 First gas is active, Gauge mode display
heinrichsweikamp
parents: 105
diff changeset
859 incf lo,F
50a06adabc67 First gas is active, Gauge mode display
heinrichsweikamp
parents: 105
diff changeset
860 dcfsnz lo,F
50a06adabc67 First gas is active, Gauge mode display
heinrichsweikamp
parents: 105
diff changeset
861 bsf EEDATA,0
50a06adabc67 First gas is active, Gauge mode display
heinrichsweikamp
parents: 105
diff changeset
862 dcfsnz lo,F
50a06adabc67 First gas is active, Gauge mode display
heinrichsweikamp
parents: 105
diff changeset
863 bsf EEDATA,1
50a06adabc67 First gas is active, Gauge mode display
heinrichsweikamp
parents: 105
diff changeset
864 dcfsnz lo,F
50a06adabc67 First gas is active, Gauge mode display
heinrichsweikamp
parents: 105
diff changeset
865 bsf EEDATA,2
50a06adabc67 First gas is active, Gauge mode display
heinrichsweikamp
parents: 105
diff changeset
866 dcfsnz lo,F
50a06adabc67 First gas is active, Gauge mode display
heinrichsweikamp
parents: 105
diff changeset
867 bsf EEDATA,3
50a06adabc67 First gas is active, Gauge mode display
heinrichsweikamp
parents: 105
diff changeset
868 dcfsnz lo,F
50a06adabc67 First gas is active, Gauge mode display
heinrichsweikamp
parents: 105
diff changeset
869 bsf EEDATA,4
50a06adabc67 First gas is active, Gauge mode display
heinrichsweikamp
parents: 105
diff changeset
870 write_int_eeprom d'27' ; write flag register
50a06adabc67 First gas is active, Gauge mode display
heinrichsweikamp
parents: 105
diff changeset
871
297
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
872 movlw d'2'
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
873 movwf menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
874 bra next_gas_page1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
875
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
876 toggle_active_gas:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
877 read_int_eeprom d'27' ; read flag register
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
878 movff decodata+0,lo ; selected gas 0-4
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
879 incf lo,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
880 dcfsnz lo,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
881 btg EEDATA,0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
882 dcfsnz lo,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
883 btg EEDATA,1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
884 dcfsnz lo,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
885 btg EEDATA,2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
886 dcfsnz lo,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
887 btg EEDATA,3
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
888 dcfsnz lo,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
889 btg EEDATA,4
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
890 write_int_eeprom d'27' ; write flag register
297
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
891 movlw d'1'
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
892 movwf menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
893 bra next_gas_page1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
894
297
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
895 change_gas_depth_apply: ; Apply +1 or -1m
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
896 movf decodata+0,W ; read current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
897 addlw d'28' ; offset in memory
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
898 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
899 call read_eeprom ; Low-value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
900 movff EEDATA,lo
297
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
901
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
902 btfsc first_FA ; Minus?
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
903 bra change_gas_depth_minus ; yes, minus!
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
904 ; +1m
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
905
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
906 incf lo,F ; increase depth
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
907 movlw d'100' ; Change depth limit + 1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
908 cpfseq lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
909 bra change_gas_depth_plus2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
910 movlw d'99' ; Change depth limit
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
911 movwf lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
912 change_gas_depth_plus2:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
913 movff lo,EEDATA ; write result
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
914 call write_eeprom ; save result in EEPROM
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
915
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
916 movlw d'4'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
917 movwf menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
918 bra next_gas_page1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
919
297
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
920 change_gas_depth_minus:
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
921 decf lo,F ; decrease depth
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
922 btfss lo,7 ; 255?
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
923 bra change_gas_depth_plus2 ; no, exit
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
924 clrf lo
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
925 bra change_gas_depth_plus2 ; exit
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
926
297
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
927 change_gas_depth_plus_minus:
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
928 btg first_FA
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
929 movlw d'3'
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
930 movwf menupos
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
931 bra next_gas_page1
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
932
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
933 change_gas_depth_default:
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
934 GETCUSTOM8 .18 ; ppO2 warnvalue in WREG
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
935 mullw d'10'
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
936 movff PRODL,xA+0
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
937 movff PRODH,xA+1 ; ppO2 in [0.01Bar] * 10
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
938
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
939 movf divemins+0,W
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
940 addlw 0x06
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
941 movwf EEADR
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
942 call read_eeprom ; O2 value
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
943 movff EEDATA,xB+0
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
944 clrf xB+1
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
945 call div16x16 ; xA/xB=xC with xA as remainder
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
946 movlw d'10'
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
947 subwf xC+0,F ; Subtract 10m...
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
948 movff xC+0,lo
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
949 movlw d'0'
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
950 subwfb xC+1,F
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
951 movff xC+1,hi
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
952
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
953 movf decodata+0,W ; read current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
954 addlw d'28' ; offset in memory
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
955 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
956 call read_eeprom ; Low-value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
957 movff lo,EEDATA ; write result
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
958 call write_eeprom ; save result in EEPROM
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
959
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
960 movlw d'5'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
961 movwf menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
962 bra next_gas_page1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
963
297
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
964
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
965 ; Changed v1.44se
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
966 gassetup_title_bar2:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
967 call PLED_topline_box
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
968 WIN_INVERT .1 ; Init new Wordprocessor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
969 WIN_TOP .2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
970 WIN_LEFT .0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
971 lfsr FSR2,letter
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
972 OUTPUTTEXT .95 ; Gas#
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
973 movff decodata+0,lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
974 incf lo,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
975 bsf leftbind
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
976 output_99
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 121
diff changeset
977 STRCAT_PRINT ": "
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
978
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
979 WIN_TOP .2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
980 WIN_LEFT .50
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
981 lfsr FSR2,letter
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
982
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
983 ;He check
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
984 movf divemins+0,W
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
985 addlw 0x07
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
986 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
987 call read_eeprom ; He value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
988 movff EEDATA,lo ; Move EEData -> lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
989 movf lo,f ; Move lo -> f
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
990 movlw d'0' ; Move 0 -> WREG
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
991 cpfsgt lo ; He > 0?
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
992 bra gassetup_title_bar3 ; NO check o2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
993
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
994 ; YES Write TX 15/55
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
995 call gassetup_write_Tx ; Write TX
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
996 movf divemins+0,W
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
997 addlw 0x06
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
998 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
999 call read_eeprom ; O2 value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1000 movff EEDATA,lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1001 output_8 ; Write O2
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 121
diff changeset
1002 PUTC '/'
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1003 movf divemins+0,W
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1004 addlw 0x07
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1005 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1006 call read_eeprom ; He value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1007 movff EEDATA,lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1008 output_8 ; Write He
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1009 bra gassetup_title_bar7
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1010
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1011 ; New v1.44se
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1012 gassetup_title_bar3: ; O2 Check
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1013 movf divemins+0,W
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1014 addlw 0x06
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1015 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1016 call read_eeprom ; O2 value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1017 movff EEDATA,lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1018 movf lo,f ; Move lo -> f
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1019 movlw d'21' ; Move 21 -> WREG
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1020 cpfseq lo ; o2 = 21
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1021 cpfsgt lo ; o2 > 21%
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1022 bra gassetup_title_bar5 ; NO AIR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1023 movlw d'100' ; Move 100 -> WREG
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1024 cpfslt lo ; o2 < 100%
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1025 bra gassetup_title_bar4 ; NO write O2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1026
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1027 ; YES Write NX 32
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1028 call gassetup_write_Nx
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1029 output_8
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1030 bra gassetup_title_bar7
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1031
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1032 ; New v1.44se
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1033 gassetup_title_bar4:
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 121
diff changeset
1034 STRCAT "O2 "
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1035 output_8
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1036 bra gassetup_title_bar7
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1037
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1038 ; New v1.44se
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1039 gassetup_title_bar5:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1040 cpfseq lo ; o2 = 21%
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1041 bra gassetup_title_bar6
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1042
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 121
diff changeset
1043 STRCAT "AIR "
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1044 output_8
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1045 bra gassetup_title_bar7
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1046
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1047 ; New v1.44se
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1048 gassetup_title_bar6: ; ERROR
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 121
diff changeset
1049 STRCAT "ERR "
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1050 output_8
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1051 bra gassetup_title_bar7
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1052
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1053 gassetup_title_bar7:
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 121
diff changeset
1054 STRCAT " in "
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1055 movf decodata+0,W ; read current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1056 addlw d'28' ; offset in memory
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1057 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1058 call read_eeprom ; Low-value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1059 movff EEDATA,lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1060 output_8
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 121
diff changeset
1061 STRCAT_PRINT "m "
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1062
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1063 WIN_INVERT .0 ; Init new Wordprocessor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1064 return
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1065
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1066 ; New v1.44se
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1067 gassetup_write_Nx:
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 121
diff changeset
1068 STRCAT "NX "
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1069 return
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1070
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1071 ; New v1.44se
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1072 gassetup_write_Tx:
123
6a94f96e9cea The big cleanup, again.
JeanDo
parents: 121
diff changeset
1073 STRCAT "TX "
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1074 return
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1075
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1076 gassetup_show_ppO2:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1077 movf divemins+0,W
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1078 addlw 0x06
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1079 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1080 call read_eeprom ; O2 value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1081 movff EEDATA,hi
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1082
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1083 movf decodata+0,W ; read current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1084 addlw d'28' ; offset in memory
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1085 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1086 call read_eeprom ; Change depth in m
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1087 movff EEDATA,lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1088 movlw d'10'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1089 addwf lo,F ; Depth+10m=lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1090 movf hi,W
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1091 mulwf lo ; (Depth+10m)*O2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1092 movff PRODL,xA+0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1093 movff PRODH,xA+1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1094 movlw d'10'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1095 movwf xB+0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1096 clrf xB+1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1097 call div16x16 ;xA/xB=xC with xA as remainder
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1098 movff xC+0,lo ; ((Depth+10m)*O2)/10 = [0.01Bar] ppO2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1099 movff xC+1,hi
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1100 output_16dp d'3'
297
ceedf078b2d8 Gas Setup page 2 reworked, Texts 107, 108, 109,150, 149, 168, 42, 43, 53,54,55, 165 need update in french, spanish and german
Heinrichsweikamp
parents: 290
diff changeset
1101 OUTPUTTEXT d'150' ; bar:
35
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1102 return
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1103
227
8dbcc26878d3 BUGFIX sorting gaslist.
JeanDo
parents: 199
diff changeset
1104 ;=============================================================================
287
5f2fe81fde9f Don't force gas with depth>0 to be active.
JeanDo
parents: 286
diff changeset
1105 ; Make sure first gas is marked active.
5f2fe81fde9f Don't force gas with depth>0 to be active.
JeanDo
parents: 286
diff changeset
1106 ; Note: - Gas are not soted anymore.
5f2fe81fde9f Don't force gas with depth>0 to be active.
JeanDo
parents: 286
diff changeset
1107 ; - Gas with a depth>0 should not be forced active, or it is impossible
5f2fe81fde9f Don't force gas with depth>0 to be active.
JeanDo
parents: 286
diff changeset
1108 ; to de-activate them.
5f2fe81fde9f Don't force gas with depth>0 to be active.
JeanDo
parents: 286
diff changeset
1109 gassetup_sort_gaslist:
286
5351d47ee28a Active gas flags simplified
heinrichsweikamp
parents: 281
diff changeset
1110
287
5f2fe81fde9f Don't force gas with depth>0 to be active.
JeanDo
parents: 286
diff changeset
1111 clrf EEADRH ; Select EEPROM lower page.
5f2fe81fde9f Don't force gas with depth>0 to be active.
JeanDo
parents: 286
diff changeset
1112 read_int_eeprom d'33' ; Get First gas (1-5)
5f2fe81fde9f Don't force gas with depth>0 to be active.
JeanDo
parents: 286
diff changeset
1113 movff EEDATA,lo ; into register lo
286
5351d47ee28a Active gas flags simplified
heinrichsweikamp
parents: 281
diff changeset
1114
287
5f2fe81fde9f Don't force gas with depth>0 to be active.
JeanDo
parents: 286
diff changeset
1115 read_int_eeprom d'27' ; Read selected gases
286
5351d47ee28a Active gas flags simplified
heinrichsweikamp
parents: 281
diff changeset
1116
287
5f2fe81fde9f Don't force gas with depth>0 to be active.
JeanDo
parents: 286
diff changeset
1117 dcfsnz lo,F ; If lo==1
5f2fe81fde9f Don't force gas with depth>0 to be active.
JeanDo
parents: 286
diff changeset
1118 bsf EEDATA,0 ; Select Gas1
5f2fe81fde9f Don't force gas with depth>0 to be active.
JeanDo
parents: 286
diff changeset
1119 dcfsnz lo,F ; If lo==2
5f2fe81fde9f Don't force gas with depth>0 to be active.
JeanDo
parents: 286
diff changeset
1120 bsf EEDATA,1 ; Select Gas2
5f2fe81fde9f Don't force gas with depth>0 to be active.
JeanDo
parents: 286
diff changeset
1121 dcfsnz lo,F
5f2fe81fde9f Don't force gas with depth>0 to be active.
JeanDo
parents: 286
diff changeset
1122 bsf EEDATA,2
5f2fe81fde9f Don't force gas with depth>0 to be active.
JeanDo
parents: 286
diff changeset
1123 dcfsnz lo,F
5f2fe81fde9f Don't force gas with depth>0 to be active.
JeanDo
parents: 286
diff changeset
1124 bsf EEDATA,3
5f2fe81fde9f Don't force gas with depth>0 to be active.
JeanDo
parents: 286
diff changeset
1125 dcfsnz lo,F
5f2fe81fde9f Don't force gas with depth>0 to be active.
JeanDo
parents: 286
diff changeset
1126 bsf EEDATA,4
5f2fe81fde9f Don't force gas with depth>0 to be active.
JeanDo
parents: 286
diff changeset
1127
5f2fe81fde9f Don't force gas with depth>0 to be active.
JeanDo
parents: 286
diff changeset
1128 ; Copy result to register:
290
4dbff2aa31ee Hunting for refusing to ignore disabled gas in list...
JeanDo
parents: 287
diff changeset
1129 movff EEDATA,gaslist_active
287
5f2fe81fde9f Don't force gas with depth>0 to be active.
JeanDo
parents: 286
diff changeset
1130
5f2fe81fde9f Don't force gas with depth>0 to be active.
JeanDo
parents: 286
diff changeset
1131 ; And write to EEPROM too, to survive next reboot:
5f2fe81fde9f Don't force gas with depth>0 to be active.
JeanDo
parents: 286
diff changeset
1132 write_int_eeprom d'27'
286
5351d47ee28a Active gas flags simplified
heinrichsweikamp
parents: 281
diff changeset
1133
5351d47ee28a Active gas flags simplified
heinrichsweikamp
parents: 281
diff changeset
1134 return
281
f8f865c70a0d no more sorted gaslist...
heinrichsweikamp
parents: 272
diff changeset
1135
287
5f2fe81fde9f Don't force gas with depth>0 to be active.
JeanDo
parents: 286
diff changeset
1136 ;=============================================================================
35
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1137 ; EEPROM Locations of Gaslist
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1138 ; Gas1:
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1139 ; O2 Default:4
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1140 ; He Default:5
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1141 ; O2 Current:6
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1142 ; He Current:7
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1143 ; Change: 28
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1144 ; Active: 27,0
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1145
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1146 ; Gas2:
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1147 ; O2 Default:8
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1148 ; He Default:9
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1149 ; O2 Current:10
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1150 ; He Current:11
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1151 ; Change: 29
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1152 ; Active: 27,1
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1153
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1154 ; Gas3:
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1155 ; O2 Default:12
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1156 ; He Default:13
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1157 ; O2 Current:14
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1158 ; He Current:15
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1159 ; Change: 30
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1160 ; Active: 27,2
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1161
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1162 ; Gas4:
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1163 ; O2 Default:16
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1164 ; He Default:17
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1165 ; O2 Current:18
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1166 ; He Current:19
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1167 ; Change: 31
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1168 ; Active: 27,3
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1169
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1170 ; Gas5:
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1171 ; O2 Default:20
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1172 ; He Default:21
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1173 ; O2 Current:22
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1174 ; He Current:23
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1175 ; Change: 32
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1176 ; Active: 27,4