annotate code_part1/OSTC_code_asm_part1/menu_gassetup.asm @ 121:e0f29e20bd24

Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
author JeanDo
date Sun, 26 Dec 2010 23:49:11 +0100
parents 50a06adabc67
children 6a94f96e9cea
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
2 ; OSTC - diving computer code
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
3 ; Copyright (C) 2008 HeinrichsWeikamp GbR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
4
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
5 ; This program is free software: you can redistribute it and/or modify
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
6 ; it under the terms of the GNU General Public License as published by
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
7 ; the Free Software Foundation, either version 3 of the License, or
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
8 ; (at your option) any later version.
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
9
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
10 ; This program is distributed in the hope that it will be useful,
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
11 ; but WITHOUT ANY WARRANTY; without even the implied warranty of
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
12 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
13 ; GNU General Public License for more details.
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
14
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
15 ; You should have received a copy of the GNU General Public License
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
16 ; along with this program. If not, see <http://www.gnu.org/licenses/>.
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
17
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
18
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
19 ; Gas Setup menu
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
20 ; written by: Matthias Heinrichs, info@heinrichsweikamp.com
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
21 ; written: 10/08/07
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
22 ; last updated: 080906
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
23 ; known bugs:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
24 ; ToDo:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
25
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
26 menu_gassetup:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
27 movlw d'1'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
28 movwf menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
29
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
30 menu_gassetup_prelist:
36
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
31 call PLED_ClearScreen
47
56aea9fcdd8f 1.65beta release
heinrichsweikamp
parents: 45
diff changeset
32 call gassetup_sort_gaslist ; Sorts Gaslist according to change depth
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
33 clrf timeout_counter2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
34 bcf sleepmode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
35 bcf menubit2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
36 bcf menubit3
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
37 call PLED_topline_box
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
38 WIN_INVERT .1 ; Init new Wordprocessor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
39 DISPLAYTEXT .106 ; Gas List
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
40 WIN_INVERT .0 ; Init new Wordprocessor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
41 clrf decodata+0 ; Here: # of gas 0-4
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
42 clrf divemins+0 ; Here: # of Gas * 4
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
43 movlw d'5'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
44 movwf waitms_temp ; here: stores row for gas list
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
45 movlw d'2'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
46 movwf wait_temp ; here: stores eeprom address for gas list
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
47
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
48 ; Changed v1.44se
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
49 menu_gassetup_list:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
50 WIN_LEFT .20
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
51 movlw d'4'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
52 addwf wait_temp,F ; Increase eeprom address for gas list
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
53 movlw d'30'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
54 addwf waitms_temp,F ; Increase row
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
55 movf waitms_temp,W ; Load row into WREG
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
56 movff WREG,win_top
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
57 lfsr FSR2,letter
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
58 movlw 'G'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
59 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
60 movff decodata+0,lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
61 incf lo,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
62 bsf leftbind
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
63 output_99
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
64 movlw ':'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
65 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
66
121
e0f29e20bd24 Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents: 115
diff changeset
67 movf decodata+0,W
e0f29e20bd24 Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents: 115
diff changeset
68 call PLED_grey_inactive_gas ; Sets Greyvalue for inactive gases
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
69 call word_processor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
70 WIN_LEFT .40
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
71 movf waitms_temp,W ; Load row into WREG
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
72 movff WREG,win_top
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
73 lfsr FSR2,letter
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
74
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
75 movlw d'33'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
76 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
77 call read_eeprom ; Get current startgas 1-5 # into EEDATA
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
78 decf EEDATA,W ; 0-4
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
79 cpfseq decodata+0 ; =current displayed gas #?
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
80 bra menu_gassetup_Tx ; no, do not display *
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
81 movlw '*' ; display *
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
82 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
83
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
84 ; New v1.44se
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
85 menu_gassetup_Tx:
121
e0f29e20bd24 Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents: 115
diff changeset
86 movf decodata+0,W
e0f29e20bd24 Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents: 115
diff changeset
87 call PLED_grey_inactive_gas ; Sets Greyvalue for inactive gases
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
88 call word_processor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
89
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
90 WIN_LEFT .48
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
91 movf waitms_temp,W ; Load row into WREG
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
92 movff WREG,win_top
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
93 lfsr FSR2,letter
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
94
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
95 movff wait_temp, EEADR ; Gas %He - Set address in internal EEPROM
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
96 incf EEADR,F ; Gas %He - Set address in internal EEPROM
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
97 call read_eeprom ; Read He value from EEPROM
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
98 movff EEDATA,lo ; Move EEDATA -> lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
99 movf lo,f ; Move lo -> f
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
100 movlw d'0' ; Move 0 -> WREG
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
101 cpfsgt lo ; He > 0?
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
102 bra menu_gassetup_Nx ; NO check o2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
103
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
104 ; YES Write TX 15/55
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
105 call gassetup_write_Tx
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
106 movff wait_temp, EEADR ; Gas %O2 - Set address in internal EEPROM
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
107 call read_eeprom ; O2 value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
108 movff EEDATA,lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
109 output_8
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
110 movlw '/'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
111 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
112 incf EEADR,F ; Gas #hi: %He - Set address in internal EEPROM
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
113 call read_eeprom ; He value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
114 movff EEDATA,lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
115 output_8
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
116 bra menu_gassetup_list0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
117
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
118 ; New v1.44se
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
119 menu_gassetup_Nx:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
120 movff wait_temp, EEADR ; Gas %O2 - Set address in internal EEPROM
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
121 call read_eeprom ; Read O2 value from EEPROM
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
122 movff EEDATA,lo ; Move EEDATA -> lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
123 movf lo,f ; Move lo -> f
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
124 movlw d'21' ; Move 21 -> WREG
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
125 cpfsgt lo ; o2 > 21%
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
126 bra menu_gassetup_Air ; NO AIR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
127 movlw d'100' ; Move 100 -> WREG
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
128 cpfslt lo ; o2 < 100%
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
129 bra menu_gassetup_O2 ; NO write O2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
130
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
131 ; YES Write NX 32
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
132 call gassetup_write_Nx
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
133 output_8
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
134 bra menu_gassetup_list0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
135
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
136 ; New v1.44se
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
137 menu_gassetup_O2:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
138 movlw 'O'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
139 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
140 movlw '2'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
141 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
142 movlw ' '
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
143 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
144 output_8
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
145 bra menu_gassetup_list0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
146
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
147 ; New v1.44se
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
148 menu_gassetup_Air:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
149 cpfseq lo ; o2 = 21%
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
150 call menu_gassetup_Err
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
151
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
152 movlw 'A'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
153 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
154 movlw 'I'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
155 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
156 movlw 'R'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
157 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
158 movlw ' '
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
159 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
160 output_8
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
161 bra menu_gassetup_list0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
162
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
163 ; New v1.44se
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
164 menu_gassetup_Err:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
165 movlw 'E'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
166 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
167 movlw 'R'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
168 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
169 movlw 'R'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
170 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
171 movlw ' '
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
172 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
173 output_8
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
174
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
175 ; Changed v1.44se
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
176 menu_gassetup_list0:
121
e0f29e20bd24 Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents: 115
diff changeset
177 movf decodata+0,W
e0f29e20bd24 Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents: 115
diff changeset
178 call PLED_grey_inactive_gas ; Sets Greyvalue for inactive gases
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
179 call word_processor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
180
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
181 WIN_LEFT .105
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
182 movf waitms_temp,W ; Load row into WREG
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
183 movff WREG,win_top
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
184 lfsr FSR2,letter
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
185
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
186 movlw ' '
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
187 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
188 movlw 'i'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
189 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
190 movlw 'n'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
191 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
192 movlw ' '
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
193 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
194 movf decodata+0,W ; read current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
195 addlw d'28' ; offset in memory
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
196 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
197 call read_eeprom ; Low-value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
198 movff EEDATA,lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
199 output_8
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
200 movlw 'm'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
201 movwf POSTINC2
121
e0f29e20bd24 Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents: 115
diff changeset
202 movf decodata+0,W
e0f29e20bd24 Mix-type icons: check apnoe/gauge/CF#41, depth=0, and first gas. Changed colors.
JeanDo
parents: 115
diff changeset
203 call PLED_grey_inactive_gas ; Sets Greyvalue for inactive gases
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
204 call word_processor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
205
3
3cf8af30b36e v1.51 beta
heinrichsweikamp
parents: 0
diff changeset
206 call PLED_standard_color
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
207
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
208 incf decodata+0,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
209 movlw d'5'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
210 cpfseq decodata+0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
211 goto menu_gassetup_list
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
212
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
213 DISPLAYTEXT .11 ; Exit
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
214 call wait_switches ; Waits until switches are released, resets flag if button stays pressed!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
215 call PLED_menu_cursor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
216
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
217 gassetup_list_loop:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
218 call check_switches_logbook
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
219
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
220 btfsc menubit3
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
221 bra gassetup_list2 ; move cursor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
222
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
223 btfsc menubit2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
224 bra do_gassetup_list; call gas-specific submenu
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
225
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
226 btfsc divemode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
227 goto restart ; dive started!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
228
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
229 btfsc onesecupdate
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
230 call timeout_surfmode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
231
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
232 btfsc onesecupdate
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
233 call set_dive_modes
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
234
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
235 bcf onesecupdate ; 1 sec. functions done
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
236
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
237 btfsc sleepmode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
238 bra exit_gassetup_list
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
239
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
240 bra gassetup_list_loop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
241
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
242 gassetup_list2:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
243 incf menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
244 movlw d'7'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
245 cpfseq menupos ; =7?
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
246 bra gassetup_list3 ; No
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
247 movlw d'1'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
248 movwf menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
249
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
250 gassetup_list3:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
251 clrf timeout_counter2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
252 call PLED_menu_cursor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
253
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
254 call wait_switches ; Waits until switches are released, resets flag if button stays pressed!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
255
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
256 bcf menubit3 ; clear flag
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
257 bra gassetup_list_loop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
258
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
259 exit_gassetup_list: ; exit...
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
260 movlw d'2'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
261 movwf menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
262 goto menu2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
263
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
264 do_gassetup_list:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
265 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
266 bra gassetup_list_edit_gas1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
267 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
268 bra gassetup_list_edit_gas2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
269 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
270 bra gassetup_list_edit_gas3
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
271 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
272 bra gassetup_list_edit_gas4
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
273 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
274 bra gassetup_list_edit_gas5
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
275 bra exit_gassetup_list ; Exit List
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
276
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
277 gassetup_list_edit_gas1:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
278 movlw d'0'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
279 movwf decodata+0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
280 movlw d'0'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
281 movwf divemins+0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
282 bra menu_gassetup_page1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
283
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
284 gassetup_list_edit_gas2:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
285 movlw d'1'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
286 movwf decodata+0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
287 movlw d'4'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
288 movwf divemins+0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
289 bra menu_gassetup_page1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
290
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
291 gassetup_list_edit_gas3:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
292 movlw d'2'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
293 movwf decodata+0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
294 movlw d'8'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
295 movwf divemins+0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
296 bra menu_gassetup_page1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
297
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
298 gassetup_list_edit_gas4:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
299 movlw d'3'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
300 movwf decodata+0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
301 movlw d'12'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
302 movwf divemins+0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
303 bra menu_gassetup_page1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
304
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
305 gassetup_list_edit_gas5:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
306 movlw d'4'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
307 movwf decodata+0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
308 movlw d'16'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
309 movwf divemins+0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
310 bra menu_gassetup_page1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
311
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
312 menu_gassetup_page1:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
313 movlw d'1'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
314 movwf menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
315 bcf gas_setup_page2 ; Page 1 of gassetup
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
316 bcf menubit4
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
317 bcf cursor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
318 bcf sleepmode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
319 bcf first_FA ; Here: =1: -, =0: +
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
320
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
321 menu_gassetup0:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
322 call PLED_ClearScreen
98
6f8e3a08011e 1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents: 50
diff changeset
323 DISPLAYTEXT .147 ; More...
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
324 DISPLAYTEXT .11 ; Exit
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
325
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
326 menu_gassetup1:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
327 clrf timeout_counter2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
328 bcf menubit2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
329 bcf menubit3
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
330
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
331 rcall gassetup_title_bar2 ; Displays the title bar with the current Gas info
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
332
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
333 WIN_TOP .65
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
334 WIN_LEFT .20
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
335 lfsr FSR2,letter
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
336 movlw 'O'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
337 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
338 movlw '2'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
339 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
340 movlw ':'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
341 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
342 movlw ' '
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
343 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
344
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
345 movf divemins+0,W
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
346 addlw 0x06
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
347 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
348 call read_eeprom ; O2 value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
349 movff EEDATA,lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
350 output_8
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
351 movlw '%'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
352 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
353 movlw ' '
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
354 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
355 movlw '('
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
356 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
357 movlw 'M'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
358 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
359 movlw 'O'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
360 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
361 movlw 'D'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
362 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
363 movlw ':'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
364 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
365
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
366 ; Show MOD in m
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
367 GETCUSTOM8 .18 ; ppO2 warnvalue in WREG
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
368 mullw d'10'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
369 movff PRODL,xA+0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
370 movff PRODH,xA+1 ; ppO2 in [0.01Bar] * 10
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
371
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
372 movf divemins+0,W
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
373 addlw 0x06
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
374 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
375 call read_eeprom ; O2 value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
376 movff EEDATA,xB+0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
377 clrf xB+1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
378 call div16x16 ;xA/xB=xC with xA as remainder
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
379 movlw d'10'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
380 subwf xC+0,F ; Subtract 10m...
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
381 movff xC+0,lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
382 movlw d'0'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
383 subwfb xC+1,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
384 movff xC+1,hi
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
385 output_16
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
386 movlw 'm'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
387 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
388 movlw ')'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
389 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
390 movlw ' '
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
391 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
392 movlw ' '
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
393 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
394 call word_processor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
395
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
396 WIN_TOP .95
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
397 lfsr FSR2,letter
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
398 movlw 'H'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
399 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
400 movlw 'e'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
401 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
402 movlw ':'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
403 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
404 movlw ' '
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
405 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
406 movf divemins+0,W
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
407 addlw 0x07
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
408 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
409 call read_eeprom ; He value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
410 movff EEDATA,lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
411 output_8
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
412 movlw '%'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
413 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
414 movlw ' '
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
415 movwf POSTINC2
105
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
416 movlw '('
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
417 movwf POSTINC2
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
418 movlw 'E'
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
419 movwf POSTINC2
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
420 movlw 'N'
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
421 movwf POSTINC2
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
422 movlw 'D'
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
423 movwf POSTINC2
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
424 movlw ':'
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
425 movwf POSTINC2
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
426
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
427 ; Show END in m
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
428 GETCUSTOM8 .18 ; ppO2 warnvalue in WREG
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
429 mullw d'10'
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
430 movff PRODL,xA+0
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
431 movff PRODH,xA+1 ; ppO2 in [0.01Bar] * 10
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
432 movf divemins+0,W
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
433 addlw 0x06
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
434 movwf EEADR
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
435 call read_eeprom ; O2 value
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
436 movff EEDATA,xB+0
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
437 clrf xB+1
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
438 call div16x16 ;xA/xB=xC with xA as remainder
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
439 movlw d'10'
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
440 subwf xC+0,F ; Subtract 10m...
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
441 movff xC+0,lo
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
442 movlw d'0'
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
443 subwfb xC+1,F
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
444 movff xC+1,hi ; lo:hi holding MOD in meters
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
445 movlw d'10'
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
446 addwf lo,F
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
447 movlw d'0'
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
448 addwfc hi,F ; lo:hi holding MOD+10m
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
449
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
450 movf divemins+0,W
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
451 addlw 0x07
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
452 movwf EEADR
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
453 call read_eeprom ; He value in % -> EEDATA
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
454 movlw d'100'
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
455 movwf xA+0
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
456 movf EEDATA,W ; He value in % -> EEDATA
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
457 subwf xA+0,F ; xA+0 = 100 - He Value in %
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
458 clrf xA+1
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
459 movff lo,xB+0
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
460 movff hi,xB+1 ; Copy MOD+10
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
461 call mult16x16 ;xA*xB=xC
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
462 movff xC+0,xA+0
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
463 movff xC+1,xA+1
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
464 movlw d'100'
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
465 movwf xB+0
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
466 clrf xB+1
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
467 call div16x16 ;xA/xB=xC with xA as remainder
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
468 ; xC:2 = ((MOD+10) * 100 - HE Value in %) / 100
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
469 movlw d'10'
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
470 subwf xC+0,F ; Subtract 10m...
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
471 movff xC+0,lo
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
472 movlw d'0'
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
473 subwfb xC+1,F
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
474 movff xC+1,hi
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
475 output_16
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
476 movlw 'm'
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
477 movwf POSTINC2
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
478 movlw ')'
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
479 movwf POSTINC2
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
480 movlw ' '
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
481 movwf POSTINC2
105
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
482 movlw ' '
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
483 movwf POSTINC2
64109f6fb3d1 added END to GasSetup, small fixes
heinrichsweikamp
parents: 98
diff changeset
484
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
485 call word_processor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
486
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
487 WIN_TOP .125
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
488 lfsr FSR2,letter
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
489 movlw '+'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
490 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
491 movlw '/'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
492 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
493 movlw '-'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
494 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
495 movlw ':'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
496 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
497 movlw ' '
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
498 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
499 movlw '+'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
500 btfsc first_FA
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
501 movlw '-'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
502 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
503 call word_processor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
504
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
505 WIN_TOP .155
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
506 lfsr FSR2,letter
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
507 OUTPUTTEXT .89 ; Default:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
508 movf divemins+0,W
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
509 addlw 0x04
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
510 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
511 call read_eeprom ; Default O2 value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
512 movff EEDATA,lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
513 output_8
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
514 movlw '/'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
515 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
516 movf divemins+0,W
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
517 addlw 0x05
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
518 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
519 call read_eeprom ; Default He value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
520 movff EEDATA,lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
521 output_8
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
522 movlw ' '
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
523 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
524 movlw ' '
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
525 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
526 call word_processor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
527
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
528 call wait_switches ; Waits until switches are released, resets flag if button stays pressed!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
529 call PLED_menu_cursor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
530
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
531 gassetup_loop:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
532 call check_switches_logbook
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
533
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
534 btfsc menubit3
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
535 bra gassetup2 ; move cursor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
536
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
537 btfsc menubit2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
538 bra do_gassetup ; call submenu
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
539
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
540 btfsc divemode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
541 goto restart ; dive started!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
542
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
543 btfsc onesecupdate
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
544 call timeout_surfmode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
545
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
546 btfsc onesecupdate
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
547 call set_dive_modes
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
548
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
549 bcf onesecupdate ; 1 sec. functions done
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
550
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
551 btfsc sleepmode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
552 bra exit_gassetup
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
553
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
554 bra gassetup_loop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
555
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
556 gassetup2:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
557 incf menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
558 movlw d'7'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
559 cpfseq menupos ; =7?
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
560 bra gassetup3 ; No
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
561 movlw d'1'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
562 movwf menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
563
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
564 gassetup3:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
565
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
566 clrf timeout_counter2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
567 call PLED_menu_cursor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
568
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
569 call wait_switches ; Waits until switches are released, resets flag if button stays pressed!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
570
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
571 bcf menubit3 ; clear flag
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
572 bra gassetup_loop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
573
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
574 do_gassetup:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
575 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
576 bra next_gas_page
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
577 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
578 bra adjust_o2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
579 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
580 bra adjust_he
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
581 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
582 bra toggle_plus_minus_gassetup
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
583 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
584 bra restore_gas
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
585 exit_gassetup: ; exit...
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
586 movff decodata+0,menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
587 incf menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
588 bra menu_gassetup_prelist
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
589
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
590 toggle_plus_minus_gassetup:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
591 btg first_FA
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
592 movlw d'4'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
593 movwf menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
594 bra menu_gassetup1 ; return
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
595
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
596 next_gas:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
597 movlw d'1'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
598 movwf menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
599 bra menu_gassetup0 ; incl. clear screen
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
600
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
601 adjust_o2:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
602 movf divemins+0,W ; read current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
603 addlw 0x06
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
604 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
605 call read_eeprom ; Low-value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
606 movff EEDATA,lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
607
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
608 btfsc first_FA ; Minus?
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
609 bra adjust_o2_1 ; yes, minus!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
610
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
611 incf lo,F ; increase O2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
612 movlw d'101'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
613 cpfseq lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
614 bra adjust_o2_2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
615 movlw d'4' ; LOWER O2 Limit
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
616 movwf lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
617 bra adjust_o2_2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
618
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
619 adjust_o2_1:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
620 decf lo,F ; decrease O2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
621 movlw d'3'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
622 cpfseq lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
623 bra adjust_o2_2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
624
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
625 movf divemins+0,W
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
626 addlw 0x07
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
627 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
628 call read_eeprom ; read He value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
629
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
630 movlw d'100'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
631 movwf lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
632 movf EEDATA,W ; He value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
633 subwf lo,F ; lo=100% - He%
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
634
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
635 adjust_o2_2: ; test if O2+He>100...
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
636 movf divemins+0,W
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
637 addlw 0x07
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
638 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
639 call read_eeprom ; read He value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
640 movf EEDATA,W ; He value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
641 addwf lo,W ; add O2 value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
642 movwf hi ; store in temp
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
643 movlw d'101'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
644 cpfseq hi ; O2 and He > 100?
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
645 bra adjust_o2_3 ; No!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
646
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
647 movlw d'4' ; LOWER O2 Limit
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
648 movwf lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
649
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
650 adjust_o2_3:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
651 movf divemins+0,W ; save current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
652 addlw 0x06
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
653 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
654 movff lo,EEDATA
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
655 call write_eeprom ; Low-value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
656
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
657 movlw d'2'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
658 movwf menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
659 bra menu_gassetup1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
660
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
661 adjust_he:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
662 movf divemins+0,W ; read current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
663 addlw 0x07
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
664 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
665 call read_eeprom ; Low-value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
666 movff EEDATA,lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
667
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
668 btfsc first_FA ; Minus?
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
669 bra adjust_he_1 ; yes, minus!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
670
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
671 incf lo,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
672 movlw d'92' ; He limited to (useless) 90%
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
673 cpfseq lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
674 bra adjust_he_2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
675 clrf lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
676 bra adjust_he_2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
677
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
678 adjust_he_1:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
679 decf lo,F ; decrease He
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
680 movlw d'255'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
681 cpfseq lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
682 bra adjust_he_2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
683 clrf lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
684
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
685 adjust_he_2: ; test if O2+He>100...
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
686 movf divemins+0,W
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
687 addlw 0x06
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
688 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
689 call read_eeprom ; read He value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
690 movf EEDATA,W ; He value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
691 addwf lo,W ; add O2 value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
692 movwf hi ; store in temp
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
693 movlw d'101'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
694 cpfseq hi ; O2 and He > 100?
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
695 bra adjust_he_3 ; No!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
696 ; clrf lo ; Yes, clear He to zero
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
697 decf lo,F ; reduce He again = unchanged after operation
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
698
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
699 adjust_he_3:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
700 movf divemins+0,W ; save current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
701 addlw 0x07
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
702 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
703 movff lo,EEDATA
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
704 call write_eeprom ; Low-value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
705
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
706 movlw d'3'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
707 movwf menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
708 bra menu_gassetup1 ;
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
709
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
710 restore_gas:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
711 movf divemins+0,W ; read Default value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
712 addlw 0x04
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
713 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
714 call read_eeprom ; Low-value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
715 movff EEDATA,lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
716 movf divemins+0,W
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
717 addlw 0x05
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
718 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
719 call read_eeprom ; High-value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
720 movff EEDATA,hi
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
721
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
722 movf divemins+0,W ; save Default value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
723 addlw 0x06
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
724 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
725 movff lo,EEDATA
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
726 call write_eeprom ; Low-value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
727 movf divemins+0,W
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
728 addlw 0x07
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
729 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
730 movff hi,EEDATA
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
731 call write_eeprom ; High-value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
732
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
733 movlw d'5'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
734 movwf menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
735 bra menu_gassetup1 ;
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
736
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
737
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
738 next_gas_page:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
739 call PLED_ClearScreen
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
740 movlw d'1'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
741 movwf menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
742 DISPLAYTEXT .109 ; Back
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
743
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
744 DISPLAYTEXT .11 ; Exit
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
745
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
746 next_gas_page1:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
747 clrf timeout_counter2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
748 bcf menubit2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
749 bcf menubit3
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
750
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
751 rcall gassetup_title_bar2 ; Displays the title bar with the current Gas info
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
752 rcall gassetup_show_ppO2 ; Display the ppO2 of the change depth with the current gas
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
753
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
754 WIN_TOP .65
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
755 WIN_LEFT .20
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
756 lfsr FSR2,letter
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
757 OUTPUTTEXT .105 ; "Active Gas? "
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
758 read_int_eeprom d'27' ; read flag register
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
759
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
760 ; hi contains active gas flags in BIT0:4 ....
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
761
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
762 movff decodata+0,lo ; Gas 0-4
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
763 incf lo,F ; Gas 1-5
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
764
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
765 active_gas_display:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
766 rrcf EEDATA ; roll flags into carry
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
767 decfsz lo,F ; max. 5 times...
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
768 bra active_gas_display
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
769
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
770 btfss STATUS,C ; test carry
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
771 bra active_gas_display_no
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
772
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
773 OUTPUTTEXT .96 ; Yes
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
774 bra active_gas_display_end
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
775
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
776 active_gas_display_no:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
777 movlw ' ' ; three spaces instead of "Yes"
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
778 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
779 movlw ' '
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
780 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
781 movlw ' '
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
782 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
783
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
784 active_gas_display_end:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
785 call word_processor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
786
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
787 WIN_TOP .95
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
788 WIN_LEFT .20
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
789 lfsr FSR2,letter
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
790 OUTPUTTEXT .88 ; First Gas?
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
791 movlw ' '
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
792 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
793
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
794 movlw d'33'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
795 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
796 call read_eeprom ; Get current startgas 1-5 # into EEDATA
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
797 decf EEDATA,W ; 0-4
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
798 cpfseq decodata+0 ; =current displayed gas #?
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
799 bra menu_firstgas0 ; no, display three spaces
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
800
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
801 OUTPUTTEXT .96 ; Yes
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
802 bra menu_firstgas1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
803
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
804 menu_firstgas0:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
805 movlw ' '
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
806 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
807 movlw ' '
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
808 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
809 movlw ' '
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
810 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
811
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
812 menu_firstgas1:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
813 call word_processor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
814
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
815 WIN_TOP .125
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
816 WIN_LEFT .20
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
817 lfsr FSR2,letter
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
818 OUTPUTTEXT .107 ; Change+
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
819 call word_processor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
820
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
821 WIN_TOP .155
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
822 WIN_LEFT .20
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
823 lfsr FSR2,letter
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
824 OUTPUTTEXT .108 ; Change-
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
825 call word_processor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
826
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
827 call wait_switches ; Waits until switches are released, resets flag if button stays pressed!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
828 call PLED_menu_cursor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
829
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
830 next_gas_page_loop:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
831 call check_switches_logbook
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
832
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
833 btfsc menubit3
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
834 bra next_gas_page2 ; move cursor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
835
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
836 btfsc menubit2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
837 bra do_next_gas_page ; call submenu
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
838
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
839 btfsc divemode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
840 goto restart ; dive started!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
841
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
842 btfsc onesecupdate
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
843 call timeout_surfmode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
844
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
845 btfsc onesecupdate
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
846 call set_dive_modes
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
847
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
848 bcf onesecupdate ; 1 sec. functions done
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
849
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
850 btfsc sleepmode
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
851 bra exit_gassetup
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
852
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
853 bra next_gas_page_loop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
854
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
855 next_gas_page2:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
856 incf menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
857
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
858 movlw d'7'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
859 cpfseq menupos ; =7?
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
860 bra next_gas_page3 ; No
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
861 movlw d'1'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
862 movwf menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
863
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
864 next_gas_page3:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
865 clrf timeout_counter2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
866 call PLED_menu_cursor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
867
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
868 call wait_switches ; Waits until switches are released, resets flag if button stays pressed!
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
869
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
870 bcf menubit3 ; clear flag
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
871 bra next_gas_page_loop
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
872
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
873 do_next_gas_page:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
874 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
875 bra next_gas
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
876 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
877 bra toggle_active_gas
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
878 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
879 bra make_first_gas
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
880 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
881 bra change_gas_depth_plus
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
882 dcfsnz menupos,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
883 bra change_gas_depth_minus
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
884 bra exit_gassetup ; Exit menu
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
885
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
886 make_first_gas:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
887 movff decodata+0,EEDATA ; current gas (0-4) into EEDATA
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
888 incf EEDATA,F ; current gas (1-5) into EEDATA
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
889 movlw d'33'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
890 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
891 call write_eeprom ; store in internal EEPROM
115
50a06adabc67 First gas is active, Gauge mode display
heinrichsweikamp
parents: 105
diff changeset
892
50a06adabc67 First gas is active, Gauge mode display
heinrichsweikamp
parents: 105
diff changeset
893 ; Set First gas to "Active"
50a06adabc67 First gas is active, Gauge mode display
heinrichsweikamp
parents: 105
diff changeset
894 read_int_eeprom d'27' ; read flag register
50a06adabc67 First gas is active, Gauge mode display
heinrichsweikamp
parents: 105
diff changeset
895 movff decodata+0,lo ; selected gas 0-4
50a06adabc67 First gas is active, Gauge mode display
heinrichsweikamp
parents: 105
diff changeset
896 incf lo,F
50a06adabc67 First gas is active, Gauge mode display
heinrichsweikamp
parents: 105
diff changeset
897 dcfsnz lo,F
50a06adabc67 First gas is active, Gauge mode display
heinrichsweikamp
parents: 105
diff changeset
898 bsf EEDATA,0
50a06adabc67 First gas is active, Gauge mode display
heinrichsweikamp
parents: 105
diff changeset
899 dcfsnz lo,F
50a06adabc67 First gas is active, Gauge mode display
heinrichsweikamp
parents: 105
diff changeset
900 bsf EEDATA,1
50a06adabc67 First gas is active, Gauge mode display
heinrichsweikamp
parents: 105
diff changeset
901 dcfsnz lo,F
50a06adabc67 First gas is active, Gauge mode display
heinrichsweikamp
parents: 105
diff changeset
902 bsf EEDATA,2
50a06adabc67 First gas is active, Gauge mode display
heinrichsweikamp
parents: 105
diff changeset
903 dcfsnz lo,F
50a06adabc67 First gas is active, Gauge mode display
heinrichsweikamp
parents: 105
diff changeset
904 bsf EEDATA,3
50a06adabc67 First gas is active, Gauge mode display
heinrichsweikamp
parents: 105
diff changeset
905 dcfsnz lo,F
50a06adabc67 First gas is active, Gauge mode display
heinrichsweikamp
parents: 105
diff changeset
906 bsf EEDATA,4
50a06adabc67 First gas is active, Gauge mode display
heinrichsweikamp
parents: 105
diff changeset
907 write_int_eeprom d'27' ; write flag register
50a06adabc67 First gas is active, Gauge mode display
heinrichsweikamp
parents: 105
diff changeset
908
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
909 movlw d'3'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
910 movwf menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
911 bra next_gas_page1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
912
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
913 toggle_active_gas:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
914 read_int_eeprom d'27' ; read flag register
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
915 movff decodata+0,lo ; selected gas 0-4
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
916 incf lo,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
917 dcfsnz lo,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
918 btg EEDATA,0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
919 dcfsnz lo,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
920 btg EEDATA,1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
921 dcfsnz lo,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
922 btg EEDATA,2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
923 dcfsnz lo,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
924 btg EEDATA,3
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
925 dcfsnz lo,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
926 btg EEDATA,4
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
927 write_int_eeprom d'27' ; write flag register
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
928 movlw d'2'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
929 movwf menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
930 bra next_gas_page1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
931
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
932 change_gas_depth_plus:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
933 movf decodata+0,W ; read current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
934 addlw d'28' ; offset in memory
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
935 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
936 call read_eeprom ; Low-value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
937 movff EEDATA,lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
938
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
939 incf lo,F ; increase depth
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
940 movlw d'100' ; Change depth limit + 1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
941 cpfseq lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
942 bra change_gas_depth_plus2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
943 movlw d'99' ; Change depth limit
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
944 movwf lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
945 change_gas_depth_plus2:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
946 movff lo,EEDATA ; write result
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
947 call write_eeprom ; save result in EEPROM
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
948
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
949 movlw d'4'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
950 movwf menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
951 bra next_gas_page1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
952
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
953
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
954 change_gas_depth_minus:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
955 movf decodata+0,W ; read current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
956 addlw d'28' ; offset in memory
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
957 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
958 call read_eeprom ; Low-value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
959 movff EEDATA,lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
960
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
961 decf lo,F ; decrease depth
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
962 movlw d'255'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
963 cpfseq lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
964 bra change_gas_depth_minus2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
965 movlw d'0'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
966 movwf lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
967
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
968 change_gas_depth_minus2:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
969 movff lo,EEDATA ; write result
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
970 call write_eeprom ; save result in EEPROM
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
971
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
972 movlw d'5'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
973 movwf menupos
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
974 bra next_gas_page1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
975
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
976 ; Changed v1.44se
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
977 gassetup_title_bar2:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
978 call PLED_topline_box
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
979 WIN_INVERT .1 ; Init new Wordprocessor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
980 WIN_TOP .2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
981 WIN_LEFT .0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
982 lfsr FSR2,letter
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
983 OUTPUTTEXT .95 ; Gas#
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
984 movff decodata+0,lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
985 incf lo,F
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
986 bsf leftbind
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
987 output_99
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
988 movlw ':'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
989 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
990 movlw ' '
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
991 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
992 call word_processor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
993
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
994 WIN_TOP .2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
995 WIN_LEFT .50
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
996 lfsr FSR2,letter
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
997
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
998 ;He check
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
999 movf divemins+0,W
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1000 addlw 0x07
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1001 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1002 call read_eeprom ; He value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1003 movff EEDATA,lo ; Move EEData -> lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1004 movf lo,f ; Move lo -> f
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1005 movlw d'0' ; Move 0 -> WREG
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1006 cpfsgt lo ; He > 0?
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1007 bra gassetup_title_bar3 ; NO check o2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1008
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1009 ; YES Write TX 15/55
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1010 call gassetup_write_Tx ; Write TX
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1011 movf divemins+0,W
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1012 addlw 0x06
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1013 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1014 call read_eeprom ; O2 value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1015 movff EEDATA,lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1016 output_8 ; Write O2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1017 movlw '/'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1018 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1019 movf divemins+0,W
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1020 addlw 0x07
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1021 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1022 call read_eeprom ; He value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1023 movff EEDATA,lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1024 output_8 ; Write He
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1025 bra gassetup_title_bar7
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1026
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1027 ; New v1.44se
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1028 gassetup_title_bar3: ; O2 Check
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1029 movf divemins+0,W
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1030 addlw 0x06
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1031 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1032 call read_eeprom ; O2 value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1033 movff EEDATA,lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1034 movf lo,f ; Move lo -> f
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1035 movlw d'21' ; Move 21 -> WREG
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1036 cpfseq lo ; o2 = 21
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1037 cpfsgt lo ; o2 > 21%
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1038 bra gassetup_title_bar5 ; NO AIR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1039 movlw d'100' ; Move 100 -> WREG
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1040 cpfslt lo ; o2 < 100%
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1041 bra gassetup_title_bar4 ; NO write O2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1042
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1043 ; YES Write NX 32
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1044 call gassetup_write_Nx
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1045 output_8
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1046 bra gassetup_title_bar7
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1047
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1048 ; New v1.44se
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1049 gassetup_title_bar4:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1050 movlw 'O'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1051 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1052 movlw '2'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1053 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1054 movlw ' '
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1055 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1056 output_8
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1057 bra gassetup_title_bar7
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1058
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1059 ; New v1.44se
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1060 gassetup_title_bar5:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1061 cpfseq lo ; o2 = 21%
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1062 bra gassetup_title_bar6
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1063
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1064 movlw 'A'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1065 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1066 movlw 'I'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1067 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1068 movlw 'R'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1069 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1070 movlw ' '
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1071 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1072 output_8
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1073 bra gassetup_title_bar7
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1074
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1075 ; New v1.44se
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1076 gassetup_title_bar6: ; ERROR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1077 movlw 'E'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1078 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1079 movlw 'R'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1080 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1081 movlw 'R'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1082 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1083 movlw ' '
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1084 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1085 output_8
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1086 bra gassetup_title_bar7
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1087
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1088 gassetup_title_bar7:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1089 movlw ' '
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1090 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1091 movlw 'i'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1092 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1093 movlw 'n'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1094 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1095 movlw ' '
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1096 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1097 movf decodata+0,W ; read current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1098 addlw d'28' ; offset in memory
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1099 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1100 call read_eeprom ; Low-value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1101 movff EEDATA,lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1102 output_8
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1103 movlw 'm'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1104 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1105 movlw ' '
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1106 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1107
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1108 call word_processor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1109 WIN_INVERT .0 ; Init new Wordprocessor
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1110 return
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1111
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1112 ; New v1.44se
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1113 gassetup_write_Nx:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1114 movlw 'N'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1115 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1116 movlw 'X'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1117 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1118 movlw ' '
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1119 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1120 return
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1121
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1122 ; New v1.44se
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1123 gassetup_write_Tx:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1124 movlw 'T'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1125 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1126 movlw 'X'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1127 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1128 movlw ' '
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1129 movwf POSTINC2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1130 return
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1131
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1132 gassetup_show_ppO2:
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1133 movf divemins+0,W
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1134 addlw 0x06
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1135 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1136 call read_eeprom ; O2 value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1137 movff EEDATA,hi
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1138
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1139 movf decodata+0,W ; read current value
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1140 addlw d'28' ; offset in memory
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1141 movwf EEADR
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1142 call read_eeprom ; Change depth in m
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1143 movff EEDATA,lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1144 movlw d'10'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1145 addwf lo,F ; Depth+10m=lo
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1146 movf hi,W
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1147 mulwf lo ; (Depth+10m)*O2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1148 movff PRODL,xA+0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1149 movff PRODH,xA+1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1150 movlw d'10'
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1151 movwf xB+0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1152 clrf xB+1
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1153 call div16x16 ;xA/xB=xC with xA as remainder
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1154 movff xC+0,lo ; ((Depth+10m)*O2)/10 = [0.01Bar] ppO2
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1155 movff xC+1,hi
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1156
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1157 WIN_LEFT .55
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1158 WIN_TOP .35
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1159 lfsr FSR2,letter
50
heinrichsweikamp
parents: 49
diff changeset
1160 OUTPUTTEXT d'149' ; (ppO2:
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1161 output_16dp d'3'
50
heinrichsweikamp
parents: 49
diff changeset
1162 OUTPUTTEXT d'150' ; Bar:
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1163 call word_processor
35
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1164 return
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1165
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1166
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1167 gassetup_sort_gaslist: ; Sorts Gaslist according to change depth
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1168 ; EEPROM Locations of Gaslist
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1169 ; Gas1:
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1170 ; O2 Default:4
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1171 ; He Default:5
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1172 ; O2 Current:6
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1173 ; He Current:7
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1174 ; Change: 28
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1175 ; Active: 27,0
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1176
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1177 ; Gas2:
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1178 ; O2 Default:8
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1179 ; He Default:9
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1180 ; O2 Current:10
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1181 ; He Current:11
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1182 ; Change: 29
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1183 ; Active: 27,1
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1184
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1185 ; Gas3:
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1186 ; O2 Default:12
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1187 ; He Default:13
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1188 ; O2 Current:14
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1189 ; He Current:15
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1190 ; Change: 30
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1191 ; Active: 27,2
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1192
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1193 ; Gas4:
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1194 ; O2 Default:16
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1195 ; He Default:17
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1196 ; O2 Current:18
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1197 ; He Current:19
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1198 ; Change: 31
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1199 ; Active: 27,3
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1200
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1201 ; Gas5:
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1202 ; O2 Default:20
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1203 ; He Default:21
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1204 ; O2 Current:22
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1205 ; He Current:23
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1206 ; Change: 32
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1207 ; Active: 27,4
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1208
47
56aea9fcdd8f 1.65beta release
heinrichsweikamp
parents: 45
diff changeset
1209 ; reset Change depths (Important for all users who upgrade from <1.60!)
56aea9fcdd8f 1.65beta release
heinrichsweikamp
parents: 45
diff changeset
1210 clrf EEADRH
56aea9fcdd8f 1.65beta release
heinrichsweikamp
parents: 45
diff changeset
1211 clrf EEDATA
56aea9fcdd8f 1.65beta release
heinrichsweikamp
parents: 45
diff changeset
1212 write_int_eeprom d'118' ;
56aea9fcdd8f 1.65beta release
heinrichsweikamp
parents: 45
diff changeset
1213 write_int_eeprom d'119' ;
56aea9fcdd8f 1.65beta release
heinrichsweikamp
parents: 45
diff changeset
1214 write_int_eeprom d'120' ;
56aea9fcdd8f 1.65beta release
heinrichsweikamp
parents: 45
diff changeset
1215 write_int_eeprom d'121' ;
56aea9fcdd8f 1.65beta release
heinrichsweikamp
parents: 45
diff changeset
1216 write_int_eeprom d'122' ;
56aea9fcdd8f 1.65beta release
heinrichsweikamp
parents: 45
diff changeset
1217 movlw d'21' ; O2 Current
56aea9fcdd8f 1.65beta release
heinrichsweikamp
parents: 45
diff changeset
1218 movwf EEDATA
56aea9fcdd8f 1.65beta release
heinrichsweikamp
parents: 45
diff changeset
1219 write_int_eeprom d'96' ;
56aea9fcdd8f 1.65beta release
heinrichsweikamp
parents: 45
diff changeset
1220 write_int_eeprom d'100' ;
56aea9fcdd8f 1.65beta release
heinrichsweikamp
parents: 45
diff changeset
1221 write_int_eeprom d'104' ;
56aea9fcdd8f 1.65beta release
heinrichsweikamp
parents: 45
diff changeset
1222 write_int_eeprom d'108' ;
56aea9fcdd8f 1.65beta release
heinrichsweikamp
parents: 45
diff changeset
1223 write_int_eeprom d'112' ;
56aea9fcdd8f 1.65beta release
heinrichsweikamp
parents: 45
diff changeset
1224
56aea9fcdd8f 1.65beta release
heinrichsweikamp
parents: 45
diff changeset
1225 clrf EEDATA ; He Current
56aea9fcdd8f 1.65beta release
heinrichsweikamp
parents: 45
diff changeset
1226 write_int_eeprom d'97' ;
56aea9fcdd8f 1.65beta release
heinrichsweikamp
parents: 45
diff changeset
1227 write_int_eeprom d'101' ;
56aea9fcdd8f 1.65beta release
heinrichsweikamp
parents: 45
diff changeset
1228 write_int_eeprom d'105' ;
56aea9fcdd8f 1.65beta release
heinrichsweikamp
parents: 45
diff changeset
1229 write_int_eeprom d'109' ;
56aea9fcdd8f 1.65beta release
heinrichsweikamp
parents: 45
diff changeset
1230 write_int_eeprom d'113' ;
56aea9fcdd8f 1.65beta release
heinrichsweikamp
parents: 45
diff changeset
1231
36
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1232 ; Find deepest Gas
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1233 ; Copy all to RAM
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1234 movlw d'3'
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1235 movwf EEADR
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1236 clrf EEADRH
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1237 lfsr FSR2,letter ; Store gases in Letter buffer (max. 26Byte!)
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1238 gassetup_sort_gaslist1:
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1239 incf EEADR,F ; Next Adress
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1240 call read_eeprom ; Read byte
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1241 movff EEDATA,POSTINC2 ; Copy into RAM
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1242 movlw d'23'
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1243 cpfseq EEADR ; All done?
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1244 bra gassetup_sort_gaslist1 ; No, not yet
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1245 ; Letter+0 = EEPROM 4
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1246 ; ...
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1247 ; Letter+20 = EEPROM 23
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1248 read_int_eeprom d'28'
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1249 movff EEDATA,POSTINC2 ; Change Depth Gas1 -> Letter+21
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1250 read_int_eeprom d'29'
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1251 movff EEDATA,POSTINC2 ; Change Depth Gas2 -> Letter+22
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1252 read_int_eeprom d'30'
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1253 movff EEDATA,POSTINC2 ; Change Depth Gas3 -> Letter+23
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1254 read_int_eeprom d'31'
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1255 movff EEDATA,POSTINC2 ; Change Depth Gas4 -> Letter+24
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1256 read_int_eeprom d'32'
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1257 movff EEDATA,POSTINC2 ; Change Depth Gas5 -> Letter+25
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1258 read_int_eeprom d'27'
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1259 movff EEDATA,POSTINC2 ; Active Byte -> Letter+26
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1260
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1261 ; All change depths = 0? -> Skip sort!
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1262 lfsr FSR2,letter+.20 ; Change depths...
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1263 movlw d'5'
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1264 movwf logbook_temp3 ; Gas (0-4)
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1265 clrf logbook_temp1 ; counter
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1266 gassetup_sort_gaslist1a:
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1267 movf POSTINC2,W
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1268 addwf logbook_temp1,F ; sum
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1269 decfsz logbook_temp3,F ; Loop
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1270 bra gassetup_sort_gaslist1a
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1271
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1272 tstfsz logbook_temp1 ; All depths = 0?
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1273 bra gassetup_sort_gaslist1b ; No
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1274 return ; Yes, skip all!
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1275
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1276 gassetup_sort_gaslist1b:
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1277 ; Initialize sorting...
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1278 bcf menubit2 ; Change Start gas only 1x
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1279 movlw d'99'
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1280 movwf logbook_temp4 ; Last Gas change depth
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1281
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1282 rcall gassetup_sort_sort ; Sort!
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1283 ; Done. Copy Gas #logbook_temp3 into EEPROM Place Gas 5
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1284 movlw d'5' ; Gas 5
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1285 movwf logbook_temp5
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1286 rcall gassetup_sort_store
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1287 movff logbook_temp1,EEDATA ; Change depth -> EEDATA
45
985607cfb813 1.65beta
heinrichsweikamp
parents: 44
diff changeset
1288 write_int_eeprom d'122' ; Write Change Depth Gas 5
36
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1289
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1290 rcall gassetup_sort_sort ; Sort!
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1291 ; Done. Copy Gas #logbook_temp3 into EEPROM Place Gas 4
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1292 movlw d'4' ; Gas 4
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1293 movwf logbook_temp5
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1294 rcall gassetup_sort_store
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1295 movff logbook_temp1,EEDATA ; Change depth -> EEDATA
45
985607cfb813 1.65beta
heinrichsweikamp
parents: 44
diff changeset
1296 write_int_eeprom d'121' ; Write Change Depth Gas 4
36
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1297
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1298 rcall gassetup_sort_sort ; Sort!
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1299 ; Done. Copy Gas #logbook_temp3 into EEPROM Place Gas 3
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1300 movlw d'3' ; Gas 3
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1301 movwf logbook_temp5
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1302 rcall gassetup_sort_store
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1303 movff logbook_temp1,EEDATA ; Change depth -> EEDATA
45
985607cfb813 1.65beta
heinrichsweikamp
parents: 44
diff changeset
1304 write_int_eeprom d'120' ; Write Change Depth Gas 3
36
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1305
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1306 rcall gassetup_sort_sort ; Sort!
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1307 ; Done. Copy Gas #logbook_temp3 into EEPROM Place Gas 2
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1308 movlw d'2' ; Gas 2
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1309 movwf logbook_temp5
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1310 rcall gassetup_sort_store
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1311 movff logbook_temp1,EEDATA ; Change depth -> EEDATA
45
985607cfb813 1.65beta
heinrichsweikamp
parents: 44
diff changeset
1312 write_int_eeprom d'119' ; Write Change Depth Gas 2
36
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1313
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1314 rcall gassetup_sort_sort ; Sort!
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1315 ; Done. Copy Gas #logbook_temp3 into EEPROM Place Gas 1
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1316 movlw d'1' ; Gas 1
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1317 movwf logbook_temp5
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1318 rcall gassetup_sort_store
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1319 movff logbook_temp1,EEDATA ; Change depth -> EEDATA
45
985607cfb813 1.65beta
heinrichsweikamp
parents: 44
diff changeset
1320 write_int_eeprom d'118' ; Write Change Depth Gas 1
36
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1321 return
35
d4f0c097a7fa preparations for new gaslist
heinrichsweikamp
parents: 3
diff changeset
1322
36
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1323 gassetup_sort_sort:
41
3ab1188651af 1.63 in work...
heinrichsweikamp
parents: 36
diff changeset
1324 clrf logbook_temp2 ; Gas (0-4)
3ab1188651af 1.63 in work...
heinrichsweikamp
parents: 36
diff changeset
1325 clrf logbook_temp1 ; Here: Change depth in m
3ab1188651af 1.63 in work...
heinrichsweikamp
parents: 36
diff changeset
1326 clrf logbook_temp3 ; Gas (0-4)
36
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1327
41
3ab1188651af 1.63 in work...
heinrichsweikamp
parents: 36
diff changeset
1328 lfsr FSR2,letter+.20 ; Change depths...
36
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1329 gassetup_sort_gaslist2:
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1330 movf POSTINC2,W ; Get Change depth into WREG
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1331
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1332 cpfsgt logbook_temp4 ; logbook_temp4 < W? Here: Change depth of last sort run
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1333 bra gassetup_sort_gaslist3 ; Skip, tested depth > max. Depth from last run
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1334
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1335 cpfslt logbook_temp1 ; logbook_temp1 < W?
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1336 bra gassetup_sort_gaslist3 ; Skip, tested depth < max. Depth from this run
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1337
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1338 movwf logbook_temp1 ; copy new depth (current run)
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1339 movff logbook_temp2,logbook_temp3 ; Holds deepest Gas 0-4 of this run
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1340 gassetup_sort_gaslist3:
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1341 incf logbook_temp2,F ; Check next Gas
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1342 movlw d'5'
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1343 cpfseq logbook_temp2 ; All done?
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1344 bra gassetup_sort_gaslist2 ; No
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1345 gassetup_sort_gaslist4:
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1346 movff logbook_temp1,logbook_temp4 ; copy new depth (Store for next run)
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1347
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1348 ; Debugger
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1349 ;call enable_rs232
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1350 ; movff logbook_temp1,TXREG
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1351 ; call rs232_wait_tx ; wait for UART
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1352 ; movff logbook_temp2,TXREG
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1353 ; call rs232_wait_tx ; wait for UART
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1354 ; movff logbook_temp3,TXREG
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1355 ; call rs232_wait_tx ; wait for UART
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1356 ; movff logbook_temp4,TXREG
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1357 ; call rs232_wait_tx ; wait for UART
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1358 ; movff logbook_temp5,TXREG
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1359 ; call rs232_wait_tx ; wait for UART
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1360 ; WAITMS d'255'
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1361 return
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1362
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1363 gassetup_sort_store:
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1364 lfsr FSR2,letter ; Point to Gas0
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1365 movf logbook_temp3,W
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1366 mullw d'4'
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1367 movf PRODL,W ; x4
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1368 addwf FSR2L,F
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1369 movlw d'0'
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1370 addwfc FSR2H,F ; Point to Gas #logbook_temp3 (0-4)
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1371
50
heinrichsweikamp
parents: 49
diff changeset
1372 ; btfsc menubit2 ; Change Start gas only 1x
heinrichsweikamp
parents: 49
diff changeset
1373 ; bra gassetup_sort_store2 ; Skip
heinrichsweikamp
parents: 49
diff changeset
1374 ;; First Gas: 33 (1-5)
heinrichsweikamp
parents: 49
diff changeset
1375 ;; Was gas #logbook_temp3 first gas?
heinrichsweikamp
parents: 49
diff changeset
1376 ; read_int_eeprom d'33' ; Get old first gas (1-5)
heinrichsweikamp
parents: 49
diff changeset
1377 ; incf logbook_temp3,W ; Gas 1-5 -> WREG
heinrichsweikamp
parents: 49
diff changeset
1378 ; cpfseq EEDATA ; Compare with EEDATA d'33'
heinrichsweikamp
parents: 49
diff changeset
1379 ; bra gassetup_sort_store2 ; Was not first gas!
heinrichsweikamp
parents: 49
diff changeset
1380 ; movff logbook_temp5,EEDATA ; Copy new first gas
heinrichsweikamp
parents: 49
diff changeset
1381 ; write_int_eeprom d'123' ; Store
heinrichsweikamp
parents: 49
diff changeset
1382 ; bsf menubit2 ; Done. Do not change again.
36
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1383
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1384 gassetup_sort_store2:
45
985607cfb813 1.65beta
heinrichsweikamp
parents: 44
diff changeset
1385 ; Was Gas #logbook_temp3 active?
985607cfb813 1.65beta
heinrichsweikamp
parents: 44
diff changeset
1386 ; Letter+26 holds active bits 25?
985607cfb813 1.65beta
heinrichsweikamp
parents: 44
diff changeset
1387 movff logbook_temp3,logbook_temp6 ; Counter 0-4
985607cfb813 1.65beta
heinrichsweikamp
parents: 44
diff changeset
1388 incf logbook_temp6,F ; Counter 1-5
985607cfb813 1.65beta
heinrichsweikamp
parents: 44
diff changeset
1389 movff letter+.25, logbook_temp2 ; No longer used
985607cfb813 1.65beta
heinrichsweikamp
parents: 44
diff changeset
1390 read_int_eeprom d'27' ; Active flag register
985607cfb813 1.65beta
heinrichsweikamp
parents: 44
diff changeset
1391 gassetup_sort_store3:
985607cfb813 1.65beta
heinrichsweikamp
parents: 44
diff changeset
1392 rrcf logbook_temp2,F ; Shift into Carry
985607cfb813 1.65beta
heinrichsweikamp
parents: 44
diff changeset
1393 decfsz logbook_temp6,F ; 1-5 x
985607cfb813 1.65beta
heinrichsweikamp
parents: 44
diff changeset
1394 bra gassetup_sort_store3 ; Loop
985607cfb813 1.65beta
heinrichsweikamp
parents: 44
diff changeset
1395 ; Carry now holds active bit of gas #logbook_temp3 (0-4)
985607cfb813 1.65beta
heinrichsweikamp
parents: 44
diff changeset
1396
985607cfb813 1.65beta
heinrichsweikamp
parents: 44
diff changeset
1397 btfss STATUS,C ; Was Gas active?
985607cfb813 1.65beta
heinrichsweikamp
parents: 44
diff changeset
1398 clrf logbook_temp1 ; No!, Clear change Depth to make it inactive for sorted list!
985607cfb813 1.65beta
heinrichsweikamp
parents: 44
diff changeset
1399
49
cd5b650920f6 1.70...
heinrichsweikamp
parents: 47
diff changeset
1400 ;call enable_rs232
cd5b650920f6 1.70...
heinrichsweikamp
parents: 47
diff changeset
1401 ;movff logbook_temp1,TXREG
cd5b650920f6 1.70...
heinrichsweikamp
parents: 47
diff changeset
1402 ;call rs232_wait_tx ; wait for UART
cd5b650920f6 1.70...
heinrichsweikamp
parents: 47
diff changeset
1403
cd5b650920f6 1.70...
heinrichsweikamp
parents: 47
diff changeset
1404 movf logbook_temp5,W ; 1-5
36
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1405 mullw d'4'
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1406 movff PRODL,EEADR ; Point to EEPROM of Gas #logbook_temp5
45
985607cfb813 1.65beta
heinrichsweikamp
parents: 44
diff changeset
1407 movlw d'90' ; +90 Offset to new...
985607cfb813 1.65beta
heinrichsweikamp
parents: 44
diff changeset
1408 addwf EEADR,F ; ..sorted list!
985607cfb813 1.65beta
heinrichsweikamp
parents: 44
diff changeset
1409
36
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1410 movff POSTINC2,EEDATA ; O2 Default
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1411 call write_eeprom ; store in internal EEPROM
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1412 incf EEADR,F ; +1
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1413 movff POSTINC2,EEDATA ; He Default
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1414 call write_eeprom ; store in internal EEPROM
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1415 incf EEADR,F ; +1
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1416 movff POSTINC2,EEDATA ; O2 Current
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1417 call write_eeprom ; store in internal EEPROM
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1418 incf EEADR,F ; +1
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1419 movff POSTINC2,EEDATA ; He Current
3c38ba950dfb Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents: 35
diff changeset
1420 call write_eeprom ; store in internal EEPROM
0
96a35aeda5f2 Initial setup
heinrichsweikamp
parents:
diff changeset
1421 return