annotate code_part1/OSTC_code_asm_part1/menu_gassetup.asm @ 14:239cb2cdc0c9

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