annotate code_part1/OSTC_code_asm_part1/menu_gassetup.asm @ 35:d4f0c097a7fa

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