Mercurial > public > mk2
annotate code_part1/OSTC_code_asm_part1/pled_outputs.asm @ 36:3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
author | heinrichsweikamp |
---|---|
date | Sun, 30 May 2010 11:44:03 +0200 |
parents | 5dbdc08e5460 |
children | 016a2412d164 |
rev | line source |
---|---|
0 | 1 |
2 ; OSTC - diving computer code | |
3 ; Copyright (C) 2008 HeinrichsWeikamp GbR | |
4 | |
5 ; This program is free software: you can redistribute it and/or modify | |
6 ; it under the terms of the GNU General Public License as published by | |
7 ; the Free Software Foundation, either version 3 of the License, or | |
8 ; (at your option) any later version. | |
9 | |
10 ; This program is distributed in the hope that it will be useful, | |
11 ; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 ; GNU General Public License for more details. | |
14 | |
15 ; You should have received a copy of the GNU General Public License | |
16 ; along with this program. If not, see <http://www.gnu.org/licenses/>. | |
17 | |
18 | |
19 ; routines for display outputs | |
20 ; written by: Matthias Heinrichs, info@heinrichsweikamp.com | |
21 ; written: 15/01/05 | |
22 ; last updated: 06/06/08 | |
23 ; known bugs: | |
24 ; ToDo: More comments | |
25 | |
9 | 26 PLED_divemask_color: |
25 | 27 GETCUSTOM8 d'36' ; Divemask output color |
29 | 28 bra PLED_standard_color_0 |
9 | 29 |
25 | 30 PLED_warnings_color: |
31 GETCUSTOM8 d'37' ; Warnings output color | |
29 | 32 bra PLED_standard_color_0 |
33 | |
34 PLED_standard_color: | |
35 GETCUSTOM8 d'35' ; Standard output color | |
36 PLED_standard_color_0: ; Common entry point | |
37 movwf oled1_temp ; copy | |
38 movlw d'0' | |
39 cpfseq oled1_temp | |
40 bra PLED_standard_color_1 | |
41 bra PLED_standard_color2 | |
42 PLED_standard_color_1: | |
43 movlw d'4' | |
44 cpfseq oled1_temp | |
45 bra PLED_standard_color_2 | |
46 bra PLED_standard_color2 | |
47 PLED_standard_color_2: | |
48 movlw d'8' | |
49 cpfseq oled1_temp | |
50 bra PLED_standard_color_3 | |
51 bra PLED_standard_color2 | |
52 PLED_standard_color_3: | |
53 movlw d'192' | |
54 cpfseq oled1_temp | |
55 bra PLED_standard_color_4 | |
56 bra PLED_standard_color2 | |
57 PLED_standard_color_4: | |
58 movlw d'196' | |
59 cpfseq oled1_temp | |
60 bra PLED_standard_color_5 | |
61 bra PLED_standard_color2 | |
62 PLED_standard_color_5: | |
63 movlw d'200' | |
64 cpfseq oled1_temp | |
65 bra PLED_standard_color_6 | |
66 bra PLED_standard_color2 | |
67 PLED_standard_color_6: | |
68 movf oled1_temp,W ; Color should be OK... | |
69 call PLED_set_color | |
70 return | |
71 PLED_standard_color2: | |
72 movlw color_standard1 ; Reset Color | |
25 | 73 call PLED_set_color |
74 return | |
3 | 75 |
27
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
76 PLED_color_code macro color_code_temp |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
77 movlw color_code_temp |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
78 call PLED_color_code1 |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
79 endm |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
80 |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
81 PLED_color_code1: ; Color-codes the output, if required |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
82 movwf debug_temp |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
83 dcfsnz debug_temp,F |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
84 bra PLED_color_code_depth ; CF43 [mBar], 16Bit |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
85 dcfsnz debug_temp,F |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
86 bra PLED_color_code_cns ; CF44 [%] |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
87 dcfsnz debug_temp,F |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
88 bra PLED_color_code_gf ; CF45 [%] |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
89 dcfsnz debug_temp,F |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
90 bra PLED_color_code_ppo2 ; CF46 [cBar] |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
91 dcfsnz debug_temp,F |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
92 bra PLED_color_code_velocity ; CF47 [m/min] |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
93 |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
94 PLED_color_code_depth: |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
95 movff hi,hi_temp |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
96 movff lo,lo_temp |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
97 movff rel_pressure+1,hi |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
98 movff rel_pressure+0,lo |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
99 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mBar] |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
100 movff lo,sub_a+0 |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
101 movff hi,sub_a+1 |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
102 GETCUSTOM15 d'43' ; Depth warn [mBar] |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
103 movff lo,sub_b+0 |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
104 movff hi,sub_b+1 |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
105 call sub16 ; sub_c = sub_a - sub_b |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
106 btfss neg_flag |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
107 bra PLED_color_code_depth2; Set to warning color |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
108 call PLED_standard_color |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
109 movff hi_temp,hi |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
110 movff lo_temp,lo ; Restore hi, lo |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
111 return |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
112 PLED_color_code_depth2: |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
113 call PLED_warnings_color |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
114 movff hi_temp,hi |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
115 movff lo_temp,lo ; Restore hi, lo |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
116 return |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
117 |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
118 PLED_color_code_cns: |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
119 movff char_O_CNS_fraction,lo |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
120 GETCUSTOM8 d'44' ; CNS Warn [%] |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
121 subwf lo,W |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
122 btfsc STATUS,C |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
123 bra PLED_color_code_cns2 ; Set to warning color |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
124 call PLED_standard_color |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
125 return |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
126 PLED_color_code_cns2: |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
127 call PLED_warnings_color |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
128 return |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
129 |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
130 PLED_color_code_gf: |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
131 movff char_O_gradient_factor,lo ; gradient factor |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
132 GETCUSTOM8 d'45' ; GF Warn [%] |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
133 subwf lo,W |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
134 btfsc STATUS,C |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
135 bra PLED_color_code_gf2 ; Set to warning color |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
136 call PLED_standard_color |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
137 return |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
138 PLED_color_code_gf2: |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
139 call PLED_warnings_color |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
140 return |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
141 |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
142 PLED_color_code_ppo2: |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
143 movff xC+0,sub_a+0 |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
144 movff xC+1,sub_a+1 |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
145 GETCUSTOM8 d'46' ; ppO2 warn [cBar] |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
146 mullw d'100' |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
147 movff PRODL,sub_b+0 |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
148 movff PRODH,sub_b+1 |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
149 call sub16 ; sub_c = sub_a - sub_b |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
150 btfss neg_flag |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
151 bra PLED_color_code_ppo22; Set to warning color |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
152 call PLED_standard_color |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
153 return |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
154 PLED_color_code_ppo22: |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
155 call PLED_warnings_color |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
156 return |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
157 |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
158 PLED_color_code_velocity: |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
159 movff divA+0,lo |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
160 GETCUSTOM8 d'47' ; Velocity warn [m/min] |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
161 subwf lo,W |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
162 btfsc STATUS,C |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
163 bra PLED_color_code_velocity2 ; Set to warning color |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
164 call PLED_standard_color |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
165 return |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
166 PLED_color_code_velocity2: |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
167 call PLED_warnings_color |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
168 return |
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
169 |
0 | 170 ostc_debug macro debug_temp |
171 movlw debug_temp | |
172 call ostc_debug1 | |
173 endm | |
174 | |
175 ostc_debug1: | |
176 movwf debug_temp | |
177 | |
178 movff debug_char+4,debug_char+5 ; Save for background debugger | |
179 movff debug_char+3,debug_char+4 | |
180 movff debug_char+2,debug_char+3 | |
181 movff debug_char+1,debug_char+2 | |
182 movff debug_char+0,debug_char+1 | |
183 movff debug_temp,debug_char+0 | |
184 | |
185 btfss debug_mode ; Are we in debugmode? | |
186 return ; No, return! | |
187 | |
188 WIN_TOP .200 | |
189 WIN_LEFT .100 | |
190 WIN_FONT FT_SMALL | |
191 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 192 call PLED_standard_color |
0 | 193 lfsr FSR2,letter |
194 movf debug_char+0,W | |
195 movwf POSTINC2 | |
196 movf debug_char+1,W | |
197 movwf POSTINC2 | |
198 movf debug_char+2,W | |
199 movwf POSTINC2 | |
200 movf debug_char+3,W | |
201 movwf POSTINC2 | |
202 movf debug_char+4,W | |
203 movwf POSTINC2 | |
204 movf debug_char+5,W | |
205 movwf POSTINC2 | |
206 movlw ' ' | |
207 movwf POSTINC2 | |
208 call word_processor | |
209 return | |
210 | |
211 | |
212 PLED_resetdebugger: | |
21 | 213 bsf LED_red |
214 bcf LED_blue | |
0 | 215 call PLED_boot ; PLED boot |
216 call PLED_ClearScreen ; clean up OLED | |
217 | |
3 | 218 call PLED_standard_color |
0 | 219 |
220 DISPLAYTEXT .133 | |
221 DISPLAYTEXT .134 | |
222 DISPLAYTEXT .135 | |
223 DISPLAYTEXT .136 ; Display Debug intro | |
224 | |
225 WIN_TOP .100 | |
226 WIN_LEFT .10 | |
227 WIN_FONT FT_SMALL | |
228 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 229 call PLED_standard_color |
0 | 230 lfsr FSR2,letter |
231 movf debug_char+0,W | |
232 movwf POSTINC2 | |
233 movf debug_char+1,W | |
234 movwf POSTINC2 | |
235 movf debug_char+2,W | |
236 movwf POSTINC2 | |
237 movf debug_char+3,W | |
238 movwf POSTINC2 | |
239 movf debug_char+4,W | |
240 movwf POSTINC2 | |
241 movf debug_char+5,W | |
242 movwf POSTINC2 | |
243 movlw '.' | |
244 movwf POSTINC2 | |
245 movlw ' ' | |
246 movwf POSTINC2 | |
247 movff flag1,lo | |
248 output_8 | |
249 movlw ' ' | |
250 movwf POSTINC2 | |
251 movff flag2,lo | |
252 output_8 | |
253 call word_processor | |
254 | |
255 WIN_TOP .125 | |
256 WIN_LEFT .10 | |
257 WIN_FONT FT_SMALL | |
258 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 259 call PLED_standard_color |
0 | 260 |
261 lfsr FSR2,letter | |
262 movff flag3,lo | |
263 output_8 | |
264 movlw ' ' | |
265 movwf POSTINC2 | |
266 movff flag4,lo | |
267 output_8 | |
268 movlw ' ' | |
269 movwf POSTINC2 | |
270 movff flag5,lo | |
271 output_8 | |
272 movlw ' ' | |
273 movwf POSTINC2 | |
274 movff flag6,lo | |
275 output_8 | |
276 movlw ' ' | |
277 movwf POSTINC2 | |
278 movff flag7,lo | |
279 output_8 | |
280 call word_processor | |
281 | |
282 WIN_TOP .150 | |
283 WIN_LEFT .10 | |
284 WIN_FONT FT_SMALL | |
285 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 286 call PLED_standard_color |
0 | 287 |
288 lfsr FSR2,letter | |
289 movff flag8,lo | |
290 output_8 | |
291 movlw ' ' | |
292 movwf POSTINC2 | |
293 movff flag9,lo | |
294 output_8 | |
295 movlw ' ' | |
296 movwf POSTINC2 | |
297 movff flag10,lo | |
298 output_8 | |
299 movlw ' ' | |
300 movwf POSTINC2 | |
301 movff flag11,lo | |
302 output_8 | |
303 movlw ' ' | |
304 movwf POSTINC2 | |
305 movff flag12,lo | |
306 output_8 | |
307 call word_processor | |
308 | |
309 PLED_resetdebugger_loop: | |
310 btfss switch_left | |
311 bra PLED_resetdebugger_loop ; Loop | |
21 | 312 bcf LED_red |
0 | 313 return |
314 | |
315 PLED_divemode_mask: ; Displays mask in Dive-Mode | |
9 | 316 call PLED_divemask_color ; Set Color for Divemode mask |
0 | 317 DISPLAYTEXTH .267 ; Max Depth |
318 DISPLAYTEXT .86 ; Divetime | |
319 DISPLAYTEXT .87 ; Depth | |
3 | 320 call PLED_standard_color |
0 | 321 return |
322 | |
323 PLED_clear_decoarea: | |
324 movlw .0 | |
325 movff WREG,box_temp+0 ; Data | |
326 movlw .60 | |
327 movff WREG,box_temp+1 ; row top (0-239) | |
328 movlw .239 | |
329 movff WREG,box_temp+2 ; row bottom (0-239) | |
330 movlw .090 | |
331 movff WREG,box_temp+3 ; column left (0-159) | |
332 movlw .159 | |
333 movff WREG,box_temp+4 ; column right (0-159) | |
334 call PLED_box | |
335 call PLED_temp_divemode ; redraw temperature | |
336 call PLED_active_gas_divemode ; redraw active Gas | |
337 return | |
338 | |
339 PLED_display_ndl_mask: | |
340 ; Clear Dekostop and Dekosum | |
341 rcall PLED_clear_decoarea | |
342 | |
9 | 343 call PLED_divemask_color ; Set Color for Divemode mask |
0 | 344 DISPLAYTEXT d'84' ; NoStop |
3 | 345 call PLED_standard_color |
0 | 346 |
347 PLED_display_ndl_mask2: | |
348 ; Clears Gradient Factor | |
349 movlw d'8' | |
350 movwf temp1 | |
351 WIN_TOP .145 | |
352 WIN_LEFT .0 | |
353 call PLED_display_clear_common_y1 | |
354 return | |
355 | |
356 PLED_display_ndl: | |
357 btfsc multi_gf_display ; Is the Multi-GF Table displayed? | |
358 return ; Yes, No update and return! | |
359 | |
360 ostc_debug 'z' ; Sends debug-information to screen if debugmode active | |
361 | |
362 WIN_TOP .185 | |
363 WIN_LEFT .119 | |
364 WIN_FONT FT_MEDIUM | |
365 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 366 call PLED_standard_color |
367 | |
0 | 368 lfsr FSR2,letter |
369 movff char_O_nullzeit,lo ; NDL in minutes | |
370 output_8 | |
371 movlw 0x27 ; "'" | |
372 movwf POSTINC2 | |
373 call word_processor | |
374 WIN_FONT FT_SMALL | |
375 return | |
376 | |
377 PLED_display_deko_mask: | |
378 rcall PLED_clear_decoarea | |
379 ; total deco time word | |
9 | 380 call PLED_divemask_color ; Set Color for Divemode mask |
0 | 381 DISPLAYTEXT d'85' ; DECOSUM |
3 | 382 call PLED_standard_color |
0 | 383 return |
384 | |
385 PLED_display_deko: | |
386 btfsc multi_gf_display ; Is the Multi-GF Table displayed? | |
387 return ; Yes, No update and return! | |
388 | |
389 btfsc menubit ; Divemode menu active? | |
390 bra PLED_display_deko1 ; Yes, do not display dekostop | |
391 | |
392 ostc_debug 'y' ; Sends debug-information to screen if debugmode active | |
393 ; deco stop word | |
9 | 394 call PLED_divemask_color ; Set Color for Divemode mask |
0 | 395 DISPLAYTEXT d'82' ; DEKOSTOP |
3 | 396 call PLED_standard_color |
0 | 397 |
398 WIN_TOP .118 | |
399 WIN_LEFT .94 | |
400 WIN_FONT FT_MEDIUM | |
401 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 402 call PLED_standard_color |
0 | 403 lfsr FSR2,letter |
404 movff char_O_array_decodepth+0,lo ; Ceiling in m | |
405 output_99 | |
406 movlw 'm' ; "m" | |
407 movwf POSTINC2 | |
408 movff char_O_array_decotime,lo ; length of first stop in m | |
409 output_99 | |
410 movlw 0x27 ; "'" | |
411 movwf POSTINC2 | |
412 call word_processor | |
413 WIN_FONT FT_SMALL | |
414 | |
415 PLED_display_deko1: | |
416 btfsc multi_gf_display ; Is the Multi-GF Table displayed? | |
417 return ; Yes, No update and return! | |
418 | |
419 ostc_debug 'x' ; Sends debug-information to screen if debugmode active | |
420 | |
421 WIN_TOP .185 | |
422 WIN_LEFT .119 | |
423 WIN_FONT FT_MEDIUM | |
424 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 425 call PLED_standard_color |
0 | 426 lfsr FSR2,letter |
427 movff char_O_ascenttime,lo ; complete ascend time | |
428 movlw d'199' ; limit display of total ascend time to 99mins.... | |
429 cpfslt lo ; skip if 199 (WREG) > lo | |
430 movwf lo | |
431 bcf leftbind | |
432 output_8 | |
433 movlw 0x27 ; "'" | |
434 movwf POSTINC2 | |
435 call word_processor | |
436 | |
437 movff char_O_gradient_factor,lo ; gradient factor | |
438 GETCUSTOM8 d'8' ; threshold for display | |
439 cpfslt lo ; show value? | |
440 bra PLED_display_deko2 ; Yes | |
441 ; No | |
442 bra PLED_display_ndl_mask2 ; Clear gradient factor | |
443 | |
444 PLED_display_deko2: | |
445 ostc_debug 'w' ; Sends debug-information to screen if debugmode active | |
446 ;GF | |
447 WIN_TOP .145 | |
448 WIN_LEFT .0 | |
449 WIN_FONT FT_SMALL | |
27
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
450 PLED_color_code warn_gf ; Color-code Output |
0 | 451 lfsr FSR2,letter |
452 movlw 'G' | |
453 movwf POSTINC2 | |
454 movlw 'F' | |
455 movwf POSTINC2 | |
456 movlw ':' | |
457 movwf POSTINC2 | |
458 movff char_O_gradient_factor,lo ; gradient factor | |
459 output_8 | |
460 movlw '%' | |
461 movwf POSTINC2 | |
462 movlw ' ' | |
463 movwf POSTINC2 | |
464 call word_processor | |
27
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
465 call PLED_standard_color |
0 | 466 return |
467 | |
468 PLED_simulator_data: | |
469 WIN_TOP .65 | |
470 WIN_LEFT .105 | |
471 WIN_FONT FT_SMALL | |
3 | 472 call PLED_standard_color |
0 | 473 lfsr FSR2,letter |
474 movff logbook_temp1,lo | |
475 bsf leftbind | |
476 output_8 | |
477 bcf leftbind | |
478 movlw 'm' | |
479 movwf POSTINC2 | |
480 movlw 'i' | |
481 movwf POSTINC2 | |
482 movlw 'n' | |
483 movwf POSTINC2 | |
484 movlw ' ' | |
485 movwf POSTINC2 | |
486 call word_processor | |
487 | |
488 WIN_TOP .95 | |
489 WIN_LEFT .100 | |
490 WIN_FONT FT_SMALL | |
3 | 491 call PLED_standard_color |
0 | 492 lfsr FSR2,letter |
493 movff logbook_temp2,lo | |
494 bsf leftbind | |
495 output_8 | |
496 bcf leftbind | |
497 movlw 'm' | |
498 movwf POSTINC2 | |
499 movlw ' ' | |
500 movwf POSTINC2 | |
501 call word_processor | |
502 return | |
503 | |
504 PLED_display_velocity: | |
505 btfsc multi_gf_display ; Is the Multi-GF Table displayed? | |
506 return ; Yes, No update and return! | |
507 | |
508 ostc_debug 'v' ; Sends debug-information to screen if debugmode active | |
509 WIN_TOP .90 | |
510 WIN_LEFT .0 | |
511 WIN_FONT FT_SMALL | |
27
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
512 PLED_color_code warn_velocity ; Color code output |
0 | 513 lfsr FSR2,letter |
514 movlw '-' | |
515 btfsc neg_flag | |
516 movlw '+' | |
517 movwf POSTINC2 | |
518 movff divA+0,lo | |
519 output_99 | |
520 OUTPUTTEXT d'83' ; m/min | |
521 call word_processor | |
27
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
522 call PLED_standard_color |
0 | 523 bsf pled_velocity_display |
524 return | |
525 | |
526 PLED_display_velocity_clear: | |
527 movlw d'8' | |
528 movwf temp1 | |
529 WIN_TOP .90 | |
530 WIN_LEFT .0 | |
531 bcf pled_velocity_display | |
532 bra PLED_display_clear_common_y1 | |
533 | |
534 PLED_display_wait_clear | |
535 movlw d'6' | |
536 movwf temp1 | |
537 WIN_TOP .2 | |
538 WIN_LEFT .115 | |
539 bra PLED_display_clear_common_y1 | |
540 | |
541 PLED_display_clear_common_y2: ; Clears with y-scale=2 | |
542 WIN_FONT FT_MEDIUM | |
543 bra PLED_display_clear_common1 | |
544 | |
545 PLED_display_clear_common_y1: ; Clears with y-scale=1 | |
546 WIN_FONT FT_SMALL | |
547 PLED_display_clear_common1: | |
548 lfsr FSR2,letter | |
549 PLED_display_clear_common2: | |
550 movlw ' ' | |
551 movwf POSTINC2 | |
552 decfsz temp1,F | |
553 bra PLED_display_clear_common2 | |
554 call word_processor | |
555 WIN_FONT FT_SMALL | |
556 return | |
557 | |
558 PLED_clock: | |
559 ostc_debug 'c' | |
560 | |
561 ;If > 0 display surface_interval:2 and clock changing every 5 seconds | |
562 ;use timeout_counter for this | |
563 WIN_TOP .50 | |
564 WIN_LEFT .0 | |
565 WIN_FONT FT_SMALL | |
566 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 567 call PLED_standard_color |
568 | |
0 | 569 lfsr FSR2,letter |
570 | |
571 movff surface_interval+0,lo | |
572 tstfsz lo | |
573 bra PLED_clock0 ; Not Zero, switch between Interval and clock | |
574 movff surface_interval+1,lo | |
575 tstfsz lo | |
576 bra PLED_clock0 ; Not Zero, switch between Interval and clock | |
577 bra PLED_clock3 ; surface_interval=0, always display clock! | |
578 | |
579 PLED_clock0: | |
580 btfss show_interval ; Show Interval? | |
581 bra PLED_clock2 ; No, display clock and reset counter | |
582 | |
583 PLED_clock1: | |
584 decfsz timeout_counter,F ; =0? | |
585 bra PLED_clock1a ; No... | |
586 bra PLED_clock3 ; Yes, display clock and reset counter | |
587 | |
588 PLED_clock1a: | |
589 bsf show_interval | |
590 movlw d'6' | |
591 cpfslt timeout_counter ; f < w? -> timeout_counter>5? | |
592 rcall PLED_clock_reload_timer ; No, reload counter | |
593 | |
594 movff surface_interval+0,lo | |
595 movff surface_interval+1,hi | |
596 call convert_time ; lo=mins, hi=hours | |
597 | |
598 movf hi,W | |
599 movff lo,hi | |
600 movwf lo ; exchange lo and hi | |
601 | |
602 movlw 'I' | |
603 movwf POSTINC2 | |
604 movlw 'n' | |
605 movwf POSTINC2 | |
606 movlw 't' | |
607 movwf POSTINC2 | |
608 movlw ':' | |
609 movwf POSTINC2 | |
610 output_99x | |
611 movlw ':' | |
612 movwf POSTINC2 | |
613 movff hi,lo | |
614 output_99x | |
615 movlw ' ' | |
616 movwf POSTINC2 | |
617 call word_processor | |
618 return | |
619 | |
620 PLED_clock_reload_timer: | |
621 bcf show_interval | |
622 movlw d'5' | |
623 movwf timeout_counter | |
624 return | |
625 | |
626 PLED_interval_reload_timer: | |
627 bsf show_interval | |
628 movlw d'5' | |
629 movwf timeout_counter | |
630 return | |
631 | |
632 PLED_clock2: | |
633 decfsz timeout_counter,F ; =0? | |
634 bra PLED_clock3 ; No... | |
635 bra PLED_clock1a ; Yes, display interval and reset counter | |
636 | |
637 PLED_clock3: | |
638 bcf show_interval | |
639 movlw d'6' | |
640 cpfslt timeout_counter ; f < w? -> timeout_counter>5? | |
641 rcall PLED_interval_reload_timer; No, reload counter | |
642 | |
643 movff hours,lo | |
644 output_99x | |
645 movlw ':' | |
646 movwf POSTINC2 | |
647 movff mins,lo | |
648 output_99x | |
649 movlw ':' | |
650 movwf POSTINC2 | |
651 movff secs,lo | |
652 output_99x | |
653 movlw ' ' | |
654 movwf POSTINC2 | |
655 call word_processor | |
656 return | |
657 | |
658 PLED_logbook_cursor: | |
659 | |
660 PLED_menu_cursor: | |
661 WIN_TOP .35 | |
662 WIN_LEFT .0 | |
663 WIN_FONT FT_SMALL | |
664 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 665 call PLED_standard_color |
666 | |
0 | 667 lfsr FSR2,letter |
668 movlw 0xB8 | |
669 movwf POSTINC2 | |
670 call word_processor | |
671 | |
672 WIN_TOP .65 | |
673 WIN_LEFT .0 | |
674 WIN_FONT FT_SMALL | |
675 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 676 |
0 | 677 lfsr FSR2,letter |
678 movlw 0xB8 | |
679 movwf POSTINC2 | |
680 call word_processor | |
681 | |
682 WIN_TOP .95 | |
683 WIN_LEFT .0 | |
684 WIN_FONT FT_SMALL | |
685 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 686 |
0 | 687 lfsr FSR2,letter |
688 movlw 0xB8 | |
689 movwf POSTINC2 | |
690 call word_processor | |
691 | |
692 WIN_TOP .125 | |
693 WIN_LEFT .0 | |
694 WIN_FONT FT_SMALL | |
695 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 696 |
0 | 697 lfsr FSR2,letter |
698 movlw 0xB8 | |
699 movwf POSTINC2 | |
700 call word_processor | |
701 | |
702 WIN_TOP .155 | |
703 WIN_LEFT .0 | |
704 WIN_FONT FT_SMALL | |
705 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 706 call PLED_standard_color |
707 | |
0 | 708 lfsr FSR2,letter |
709 movlw 0xB8 | |
710 movwf POSTINC2 | |
711 call word_processor | |
712 | |
713 WIN_TOP .185 | |
714 WIN_LEFT .0 | |
715 WIN_FONT FT_SMALL | |
716 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 717 |
0 | 718 lfsr FSR2,letter |
719 movlw 0xB8 | |
720 movwf POSTINC2 | |
721 call word_processor | |
722 | |
723 movff menupos,temp1 | |
724 dcfsnz temp1,F | |
725 movlw d'35' | |
726 dcfsnz temp1,F | |
727 movlw d'65' | |
728 dcfsnz temp1,F | |
729 movlw d'95' | |
730 dcfsnz temp1,F | |
731 movlw d'125' | |
732 dcfsnz temp1,F | |
733 movlw d'155' | |
734 dcfsnz temp1,F | |
735 movlw d'185' | |
736 | |
737 movff WREG,win_top | |
738 WIN_LEFT .0 | |
739 WIN_FONT FT_SMALL | |
740 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 741 |
0 | 742 lfsr FSR2,letter |
743 movlw 0xB7 | |
744 movwf POSTINC2 | |
745 call word_processor | |
746 return | |
747 | |
748 PLED_menu_mask: | |
749 call PLED_topline_box | |
750 WIN_INVERT .1 ; Init new Wordprocessor | |
751 DISPLAYTEXT .5 ; Menu: | |
752 WIN_INVERT .0 ; Init new Wordprocessor | |
753 DISPLAYTEXT .6 ; Logbook | |
754 DISPLAYTEXT .7 ; Gas Setup | |
755 DISPLAYTEXT .9 ; Reset all | |
756 DISPLAYTEXT .10 ; Setup... | |
757 DISPLAYTEXT .142 ; More... | |
758 DISPLAYTEXT .11 ; Exit | |
759 return | |
760 | |
761 PLED_setup_menu_mask: | |
762 call PLED_topline_box | |
763 WIN_INVERT .1 ; Init new Wordprocessor | |
764 DISPLAYTEXT .98 ; Setup Menu: | |
765 WIN_INVERT .0 ; Init new Wordprocessor | |
766 DISPLAYTEXT .99 ; Custom FunctionsI | |
767 DISPLAYTEXT .153 ; Custom FunctionsII | |
768 DISPLAYTEXTH .276 ; Salinity: | |
769 DISPLAYTEXT .100 ; Decotype: | |
770 DISPLAYTEXT .142 ; More... | |
771 DISPLAYTEXT .11 ; Exit | |
772 return | |
773 | |
774 PLED_more_setup_menu_mask: | |
775 call PLED_topline_box | |
776 WIN_INVERT .1 ; Init new Wordprocessor | |
777 DISPLAYTEXTH .258 ; Setup Menu 2: | |
778 WIN_INVERT .0 ; Init new Wordprocessor | |
779 DISPLAYTEXTH .257 ; Date format: | |
780 DISPLAYTEXT .129 ; Debug: | |
12 | 781 DISPLAYTEXT .187 ; Show License |
0 | 782 |
783 DISPLAYTEXT .11 ; Exit | |
784 return | |
785 | |
786 PLED_more_menu_mask: | |
787 call PLED_topline_box | |
788 WIN_INVERT .1 ; Init new Wordprocessor | |
789 DISPLAYTEXT .144 ; Menu 2: | |
790 WIN_INVERT .0 ; Init new Wordprocessor | |
791 DISPLAYTEXT .8 ; Set Time | |
792 DISPLAYTEXT .110 ; Const. ppO2 Setup | |
793 DISPLAYTEXT .113 ; Battery Info | |
794 DISPLAYTEXT .247 ; Simulator | |
795 | |
796 DISPLAYTEXT .11 ; Exit | |
797 return | |
798 | |
799 PLED_reset_menu_mask: | |
800 call PLED_topline_box | |
801 WIN_INVERT .1 ; Init new Wordprocessor | |
802 DISPLAYTEXT .28 ; Reset Menu | |
803 WIN_INVERT .0 ; Init new Wordprocessor | |
804 DISPLAYTEXT .21 ; Cancel Reset | |
805 DISPLAYTEXT .245 ; Reset CF,Gases & Deco | |
806 DISPLAYTEXTH .284 ; Reset Logbook | |
807 DISPLAYTEXTH .285 ; Reboot OSTC | |
808 DISPLAYTEXTH .286 ; Reset Decodata | |
809 DISPLAYTEXT .11 ; Exit | |
810 return | |
811 | |
812 PLED_simulator_mask: | |
813 call PLED_topline_box | |
814 WIN_INVERT .1 ; Init new Wordprocessor | |
815 DISPLAYTEXT .248 ; OSTC Simulator | |
816 WIN_INVERT .0 ; Init new Wordprocessor | |
817 DISPLAYTEXT .249 ; Start Dive | |
818 DISPLAYTEXTH .277 ; Bottom Time: | |
819 DISPLAYTEXTH .278 ; Max. Depth: | |
820 DISPLAYTEXTH .279 ; Calculate Deco | |
821 DISPLAYTEXTH .280 ; Show Decoplan | |
822 DISPLAYTEXT .11 ; Exit | |
823 return | |
824 | |
825 | |
826 | |
827 | |
828 PLED_temp_surfmode: | |
829 ostc_debug 'e' | |
830 movff temperature+0,last_temperature+0 | |
831 movff temperature+1,last_temperature+1 | |
832 WIN_TOP .100 | |
833 WIN_LEFT .0 | |
834 WIN_FONT FT_SMALL | |
835 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 836 call PLED_standard_color |
837 | |
0 | 838 lfsr FSR2,letter |
839 movlw '-' | |
840 btfsc neg_temp ; Show "-"? | |
841 movwf POSTINC2 ; Yes | |
842 movff temperature+0,lo | |
843 movff temperature+1,hi | |
844 movlw d'3' | |
845 movwf ignore_digits | |
846 bsf leftbind ; left orientated output | |
847 output_16dp d'2' | |
848 bcf leftbind | |
849 movlw '°' | |
850 movwf POSTINC2 | |
851 movlw 'C' | |
852 movwf POSTINC2 | |
853 movlw ' ' | |
854 movwf POSTINC2 | |
855 call word_processor | |
856 return | |
857 | |
858 PLED_temp_divemode: | |
859 btfsc multi_gf_display ; Is the Multi-GF Table displayed? | |
860 return ; Yes, No update and return! | |
861 | |
862 ostc_debug 'u' ; Sends debug-information to screen if debugmode active | |
863 | |
864 ; temperature | |
865 movff temperature+0,last_temperature+0 | |
866 movff temperature+1,last_temperature+1 | |
867 | |
868 WIN_TOP .216 | |
869 WIN_LEFT .65 | |
870 WIN_FONT FT_SMALL | |
871 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 872 call PLED_standard_color |
873 | |
0 | 874 lfsr FSR2,letter |
875 movlw '-' | |
876 btfsc neg_temp ; Show "-"? | |
877 movwf POSTINC2 ; Yes | |
878 movff temperature+0,lo | |
879 movff temperature+1,hi | |
880 movlw d'3' | |
881 movwf ignore_digits | |
882 bsf leftbind ; left orientated output | |
883 output_16dp d'2' | |
884 bcf leftbind | |
885 movlw '°' | |
886 movwf POSTINC2 | |
887 movlw ' ' | |
888 movwf POSTINC2 | |
889 call word_processor | |
890 return | |
891 | |
892 PLED_show_ppO2: ; Show ppO2 | |
893 ostc_debug 't' ; Sends debug-information to screen if debugmode active | |
894 WIN_TOP .120 | |
895 WIN_LEFT .0 | |
896 WIN_FONT FT_SMALL | |
27
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
897 PLED_color_code warn_ppo2 ; Color-code output |
3 | 898 |
0 | 899 lfsr FSR2,letter |
900 movlw 'p' | |
901 movwf POSTINC2 | |
902 movlw 'p' | |
903 movwf POSTINC2 | |
904 movlw 'O' | |
905 movwf POSTINC2 | |
906 movlw '2' | |
907 movwf POSTINC2 | |
908 movlw ':' | |
909 movwf POSTINC2 | |
910 movff xC+0,lo | |
911 movff xC+1,hi | |
912 bsf ignore_digit4 | |
913 output_16dp d'1' | |
914 bcf ignore_digit4 | |
915 movlw ' ' | |
916 movwf POSTINC2 | |
917 call word_processor | |
27
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
918 call PLED_standard_color |
0 | 919 return |
920 | |
921 PLED_show_ppO2_clear: ; Clear ppO2 | |
922 movlw d'10' | |
923 movwf temp1 | |
924 WIN_TOP .120 | |
925 WIN_LEFT .0 | |
926 call PLED_display_clear_common_y1 | |
927 return | |
928 | |
929 PLED_active_gas_clear: ; clears active gas! | |
930 WIN_TOP .192 | |
931 WIN_LEFT .65 | |
932 movlw d'5' | |
933 movwf temp1 | |
934 bra PLED_display_clear_common_y1; also returns! | |
935 | |
936 PLED_active_gas_divemode: ; Displays current gas (e.g. 40/20) if a) He>0 or b) O2>Custom9 | |
937 btfsc FLAG_apnoe_mode ; Ignore in Apnoe mode | |
938 return | |
939 | |
940 btfsc multi_gf_display ; Is the Multi-GF Table displayed? | |
941 return ; Yes, No update and return! | |
942 | |
25 | 943 WIN_INVERT .0 ; Init new Wordprocessor |
944 call PLED_active_gas_divemode_show ; Show gas (Non-Inverted in all cases) | |
945 | |
946 btfss better_gas_available ;=1: A better gas is available and a gas change is advised in divemode | |
947 return ; Done. | |
948 | |
949 ; Check if Gas Output should blink when a better gas is available... | |
950 GETCUSTOM8 d'42' ; =1 if gas should blink | |
951 movwf lo | |
952 movlw d'1' | |
953 cpfseq lo ; =1? | |
954 return ; No, Done. | |
955 | |
956 btg blinking_better_gas ; Toggle blink bit... | |
957 btfss blinking_better_gas ; blink now? | |
958 return ; No, Done. | |
959 WIN_INVERT .1 ; Init new Wordprocessor | |
960 call PLED_active_gas_divemode_show ; Show gas (Non-Inverted in all cases) | |
961 WIN_INVERT .0 ; Init new Wordprocessor | |
962 return ; Done. | |
963 | |
964 PLED_active_gas_divemode_show: | |
0 | 965 ostc_debug 's' ; Sends debug-information to screen if debugmode active |
966 ; gas | |
967 WIN_TOP .192 | |
968 WIN_LEFT .65 | |
969 WIN_FONT FT_SMALL | |
3 | 970 call PLED_standard_color |
971 | |
0 | 972 movlw d'100' ; 100% in the tank |
973 movff char_I_N2_ratio,lo ; minus N2 | |
974 bsf STATUS,C ; set borrow bit | |
975 subfwb lo,W | |
976 movff char_I_He_ratio,lo ; minus He | |
977 bsf STATUS,C ; set borrow bit | |
978 subfwb lo,F ; =% O2 | |
979 GETCUSTOM8 d'9' ; get oxygen treshold | |
980 movff char_I_He_ratio,hi ; He ratio | |
981 cpfsgt lo | |
982 bra PLED_active_gas_divemode2 ; Check He | |
983 bra PLED_active_gas_divemode3 ; Skip He check, display gas | |
984 | |
985 PLED_active_gas_divemode2: | |
986 tstfsz hi ; He = 0 % | |
987 bra PLED_active_gas_divemode3 ; display gas | |
988 ; O2 below treshold, He=0 -> Skip display! | |
989 movlw d'5' | |
990 movwf temp1 | |
991 bra PLED_display_clear_common_y1 ; also returns! | |
992 | |
993 PLED_active_gas_divemode3: | |
994 movlw d'21' | |
995 cpfseq lo ; Air? (O2=21%) | |
996 bra PLED_active_gas_divemode4 ; No! | |
997 tstfsz hi ; Air? (He=0%) | |
998 bra PLED_active_gas_divemode4 ; No! | |
999 | |
1000 ; Yes, display "Air" instead of 21/0 | |
1001 lfsr FSR2,letter | |
8 | 1002 OUTPUTTEXTH d'264' ;"Air " |
1003 movlw ' ' | |
1004 btfsc better_gas_available ;=1: A better gas is available and a gas change is advised in divemode | |
1005 movlw '*' | |
1006 movwf POSTINC2 | |
0 | 1007 call word_processor |
25 | 1008 return |
0 | 1009 |
1010 PLED_active_gas_divemode4: | |
1011 lfsr FSR2,letter | |
1012 bsf leftbind ; left orientated output | |
1013 output_8 ; O2 ratio is still in "lo" | |
1014 movlw '/' | |
1015 movwf POSTINC2 | |
1016 movff char_I_He_ratio,lo ; copy He ratio into lo | |
1017 output_8 | |
1018 movlw ' ' | |
8 | 1019 btfsc better_gas_available ;=1: A better gas is available and a gas change is advised in divemode |
1020 movlw '*' | |
0 | 1021 movwf POSTINC2 |
1022 bcf leftbind | |
1023 call word_processor | |
25 | 1024 return |
1025 | |
17 | 1026 |
0 | 1027 |
1028 PLED_display_decotype_surface: | |
1029 WIN_LEFT .85 | |
1030 WIN_FONT FT_SMALL | |
1031 WIN_INVERT .0 ; Init new Wordprocessor | |
1032 clrf EEADRH | |
1033 read_int_eeprom d'34' ; Read deco data | |
1034 tstfsz EEDATA | |
1035 bra show_decotype_surface2 | |
1036 | |
1037 ;ZH-L16 | |
1038 WIN_TOP .125 | |
3 | 1039 call PLED_standard_color |
1040 | |
0 | 1041 lfsr FSR2,letter |
1042 movlw 'O' | |
1043 movwf POSTINC2 | |
1044 call word_processor | |
1045 WIN_LEFT .85 | |
1046 WIN_FONT FT_SMALL | |
1047 WIN_INVERT .0 ; Init new Wordprocessor | |
1048 WIN_TOP .150 | |
3 | 1049 call PLED_standard_color |
1050 | |
0 | 1051 lfsr FSR2,letter |
1052 movlw 'C' | |
1053 movwf POSTINC2 | |
1054 call word_processor | |
1055 return | |
1056 show_decotype_surface2: | |
1057 decf EEDATA,F | |
1058 tstfsz EEDATA | |
1059 bra show_decotype_surface3 | |
1060 ; Gauge | |
1061 return | |
1062 | |
1063 show_decotype_surface3: | |
1064 decf EEDATA,F | |
1065 tstfsz EEDATA | |
1066 bra show_decotype_surface4 | |
1067 ; const. ppO2 | |
1068 WIN_TOP .125 | |
3 | 1069 call PLED_standard_color |
1070 | |
0 | 1071 lfsr FSR2,letter |
1072 movlw 'C' | |
1073 movwf POSTINC2 | |
1074 WIN_LEFT .85 | |
1075 WIN_FONT FT_SMALL | |
1076 WIN_INVERT .0 ; Init new Wordprocessor | |
1077 call word_processor | |
1078 WIN_TOP .150 | |
3 | 1079 call PLED_standard_color |
1080 | |
0 | 1081 lfsr FSR2,letter |
1082 movlw 'C' | |
1083 movwf POSTINC2 | |
1084 WIN_LEFT .85 | |
1085 WIN_FONT FT_SMALL | |
1086 WIN_INVERT .0 ; Init new Wordprocessor | |
1087 call word_processor | |
1088 return | |
1089 show_decotype_surface4: | |
1090 decf EEDATA,F | |
1091 tstfsz EEDATA | |
1092 bra show_decotype_surface5 | |
1093 ; Apnoe | |
1094 return | |
1095 show_decotype_surface5: | |
1096 decf EEDATA,F | |
1097 tstfsz EEDATA | |
1098 bra show_decotype_surface6 | |
1099 ; Multi-GF OC | |
1100 WIN_TOP .125 | |
1101 lfsr FSR2,letter | |
1102 movlw 'G' | |
1103 movwf POSTINC2 | |
1104 WIN_LEFT .85 | |
1105 WIN_FONT FT_SMALL | |
1106 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 1107 call PLED_standard_color |
1108 | |
0 | 1109 call word_processor |
1110 WIN_TOP .150 | |
1111 lfsr FSR2,letter | |
1112 movlw 'F' | |
1113 movwf POSTINC2 | |
1114 WIN_LEFT .85 | |
1115 WIN_FONT FT_SMALL | |
1116 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 1117 call PLED_standard_color |
1118 | |
0 | 1119 call word_processor |
1120 return | |
1121 | |
1122 show_decotype_surface6: | |
1123 ; Multi-GF CC | |
1124 WIN_TOP .125 | |
1125 lfsr FSR2,letter | |
1126 movlw 'G' | |
1127 movwf POSTINC2 | |
1128 WIN_LEFT .85 | |
1129 WIN_FONT FT_SMALL | |
1130 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 1131 call PLED_standard_color |
1132 | |
0 | 1133 call word_processor |
1134 WIN_TOP .150 | |
1135 lfsr FSR2,letter | |
1136 movlw 'F' | |
1137 movwf POSTINC2 | |
1138 WIN_LEFT .85 | |
1139 WIN_FONT FT_SMALL | |
1140 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 1141 call PLED_standard_color |
1142 | |
0 | 1143 call word_processor |
1144 return | |
1145 | |
13 | 1146 PLED_pre_dive_screen: ;Display Pre-Dive Screen |
1147 movlw .0 | |
1148 movff WREG,box_temp+0 ; Data | |
1149 movlw .25 | |
1150 movff WREG,box_temp+1 ; row top (0-239) | |
1151 movlw .120 | |
1152 movff WREG,box_temp+2 ; row bottom (0-239) | |
1153 movlw .82 | |
1154 movff WREG,box_temp+3 ; column left (0-159) | |
1155 movlw .159 | |
1156 movff WREG,box_temp+4 ; column right (0-159) | |
1157 call PLED_box | |
1158 | |
1159 ; List active gases/Setpoints | |
1160 | |
1161 btfsc FLAG_const_ppO2_mode ; in ppO2 mode? | |
1162 bra PLED_pre_dive_screen3 ; Yes, display SetPoint/Sensor result list | |
1163 | |
1164 PLED_pre_dive_screen2: | |
1165 ostc_debug 'm' ; Sends debug-information to screen if debugmode active | |
1166 | |
1167 WIN_LEFT .90 | |
1168 WIN_FONT FT_SMALL | |
1169 bsf leftbind | |
1170 | |
1171 movlw d'2' | |
1172 movwf wait_temp ; here: stores eeprom address for gas list | |
1173 movlw d'0' | |
1174 movwf waitms_temp ; here: stores row for gas list | |
1175 clrf hi ; here: Gas counter | |
1176 | |
1177 PLED_pre_dive_screen2_loop: | |
1178 incf hi,F ; Increase Gas | |
1179 movlw d'4' | |
1180 addwf wait_temp,F ; Increase eeprom address for gas list | |
1181 | |
1182 lfsr FSR2,letter | |
1183 movlw 'G' | |
1184 movwf POSTINC2 | |
1185 movff hi,lo ; copy gas number | |
1186 output_8 ; display gas number | |
1187 movlw ':' | |
1188 movwf POSTINC2 | |
1189 movlw ' ' | |
1190 movwf POSTINC2 | |
1191 movff wait_temp, EEADR; Gas #hi: %O2 - Set address in internal EEPROM | |
1192 call read_eeprom ; get byte (stored in EEDATA) | |
1193 movff EEDATA,lo ; copy to lo | |
1194 output_8 ; outputs into Postinc2! | |
1195 movlw '/' | |
1196 movwf POSTINC2 | |
1197 incf EEADR,F ; Gas #hi: %He - Set address in internal EEPROM | |
1198 call read_eeprom ; get byte (stored in EEDATA) | |
1199 movff EEDATA,lo ; copy to lo | |
1200 output_8 ; outputs into Postinc2! | |
1201 | |
1202 read_int_eeprom d'27' ; read flag register | |
1203 movff hi,lo ; copy gas number | |
1204 PLED_pre_dive_screen2_loop1: | |
1205 rrcf EEDATA ; roll flags into carry | |
1206 decfsz lo,F ; max. 5 times... | |
1207 bra PLED_pre_dive_screen2_loop1 | |
1208 | |
14 | 1209 btfsc STATUS,C ; test carry |
13 | 1210 bra PLED_pre_dive_white |
1211 | |
1212 movlw color_grey | |
1213 call PLED_set_color ; grey out inactive gases! | |
1214 bra PLED_pre_dive_color_done | |
1215 | |
1216 PLED_pre_dive_white: | |
25 | 1217 call PLED_standard_color |
13 | 1218 |
1219 PLED_pre_dive_color_done: | |
1220 read_int_eeprom d'33' ; Read start gas (1-5) | |
1221 movf EEDATA,W | |
1222 cpfseq hi ; Current Gas the active gas? | |
1223 bra PLED_pre_dive_screen2a | |
1224 bra PLED_pre_dive_screen2b | |
1225 | |
1226 PLED_pre_dive_screen2a: | |
1227 movlw d'25' | |
1228 addwf waitms_temp,F ; Increase row | |
1229 WIN_LEFT .90 | |
1230 movff waitms_temp,win_top ; Set Row | |
1231 call word_processor ; No, display gas | |
1232 | |
1233 PLED_pre_dive_screen2b: | |
25 | 1234 call PLED_standard_color |
13 | 1235 |
1236 movlw d'5' ; list all four (remaining) gases | |
1237 cpfseq hi ; All gases shown? | |
1238 bra PLED_pre_dive_screen2_loop ; No | |
1239 | |
1240 return ; No, return (OC mode) | |
1241 | |
1242 PLED_pre_dive_screen3: | |
1243 WIN_LEFT .90 | |
1244 WIN_FONT FT_SMALL | |
1245 bsf leftbind | |
1246 | |
1247 ; list three SP in Gaslist | |
1248 movlw d'35' ; 36 = current SP position in EEPROM | |
1249 movwf wait_temp ; here: stores eeprom address for gas list | |
1250 movlw d'0' | |
1251 movwf waitms_temp ; here: stores row for gas list | |
1252 clrf temp5 ; here: SP counter | |
1253 | |
1254 PLED_pre_dive_screen3_loop: | |
1255 incf wait_temp,F ; EEPROM address | |
1256 incf temp5,F ; Increase SP | |
1257 | |
1258 movlw d'25' | |
1259 addwf waitms_temp,F ; Increase row | |
1260 WIN_LEFT .90 | |
1261 movff waitms_temp,win_top ; Set Row | |
1262 | |
1263 lfsr FSR2,letter | |
1264 movlw 'S' | |
1265 movwf POSTINC2 | |
1266 movlw 'P' | |
1267 movwf POSTINC2 | |
1268 movff temp5,lo ; copy gas number | |
1269 output_8 ; display gas number | |
1270 movlw ':' | |
1271 movwf POSTINC2 | |
1272 movlw ' ' | |
1273 movwf POSTINC2 | |
1274 movff wait_temp, EEADR; SP #hi position | |
1275 call read_eeprom ; get byte (stored in EEDATA) | |
1276 movff EEDATA,lo ; copy to lo | |
1277 clrf hi | |
1278 output_16dp d'3' ; outputs into Postinc2! | |
1279 call word_processor | |
1280 | |
1281 movlw d'3' ; list all three SP | |
1282 cpfseq temp5 ; All gases shown? | |
1283 bra PLED_pre_dive_screen3_loop ;no | |
1284 | |
19 | 1285 read_int_eeprom d'33' ; Read byte (stored in EEDATA) |
1286 movff EEDATA,active_gas ; Read start gas (1-5) | |
1287 decf active_gas,W ; Gas 0-4 | |
1288 mullw d'4' | |
1289 movf PRODL,W | |
1290 addlw d'7' ; = address for He ratio | |
1291 movwf EEADR | |
1292 call read_eeprom ; Read He ratio | |
1293 movff EEDATA,hi ; And copy into hold register | |
1294 decf active_gas,W ; Gas 0-4 | |
1295 mullw d'4' | |
1296 movf PRODL,W | |
1297 addlw d'6' ; = address for O2 ratio | |
1298 movwf EEADR | |
1299 call read_eeprom ; Read O2 ratio | |
1300 movff EEDATA, lo ; O2 ratio | |
1301 | |
1302 WIN_LEFT .90 | |
1303 WIN_TOP .100 | |
1304 lfsr FSR2,letter | |
1305 movlw 'D' | |
1306 movwf POSTINC2 | |
1307 movlw 'i' | |
1308 movwf POSTINC2 | |
1309 movlw 'l' | |
1310 movwf POSTINC2 | |
1311 movlw ':' | |
1312 movwf POSTINC2 | |
1313 output_8 ; O2 Ratio | |
1314 movlw '/' | |
1315 movwf POSTINC2 | |
1316 movff hi,lo | |
1317 output_8 ; He Ratio | |
1318 call word_processor | |
1319 | |
13 | 1320 bcf leftbind |
1321 return ; Return (CC Mode) | |
1322 | |
0 | 1323 PLED_active_gas_surfmode: ; Displays start gas/SP 1 |
1324 ostc_debug 'q' ; Sends debug-information to screen if debugmode active | |
1325 | |
1326 btfsc FLAG_apnoe_mode ; In Apnoe mode? | |
1327 return ; Yes, return | |
1328 | |
1329 btfsc gauge_mode ; In Gauge mode? | |
1330 return ; Yes, return | |
1331 | |
1332 btfss FLAG_const_ppO2_mode ; are we in const. ppO2 mode? | |
1333 bra PLED_active_gas_surfmode2 ; No, display gases | |
1334 | |
1335 ; In CC Mode | |
1336 WIN_TOP .135 | |
1337 WIN_LEFT .90 | |
1338 WIN_FONT FT_SMALL | |
1339 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 1340 call PLED_standard_color |
1341 | |
0 | 1342 lfsr FSR2,letter |
1343 read_int_eeprom d'36' | |
1344 movff EEDATA,lo ; copy to lo | |
1345 clrf hi | |
1346 output_16dp d'3' ; outputs into Postinc2! | |
1347 movlw 'B' | |
1348 movwf POSTINC2 | |
1349 movlw 'a' | |
1350 movwf POSTINC2 | |
1351 movlw 'r' | |
1352 movwf POSTINC2 | |
1353 bcf leftbind | |
1354 call word_processor | |
1355 bra PLED_active_gas_surfmode_exit | |
1356 | |
1357 PLED_active_gas_surfmode2: | |
1358 WIN_TOP .130 | |
1359 WIN_LEFT .100 | |
1360 WIN_FONT FT_MEDIUM | |
1361 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 1362 call PLED_standard_color |
1363 | |
0 | 1364 |
1365 read_int_eeprom d'33' ; Read byte (stored in EEDATA) | |
1366 movff EEDATA,active_gas ; Read start gas (1-5) | |
1367 | |
1368 decf active_gas,W ; Gas 0-4 | |
1369 mullw d'4' | |
1370 movf PRODL,W | |
1371 addlw d'7' ; = address for He ratio | |
1372 movwf EEADR | |
1373 call read_eeprom ; Read He ratio | |
1374 movff EEDATA,char_I_He_ratio ; And copy into hold register | |
1375 | |
1376 decf active_gas,W ; Gas 0-4 | |
1377 mullw d'4' | |
1378 movf PRODL,W | |
1379 addlw d'6' ; = address for O2 ratio | |
1380 movwf EEADR | |
1381 call read_eeprom ; Read O2 ratio | |
1382 movff EEDATA, char_I_O2_ratio ; O2 ratio | |
1383 movff char_I_He_ratio, wait_temp ; copy into bank1 register | |
1384 bsf STATUS,C ; Borrow bit | |
1385 movlw d'100' ; 100% | |
1386 subfwb wait_temp,W ; minus He | |
1387 bsf STATUS,C ; Borrow bit | |
1388 subfwb EEDATA,F ; minus O2 | |
1389 movff EEDATA, char_I_N2_ratio ; = N2! | |
1390 | |
1391 movlw d'100' ; 100% in the tank | |
1392 movff char_I_N2_ratio,lo ; minus N2 | |
1393 bsf STATUS,C ; set borrow bit | |
1394 subfwb lo,W | |
1395 movff char_I_He_ratio,lo ; minus He | |
1396 bsf STATUS,C ; set borrow bit | |
1397 subfwb lo,F ; =% O2 | |
1398 | |
1399 movff char_I_He_ratio,hi ; Copy into Bank1 register | |
1400 | |
1401 movlw d'21' | |
1402 cpfseq lo ; Air? (O2=21%) | |
1403 bra PLED_active_gas_surfmode4 ; No! | |
1404 tstfsz hi ; Air? (He=0%) | |
1405 bra PLED_active_gas_surfmode4 ; No! | |
1406 | |
1407 ; Yes, display "Air" instead of 21/0 | |
1408 DISPLAYTEXTH d'265' ;"Air ", y-scale=2 | |
1409 bra PLED_active_gas_surfmode_exit | |
1410 | |
1411 PLED_active_gas_surfmode4: | |
1412 lfsr FSR2,letter | |
1413 bsf leftbind ; left orientated output | |
1414 output_8 ; O2 ratio is still in "lo" | |
1415 movlw '/' | |
1416 movwf POSTINC2 | |
1417 movff char_I_He_ratio,lo ; copy He ratio into lo | |
1418 output_8 | |
1419 bcf leftbind | |
1420 call word_processor | |
1421 bra PLED_active_gas_surfmode_exit | |
1422 | |
1423 PLED_active_gas_surfmode_exit: | |
1424 movlw .0 | |
1425 movff WREG,box_temp+0 ; Data | |
1426 movlw .122 | |
1427 movff WREG,box_temp+1 ; row top (0-239) | |
1428 movlw .175 | |
1429 movff WREG,box_temp+2 ; row bottom (0-239) | |
1430 movlw .82 | |
1431 movff WREG,box_temp+3 ; column left (0-159) | |
1432 movlw .159 | |
1433 movff WREG,box_temp+4 ; column right (0-159) | |
1434 call PLED_frame | |
1435 return | |
1436 | |
1437 PLED_confirmbox: | |
1438 movlw .0 | |
1439 movff WREG,box_temp+0 ; Data | |
1440 movlw .68 | |
1441 movff WREG,box_temp+1 ; row top (0-239) | |
1442 movlw .146 | |
1443 movff WREG,box_temp+2 ; row bottom (0-239) | |
1444 movlw .34 | |
1445 movff WREG,box_temp+3 ; column left (0-159) | |
1446 movlw .101 | |
1447 movff WREG,box_temp+4 ; column right (0-159) | |
1448 call PLED_box | |
1449 | |
9 | 1450 GETCUSTOM8 d'35' ; Standard output color |
0 | 1451 movff WREG,box_temp+0 ; Data |
1452 movlw .70 | |
1453 movff WREG,box_temp+1 ; row top (0-239) | |
1454 movlw .144 | |
1455 movff WREG,box_temp+2 ; row bottom (0-239) | |
1456 movlw .35 | |
1457 movff WREG,box_temp+3 ; column left (0-159) | |
1458 movlw .100 | |
1459 movff WREG,box_temp+4 ; column right (0-159) | |
1460 call PLED_frame | |
1461 DISPLAYTEXT .143 ; Confirm: | |
1462 DISPLAYTEXT .145 ; Cancel | |
1463 DISPLAYTEXT .146 ; OK! | |
1464 | |
1465 movlw d'1' | |
1466 movwf menupos | |
1467 | |
1468 PLED_confirmbox2: | |
1469 movlw .0 | |
1470 movff WREG,box_temp+0 ; Data | |
1471 movlw .96 | |
1472 movff WREG,box_temp+1 ; row top (0-239) | |
1473 movlw .143 | |
1474 movff WREG,box_temp+2 ; row bottom (0-239) | |
1475 movlw .39 | |
1476 movff WREG,box_temp+3 ; column left (0-159) | |
1477 movlw .51 | |
1478 movff WREG,box_temp+4 ; column right (0-159) | |
1479 call PLED_box | |
1480 | |
1481 movff menupos,temp1 | |
1482 movlw d'96' | |
1483 dcfsnz temp1,F | |
1484 movlw d'96' | |
1485 dcfsnz temp1,F | |
1486 movlw d'120' | |
1487 movff WREG,win_top | |
1488 WIN_LEFT .39 | |
1489 WIN_FONT FT_SMALL | |
1490 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 1491 call PLED_standard_color |
1492 | |
0 | 1493 lfsr FSR2,letter |
1494 movlw 0xB7 ; Arrow for menu | |
1495 movwf POSTINC2 | |
1496 call word_processor | |
1497 | |
1498 bcf sleepmode ; clear some flags | |
1499 bcf menubit2 | |
1500 bcf menubit3 | |
1501 bcf switch_right | |
1502 bcf switch_left | |
1503 clrf timeout_counter2 | |
1504 WAITMS d'100' | |
1505 | |
1506 PLED_confirmbox_loop: | |
1507 call check_switches_logbook | |
1508 | |
1509 btfsc menubit3 ; SET/MENU? | |
1510 bra PLED_confirmbox_move_cursor; Move Cursor | |
1511 btfsc menubit2 ; ENTER? | |
1512 bra PLED_confirmbox_menu_do ; Do task | |
1513 | |
1514 btfsc onesecupdate | |
1515 call timeout_surfmode ; timeout | |
1516 | |
1517 btfsc onesecupdate | |
1518 call set_dive_modes ; check, if divemode must be entered | |
1519 bcf onesecupdate ; one second update | |
1520 | |
1521 btfsc sleepmode ; Timeout? | |
1522 bra PLED_confirmbox_cancel ; back with cancel | |
1523 btfsc divemode | |
1524 bra PLED_confirmbox_cancel ; back with cancel | |
1525 | |
1526 bra PLED_confirmbox_loop ; wait for something to do | |
1527 | |
1528 PLED_confirmbox_cancel: | |
1529 retlw .0 | |
1530 PLED_confirmbox_ok: | |
1531 retlw .1 | |
1532 | |
1533 PLED_confirmbox_menu_do: | |
1534 dcfsnz menupos,F | |
1535 bra PLED_confirmbox_cancel | |
1536 dcfsnz menupos,F | |
1537 bra PLED_confirmbox_ok | |
1538 bra PLED_confirmbox_cancel | |
1539 | |
1540 PLED_confirmbox_move_cursor: | |
1541 incf menupos,F | |
1542 movlw d'3' ; number of menu options+1 | |
1543 cpfseq menupos ; =limit? | |
1544 bra PLED_confirmbox_move_cursor2 ; No! | |
1545 movlw d'1' ; Yes, reset to position 1! | |
1546 movwf menupos | |
1547 PLED_confirmbox_move_cursor2: | |
1548 bra PLED_confirmbox2 ; Return to Profile Menu, also updates cursor | |
1549 | |
1550 | |
1551 PLED_depth: | |
1552 ostc_debug 'r' ; Sends debug-information to screen if debugmode active | |
1553 movff rel_pressure+1,hi | |
1554 movff rel_pressure+0,lo | |
1555 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mBar] | |
1556 | |
1557 movlw .039 | |
1558 cpfslt hi | |
1559 bra depth_greater_99_84mtr | |
1560 | |
1561 btfsc depth_greater_100m ; Was depth>100m during last call | |
1562 call PLED_clear_depth ; Yes, clear depth area | |
1563 bcf depth_greater_100m ; Do this once only... | |
1564 | |
1565 lfsr FSR2,letter | |
1566 | |
1567 movlw HIGH d'1000' | |
1568 movwf sub_a+1 | |
1569 movlw LOW d'1000' | |
1570 movwf sub_a+0 | |
1571 movff hi,sub_b+1 | |
1572 movff lo,sub_b+0 | |
1573 incf sub_b+0,F | |
1574 movlw d'0' | |
1575 addwfc sub_b+1,F ; Add 1mBar offset | |
1576 call sub16 ; sub_c = sub_a - sub_b | |
1577 btfss neg_flag ; Depth lower then 10m? | |
1578 rcall depth_less_10mtr ; Yes, add extra space | |
1579 | |
1580 WIN_TOP .24 | |
1581 WIN_LEFT .0 | |
1582 WIN_FONT FT_LARGE | |
1583 WIN_INVERT .0 ; Init new Wordprocessor | |
27
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
1584 PLED_color_code warn_depth ; Color-code the output |
0 | 1585 |
1586 movlw HIGH d'99' | |
1587 movwf sub_a+1 | |
1588 movlw LOW d'99' | |
1589 movwf sub_a+0 | |
1590 movff hi,sub_b+1 | |
1591 movff lo,sub_b+0 | |
1592 call sub16 ; sub_c = sub_a - sub_b | |
1593 btfss neg_flag ; Depth lower then 1m? | |
1594 bra pled_depth2 ; Yes, display manual Zero | |
1595 | |
1596 bsf leftbind | |
1597 bsf ignore_digit4 | |
1598 output_16 ; Full meters in Big font | |
1599 bcf leftbind | |
1600 bra pled_depth3 | |
1601 | |
1602 pled_depth2: | |
1603 movlw '0' | |
1604 movwf POSTINC2 | |
1605 pled_depth3: | |
1606 call word_processor | |
1607 bcf ignore_digit4 | |
1608 | |
1609 WIN_FONT FT_MEDIUM | |
1610 WIN_TOP .50 | |
1611 WIN_LEFT .40 | |
27
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
1612 PLED_color_code warn_depth ; Color-code the output |
0 | 1613 |
1614 movff rel_pressure+1,hi | |
1615 movff rel_pressure+0,lo | |
1616 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mBar] | |
1617 lfsr FSR2,letter | |
1618 movlw '.' | |
1619 movwf POSTINC2 | |
1620 | |
1621 movlw HIGH d'9' | |
1622 movwf sub_a+1 | |
1623 movlw LOW d'9' | |
1624 movwf sub_a+0 | |
1625 movff hi,sub_b+1 | |
1626 movff lo,sub_b+0 | |
1627 call sub16 ; sub_c = sub_a - sub_b | |
1628 btfss neg_flag ; Depth lower then 0.1m? | |
1629 bra pled_depth4 ; Yes, display manual Zero | |
1630 | |
1631 movlw d'4' | |
1632 movwf ignore_digits | |
1633 bsf ignore_digit5 | |
1634 output_16dp d'0' | |
1635 bra pled_depth5 | |
1636 | |
1637 pled_depth4: | |
1638 movlw '0' | |
1639 movwf POSTINC2 | |
1640 | |
1641 pled_depth5: | |
1642 call word_processor ; decimeters in medium font | |
1643 bcf ignore_digit5 | |
1644 WIN_FONT FT_SMALL | |
1645 return | |
1646 | |
1647 depth_greater_99_84mtr: ; Display only in full meters | |
1648 btfss depth_greater_100m ; Is depth>100m already? | |
1649 call PLED_clear_depth ; No, clear depth area and set flag | |
1650 ; Depth is already in hi:lo | |
1651 ; Show depth in Full meters | |
1652 ; That means ignore figure 4 and 5 | |
1653 lfsr FSR2,letter | |
1654 WIN_TOP .24 | |
1655 WIN_LEFT .0 | |
1656 WIN_FONT FT_LARGE | |
1657 WIN_INVERT .0 ; Init new Wordprocessor | |
27
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
1658 PLED_color_code warn_depth ; Color-code the output |
3 | 1659 |
0 | 1660 bsf ignore_digit4 |
1661 bsf leftbind | |
1662 output_16 | |
1663 bcf leftbind | |
1664 call word_processor | |
1665 bcf ignore_digit4 | |
1666 WIN_FONT FT_SMALL | |
1667 return | |
1668 | |
1669 depth_less_10mtr: | |
1670 movlw ' ' | |
1671 movwf POSTINC2 | |
1672 return | |
1673 | |
1674 PLED_clear_depth ; No, clear depth area and set flag | |
1675 movlw .0 | |
1676 movff WREG,box_temp+0 ; Data | |
1677 movlw .24 | |
1678 movff WREG,box_temp+1 ; row top (0-239) | |
1679 movlw .90 | |
1680 movff WREG,box_temp+2 ; row bottom (0-239) | |
1681 movlw .0 | |
1682 movff WREG,box_temp+3 ; column left (0-159) | |
1683 movlw .90 | |
1684 movff WREG,box_temp+4 ; column right (0-159) | |
1685 call PLED_box | |
1686 bsf depth_greater_100m ; Set Flag | |
1687 return | |
1688 | |
1689 | |
1690 PLED_desaturation_time: | |
1691 ostc_debug 'h' | |
1692 WIN_TOP .150 | |
1693 WIN_LEFT .0 | |
1694 WIN_FONT FT_SMALL | |
1695 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 1696 call PLED_standard_color |
1697 | |
0 | 1698 lfsr FSR2,letter |
1699 OUTPUTTEXT d'14' ; Desat | |
1700 movlw ' ' | |
1701 movwf POSTINC2 | |
1702 movff int_O_desaturation_time+0,lo ; divide by 60... | |
1703 movff int_O_desaturation_time+1,hi | |
1704 call convert_time ; converts hi:lo in minutes to hours (hi) and minutes (lo) | |
1705 bsf leftbind | |
1706 movf lo,W | |
1707 movff hi,lo | |
1708 movwf hi ; exchange lo and hi... | |
1709 output_8 ; Hours | |
1710 movlw ':' | |
1711 movwf POSTINC2 | |
1712 movff hi,lo ; Minutes | |
1713 output_99x | |
1714 bcf leftbind | |
1715 call word_processor | |
1716 return | |
1717 | |
1718 PLED_nofly_time: | |
1719 ostc_debug 'g' | |
1720 WIN_TOP .125 | |
1721 WIN_LEFT .0 | |
1722 WIN_FONT FT_SMALL | |
1723 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 1724 call PLED_standard_color |
1725 | |
0 | 1726 lfsr FSR2,letter |
1727 OUTPUTTEXT d'35' ; NoFly | |
1728 movlw ' ' | |
1729 movwf POSTINC2 | |
1730 movff nofly_time+0,lo ; divide by 60... | |
1731 movff nofly_time+1,hi | |
1732 call convert_time ; converts hi:lo in minutes to hours (hi) and minutes (lo) | |
1733 bsf leftbind | |
1734 movf lo,W | |
1735 movff hi,lo | |
1736 movwf hi ; exchange lo and hi... | |
1737 output_8 ; Hours | |
1738 movlw ':' | |
1739 movwf POSTINC2 | |
1740 movff hi,lo ; Minutes | |
1741 decf lo,F | |
1742 btfsc lo,7 ; keep Nofly time | |
1743 clrf lo | |
1744 output_99x | |
1745 bcf leftbind | |
1746 call word_processor | |
1747 return | |
1748 | |
1749 | |
1750 update_surf_press: | |
1751 btfsc premenu ; Do not update when "Menu?" is displayed! | |
1752 return | |
1753 | |
1754 ostc_debug 'b' ; Sends debug-information to screen if debugmode active | |
1755 WIN_TOP .25 | |
1756 WIN_LEFT .0 | |
1757 WIN_FONT FT_SMALL | |
1758 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 1759 call PLED_standard_color |
1760 | |
0 | 1761 lfsr FSR2,letter |
1762 movff amb_pressure+0,lo | |
1763 movff amb_pressure+1,hi | |
1764 bsf leftbind | |
1765 output_16 | |
1766 bcf leftbind | |
1767 movlw 'm' | |
1768 movwf POSTINC2 | |
1769 movlw 'b' | |
1770 movwf POSTINC2 | |
1771 movlw 'a' | |
1772 movwf POSTINC2 | |
1773 movlw 'r' | |
1774 movwf POSTINC2 | |
1775 movlw ' ' | |
1776 movwf POSTINC2 | |
1777 call word_processor | |
1778 return | |
1779 | |
1780 update_batt_voltage_divemode: | |
1781 | |
1782 update_batt_voltage: | |
1783 ostc_debug 'f' | |
1784 | |
1785 GETCUSTOM8 d'31' ; =1 if battery voltage should be visible | |
1786 movwf lo | |
1787 movlw d'1' | |
1788 cpfseq lo ; =1? | |
1789 bra update_batt_voltage2 ; No, show symbol | |
1790 | |
1791 WIN_TOP .175 | |
1792 WIN_LEFT .0 | |
1793 WIN_FONT FT_SMALL | |
1794 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 1795 call PLED_standard_color |
1796 | |
0 | 1797 lfsr FSR2,letter |
1798 movff batt_voltage+0,lo | |
1799 movff batt_voltage+1,hi | |
1800 movlw d'1' | |
1801 movwf ignore_digits | |
1802 bsf ignore_digit5 ; do not display mV | |
1803 bsf leftbind | |
1804 output_16dp d'2' ; e.g. 3.45V | |
1805 bcf leftbind | |
1806 movlw 'V' | |
1807 movwf POSTINC2 | |
1808 movlw ' ' | |
1809 movwf POSTINC2 | |
1810 call word_processor | |
1811 return | |
1812 | |
1813 update_batt_voltage2: | |
9 | 1814 GETCUSTOM8 d'35' ; Standard output color |
0 | 1815 movff WREG,box_temp+0 ; Data |
1816 movlw .174 | |
1817 movff WREG,box_temp+1 ; row top (0-239) | |
1818 movlw .194 | |
1819 movff WREG,box_temp+2 ; row bottom (0-239) | |
1820 movlw .0 | |
1821 movff WREG,box_temp+3 ; column left (0-159) | |
1822 movlw .31 | |
1823 movff WREG,box_temp+4 ; column right (0-159) | |
1824 call PLED_frame | |
1825 | |
25 | 1826 ; 4100-Vbatt |
1827 movlw LOW d'4100' | |
0 | 1828 movwf sub_a+0 |
25 | 1829 movlw HIGH d'4100' |
0 | 1830 movwf sub_a+1 |
1831 movff batt_voltage+0,sub_b+0 | |
1832 movff batt_voltage+1,sub_b+1 | |
1833 call sub16 ; sub_c = sub_a - sub_b | |
25 | 1834 ; Battery full (>4100mV? |
0 | 1835 btfsc neg_flag |
1836 bra update_batt_voltage2_full | |
1837 | |
25 | 1838 ; Vbatt-3500 |
1839 movlw LOW d'3500' | |
0 | 1840 movwf sub_b+0 |
25 | 1841 movlw HIGH d'3500' |
0 | 1842 movwf sub_b+1 |
1843 movff batt_voltage+0,sub_a+0 | |
1844 movff batt_voltage+1,sub_a+1 | |
1845 call sub16 ; sub_c = sub_a - sub_b | |
25 | 1846 ; Battery lower then 3500mV? |
0 | 1847 btfsc neg_flag |
1848 bra update_batt_voltage2_empty | |
1849 | |
25 | 1850 ; Battery is between 3500 and 4100mV |
0 | 1851 ; sub_c:2 is between 0 and 600 |
1852 movff sub_c+0,xA+0 | |
1853 movff sub_c+1,xA+1 | |
1854 movlw d'20' | |
1855 movwf xB+0 | |
1856 clrf xB+1 | |
1857 call div16x16 ;xA/xB=xC with xA as remainder | |
1858 ; xC is between 0 and 30 | |
1859 movff xC+0,wait_temp ;save value | |
1860 | |
1861 movlw d'2' | |
1862 cpfsgt wait_temp | |
1863 movwf wait_temp ; Minimum = 2 | |
1864 | |
1865 update_batt_voltage2a: | |
9 | 1866 GETCUSTOM8 d'35' ; Standard output color |
0 | 1867 movff WREG,box_temp+0 ; Data |
1868 movlw .181 | |
1869 movff WREG,box_temp+1 ; row top (0-239) | |
1870 movlw .187 | |
1871 movff WREG,box_temp+2 ; row bottom (0-239) | |
1872 movlw .31 | |
1873 movff WREG,box_temp+3 ; column left (0-159) | |
1874 movlw .33 | |
1875 movff WREG,box_temp+4 ; column right (0-159) | |
25 | 1876 call PLED_box ; Full Cap |
1877 | |
1878 ; GETCUSTOM8 d'35' ; Standard output color | |
1879 ; movff WREG,box_temp+0 ; Data | |
1880 ; movlw .181 | |
1881 ; movff WREG,box_temp+1 ; row top (0-239) | |
1882 ; movlw .187 | |
1883 ; movff WREG,box_temp+2 ; row bottom (0-239) | |
1884 ; movlw .31 | |
1885 ; movff WREG,box_temp+3 ; column left (0-159) | |
1886 ; movlw .33 | |
1887 ; movff WREG,box_temp+4 ; column right (0-159) | |
1888 ; call PLED_frame ; Empty cap | |
1889 ; | |
0 | 1890 update_batt_voltage3: |
25 | 1891 GETCUSTOM8 d'34' ; Color battery |
0 | 1892 movff WREG,box_temp+0 ; Color Data |
25 | 1893 movlw .176 |
0 | 1894 movff WREG,box_temp+1 ; row top (0-239) |
25 | 1895 movlw .192 |
0 | 1896 movff WREG,box_temp+2 ; row bottom (0-239) |
1897 movlw .1 | |
1898 movff WREG,box_temp+3 ; column left (0-159) | |
1899 movff wait_temp,box_temp+4 ; column right (0-159) | |
1900 call PLED_box | |
1901 | |
25 | 1902 call PLED_standard_color |
0 | 1903 return |
1904 | |
1905 update_batt_voltage2_empty: | |
1906 movlw d'1' | |
1907 movwf wait_temp | |
1908 bra update_batt_voltage2a | |
1909 | |
1910 update_batt_voltage2_full: | |
1911 movlw d'30' | |
1912 movwf wait_temp | |
25 | 1913 bra update_batt_voltage2a |
0 | 1914 |
1915 PLED_convert_date: ; converts into "DD/MM/YY" or "MM/DD/YY" or "YY/MM/DD" in postinc2 | |
1916 read_int_eeprom d'91' ; Read date format (0=MMDDYY, 1=DDMMYY, 2=YYMMDD) | |
1917 tstfsz EEDATA | |
1918 bra PLED_convert_date1 | |
1919 | |
1920 ; Use MMDDYY | |
1921 movff convert_value_temp+0,lo ;month | |
1922 bsf leftbind | |
1923 output_99x | |
1924 bcf leftbind | |
1925 movlw '/' | |
1926 movwf POSTINC2 | |
1927 movff convert_value_temp+1,lo ;day | |
1928 bra PLED_convert_date1_common ;year | |
1929 | |
1930 PLED_convert_date1: | |
1931 read_int_eeprom d'91' ; Read date format (0=MMDDYY, 1=DDMMYY, 2=YYMMDD) | |
1932 decfsz EEDATA,F | |
1933 bra PLED_convert_date2 | |
1934 | |
1935 ; Use DDMMYY | |
1936 movff convert_value_temp+1,lo ;day | |
1937 bsf leftbind | |
1938 output_99x | |
1939 bcf leftbind | |
1940 movlw '/' | |
1941 movwf POSTINC2 | |
1942 movff convert_value_temp+0,lo ;month | |
1943 | |
1944 PLED_convert_date1_common: | |
1945 bsf leftbind | |
1946 output_99x | |
1947 bcf leftbind | |
1948 movlw '/' | |
1949 movwf POSTINC2 | |
1950 movff convert_value_temp+2,lo ;year | |
1951 bsf leftbind | |
1952 output_99x | |
1953 return | |
1954 | |
1955 PLED_convert_date2: | |
1956 ; Use YYMMDD | |
1957 movff convert_value_temp+2,lo ;year | |
1958 bsf leftbind | |
1959 output_99x | |
1960 bcf leftbind | |
1961 movlw '/' | |
1962 movwf POSTINC2 | |
1963 movff convert_value_temp+0,lo ;month | |
1964 bsf leftbind | |
1965 output_99x | |
1966 bcf leftbind | |
1967 movlw '/' | |
1968 movwf POSTINC2 | |
1969 movff convert_value_temp+1,lo ;day | |
1970 bsf leftbind | |
1971 output_99x | |
1972 return | |
1973 | |
1974 PLED_convert_date_short: ; converts into "DD/MM" or "MM/DD" or "MM/DD" in postinc2 | |
1975 read_int_eeprom d'91' ; Read date format (0=MMDDYY, 1=DDMMYY, 2=YYMMDD) | |
1976 tstfsz EEDATA | |
1977 bra PLED_convert_date_short1 | |
1978 | |
1979 ; Use MMDDYY | |
1980 PLED_convert_date_short_common: | |
1981 movff convert_value_temp+0,lo ;month | |
1982 bsf leftbind | |
1983 output_99x | |
1984 bcf leftbind | |
1985 movlw '/' | |
1986 movwf POSTINC2 | |
1987 movff convert_value_temp+1,lo ;day | |
1988 bsf leftbind | |
1989 output_99x | |
1990 bcf leftbind | |
1991 return | |
1992 | |
1993 PLED_convert_date_short1: | |
1994 read_int_eeprom d'91' ; Read date format (0=MMDDYY, 1=DDMMYY, 2=YYMMDD) | |
1995 decfsz EEDATA,F | |
1996 bra PLED_convert_date_short_common ; Use YYMMDD | |
1997 | |
1998 ; Use DDMMYY | |
1999 movff convert_value_temp+1,lo ;day | |
2000 bsf leftbind | |
2001 output_99x | |
2002 bcf leftbind | |
2003 movlw '/' | |
2004 movwf POSTINC2 | |
2005 movff convert_value_temp+0,lo ;month | |
2006 bsf leftbind | |
2007 output_99x | |
2008 bcf leftbind | |
2009 return | |
2010 | |
2011 update_date: | |
2012 ostc_debug 'd' | |
2013 WIN_TOP .75 | |
2014 WIN_LEFT .0 | |
2015 WIN_FONT FT_SMALL | |
2016 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 2017 call PLED_standard_color |
2018 | |
0 | 2019 lfsr FSR2,letter |
2020 | |
2021 movff month,convert_value_temp+0 | |
2022 movff day,convert_value_temp+1 | |
2023 movff year,convert_value_temp+2 | |
2024 call PLED_convert_date ; converts into "DD/MM/YY" or "MM/DD/YY" or "YY/MM/DD" in postinc2 | |
2025 call word_processor | |
2026 return | |
2027 | |
2028 PLED_menu_clear: | |
2029 movlw .0 | |
2030 movff WREG,box_temp+0 ; Data | |
2031 movlw .0 | |
2032 movff WREG,box_temp+1 ; row top (0-239) | |
2033 movlw .26 | |
2034 movff WREG,box_temp+2 ; row bottom (0-239) | |
2035 movlw .65 | |
2036 movff WREG,box_temp+3 ; column left (0-159) | |
2037 movlw .100 | |
2038 movff WREG,box_temp+4 ; column right (0-159) | |
2039 call PLED_box | |
2040 return | |
2041 | |
2042 PLED_max_pressure: | |
2043 btfsc multi_gf_display ; Is the Multi-GF Table displayed? | |
2044 return ; Yes, No update and return! | |
2045 | |
2046 ostc_debug 'p' ; Sends debug-information to screen if debugmode active | |
2047 | |
2048 WIN_TOP .184 | |
2049 WIN_LEFT .0 | |
2050 WIN_FONT FT_MEDIUM | |
2051 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 2052 call PLED_standard_color |
2053 | |
0 | 2054 lfsr FSR2,letter |
2055 movff max_pressure+0,lo | |
2056 movff max_pressure+1,hi | |
2057 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mBar] | |
2058 bsf leftbind | |
2059 bsf ignore_digit5 ; do not display 1cm depth | |
2060 output_16dp d'3' | |
2061 bcf leftbind | |
2062 bcf show_last3 | |
2063 call word_processor | |
2064 WIN_FONT FT_SMALL | |
2065 return | |
2066 | |
2067 PLED_divemins: | |
2068 btfsc menubit ; Divemode menu active? | |
2069 return ; Yes, do not update divetime | |
2070 | |
2071 ostc_debug 'A' ; Sends debug-information to screen if debugmode active | |
2072 | |
2073 btfsc gauge_mode ; different display in gauge mode | |
2074 bra PLED_divemins_gauge | |
2075 | |
2076 btfsc FLAG_apnoe_mode ; different display in apnoe mode | |
2077 bra PLED_divemins_apnoe | |
2078 | |
2079 GETCUSTOM8 d'38' ; Show seconds (=1?) | |
2080 movwf lo | |
2081 movlw d'1' | |
2082 cpfseq lo ; =1? | |
2083 bra PLED_divemins2 ; No, minutes only | |
2084 bra PLED_divemins_gauge ; Yes, use Gauge routine | |
2085 | |
2086 PLED_divemins2: | |
2087 movff divemins+0,lo | |
2088 movff divemins+1,hi | |
2089 bcf leftbind | |
2090 lfsr FSR2,letter | |
2091 output_16_3 ; displays only last three figures from a 16Bit value (0-999) | |
2092 WIN_TOP .20 | |
2093 WIN_LEFT .120 | |
2094 WIN_FONT FT_MEDIUM | |
3 | 2095 call PLED_standard_color |
2096 | |
0 | 2097 call word_processor |
2098 WIN_FONT FT_SMALL | |
2099 return | |
2100 | |
2101 PLED_display_apnoe_surface: | |
2102 btfsc menubit ; Divemode menu active? | |
2103 return ; Yes, do not display surface mode timeout | |
2104 | |
9 | 2105 call PLED_divemask_color ; Set Color for Divemode mask |
0 | 2106 DISPLAYTEXT d'140' ; "SURFACE" |
3 | 2107 call PLED_standard_color |
2108 | |
0 | 2109 |
2110 WIN_TOP .85 | |
2111 WIN_LEFT .90 | |
2112 WIN_FONT FT_MEDIUM | |
3 | 2113 call PLED_standard_color |
2114 | |
0 | 2115 |
2116 movff apnoe_surface_mins,lo | |
2117 bcf leftbind | |
2118 lfsr FSR2,letter | |
2119 output_8 | |
2120 movlw ':' | |
2121 movwf POSTINC2 | |
2122 movff apnoe_surface_secs,lo | |
2123 output_99x | |
2124 call word_processor | |
2125 WIN_FONT FT_SMALL | |
2126 return | |
2127 | |
2128 PLED_apnoe_clear_surface: | |
2129 ; Clear Surface timer.... | |
2130 movlw .0 | |
2131 movff WREG,box_temp+0 ; Data | |
2132 movlw .60 | |
2133 movff WREG,box_temp+1 ; row top (0-239) | |
2134 movlw .119 | |
2135 movff WREG,box_temp+2 ; row bottom (0-239) | |
2136 movlw .90 | |
2137 movff WREG,box_temp+3 ; column left (0-159) | |
2138 movlw .159 | |
2139 movff WREG,box_temp+4 ; column right (0-159) | |
2140 call PLED_box | |
2141 return | |
2142 | |
2143 | |
2144 PLED_display_apnoe_descent: | |
9 | 2145 call PLED_divemask_color ; Set Color for Divemode mask |
0 | 2146 DISPLAYTEXT d'139' ; "Descent" |
3 | 2147 call PLED_standard_color |
2148 | |
0 | 2149 |
2150 WIN_TOP .145 | |
2151 WIN_LEFT .90 | |
2152 WIN_FONT FT_MEDIUM | |
3 | 2153 call PLED_standard_color |
2154 | |
0 | 2155 |
2156 movff apnoe_mins,lo | |
2157 lfsr FSR2,letter | |
2158 output_8 | |
2159 movlw ':' | |
2160 movwf POSTINC2 | |
2161 movff apnoe_secs,lo | |
2162 output_99x | |
2163 call word_processor | |
2164 WIN_FONT FT_SMALL | |
2165 return | |
2166 | |
2167 PLED_divemins_apnoe: | |
2168 | |
2169 PLED_divemins_gauge: | |
2170 movff divemins+0,lo | |
2171 movff divemins+1,hi | |
2172 bcf leftbind | |
2173 bsf show_last3 | |
2174 lfsr FSR2,letter | |
2175 output_16_3 ;Displays only 0...999 | |
2176 movlw ':' | |
2177 movwf POSTINC2 | |
2178 movff divesecs,lo | |
2179 output_99x | |
2180 WIN_TOP .20 | |
2181 WIN_LEFT .90 | |
2182 WIN_FONT FT_MEDIUM | |
3 | 2183 call PLED_standard_color |
2184 | |
0 | 2185 call word_processor |
2186 bcf show_last3 | |
2187 WIN_FONT FT_SMALL | |
2188 return | |
2189 | |
2190 PLED_stopwatch_remove: | |
2191 movlw .0 | |
2192 movff WREG,box_temp+0 ; Data | |
2193 movlw .54 | |
2194 movff WREG,box_temp+1 ; row top (0-239) | |
2195 movlw .102 | |
2196 movff WREG,box_temp+2 ; row bottom (0-239) | |
2197 movlw .062 | |
2198 movff WREG,box_temp+3 ; column left (0-159) | |
2199 movlw .159 | |
2200 movff WREG,box_temp+4 ; column right (0-159) | |
2201 call PLED_box | |
2202 return | |
2203 | |
2204 | |
2205 PLED_stopwatch_show: | |
2206 btfsc menubit ; Divemode menu active? | |
2207 return ; Yes, No update and return! | |
2208 | |
2209 ostc_debug 'V' ; Sends debug-information to screen if debugmode active | |
2210 ; Stopwatch | |
2211 | |
9 | 2212 call PLED_divemask_color ; Set Color for Divemode mask |
0 | 2213 DISPLAYTEXTH d'283' ; Counter |
3 | 2214 call PLED_standard_color |
2215 | |
0 | 2216 |
2217 WIN_TOP .80 | |
2218 WIN_LEFT .110 | |
2219 WIN_FONT FT_SMALL | |
3 | 2220 call PLED_standard_color |
2221 | |
0 | 2222 |
2223 | |
2224 | |
2225 lfsr FSR2,letter | |
2226 movff average_divesecs+0,lo ; Stopwatch | |
2227 movff average_divesecs+1,hi ; Stopwatch | |
2228 movlw d'2' | |
2229 subwf lo,F | |
2230 movlw d'0' | |
2231 subwfb hi,F ; Subtract 2 seconds | |
2232 | |
2233 call convert_time ; converts hi:lo in seconds to mins (hi) and secs (lo) | |
2234 | |
2235 movff lo,wait_temp | |
2236 movff hi,lo | |
2237 clrf hi | |
2238 | |
2239 movlw d'0' | |
2240 bcf leftbind | |
2241 bsf show_last3 | |
2242 output_16_3 ;Displays only 0...999 | |
2243 movlw ':' | |
2244 movwf POSTINC2 | |
2245 movff wait_temp,lo | |
2246 output_99x | |
2247 bcf leftbind | |
2248 call word_processor | |
2249 | |
2250 ostc_debug 'U' ; Sends debug-information to screen if debugmode active | |
2251 | |
2252 WIN_TOP .80 | |
2253 WIN_LEFT .62 | |
2254 WIN_FONT FT_SMALL | |
3 | 2255 call PLED_standard_color |
2256 | |
0 | 2257 |
2258 lfsr FSR2,letter | |
2259 movff avr_rel_pressure+0,lo | |
2260 movff avr_rel_pressure+1,hi | |
2261 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mBar] | |
2262 bsf leftbind | |
2263 bsf ignore_digit5 ; do not display 1cm depth | |
2264 output_16dp d'3' | |
2265 bcf leftbind | |
2266 movlw 'm' | |
2267 movwf POSTINC2 | |
2268 movlw ' ' | |
2269 movwf POSTINC2 | |
2270 call word_processor | |
2271 return | |
2272 | |
2273 | |
2274 PLED_serial: ; Writes OSTC #Serial and Firmware version in surfacemode | |
2275 ostc_debug 'a' ; Sends debug-information to screen if debugmode active | |
2276 WIN_TOP .0 | |
2277 WIN_LEFT .0 | |
2278 WIN_FONT FT_SMALL | |
2279 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 2280 call PLED_standard_color |
2281 | |
0 | 2282 |
2283 lfsr FSR2,letter | |
2284 OUTPUTTEXTH d'262' ; "OSTC " | |
2285 clrf EEADRH | |
2286 clrf EEADR ; Get Serial number LOW | |
2287 call read_eeprom ; read byte | |
2288 movff EEDATA,lo | |
2289 incf EEADR,F ; Get Serial number HIGH | |
2290 call read_eeprom ; read byte | |
2291 movff EEDATA,hi | |
2292 | |
2293 bsf leftbind | |
2294 output_16 | |
2295 movlw ' ' | |
2296 movwf POSTINC2 | |
2297 movlw 'V' | |
2298 movwf POSTINC2 | |
2299 movlw softwareversion_x | |
2300 movwf lo | |
2301 bsf leftbind | |
2302 output_8 | |
2303 movlw '.' | |
2304 movwf POSTINC2 | |
2305 movlw softwareversion_y | |
2306 movwf lo | |
2307 bsf leftbind | |
2308 output_99x | |
2309 bcf leftbind | |
2310 call word_processor | |
2311 return | |
2312 | |
2313 PLED_divemode_menu_mask_first: ; Write Divemode menu1 mask | |
2314 ostc_debug 'o' ; Sends debug-information to screen if debugmode active | |
2315 call PLED_menu_clear ; clear "Menu?" | |
2316 DISPLAYTEXT .31 ;"Show Deco" | |
2317 | |
2318 btfsc FLAG_const_ppO2_mode ; are we in ppO2 mode? | |
2319 bra PLED_divemode_menu_mask_first2 | |
2320 ; in OC Mode | |
2321 DISPLAYTEXT .32 ;"Gaslist" | |
2322 DISPLAYTEXT .122 ; "Set Gas" | |
2323 bra PLED_divemode_menu_mask_first3 | |
2324 | |
2325 PLED_divemode_menu_mask_first2: | |
2326 ; in CC Mode | |
2327 DISPLAYTEXT .238 ; "SetPoint" | |
2328 DISPLAYTEXT .137 ; "Bailout" | |
2329 | |
2330 PLED_divemode_menu_mask_first3: | |
2331 ; In all modes | |
2332 DISPLAYTEXT .33 ;"More" | |
2333 DISPLAYTEXT .34 ;"Exit" | |
2334 return | |
2335 | |
2336 PLED_divemode_menu_mask_second: ; Write Divemode menu1 mask | |
2337 ostc_debug 'o' ; Sends debug-information to screen if debugmode active | |
2338 DISPLAYTEXT .240 ;"Graphs" | |
2339 DISPLAYTEXT .241 ;"Display" | |
2340 DISPLAYTEXTH .281 ;"L. Tissue" | |
2341 DISPLAYTEXT .147 ;"Stopwat." | |
2342 DISPLAYTEXT .244 ;"Exit" | |
2343 return | |
2344 | |
2345 PLED_divemode_set_xgas: ; Displayes the "Set Gas" menu | |
2346 WIN_LEFT .100 | |
2347 WIN_TOP .0 | |
2348 WIN_FONT FT_SMALL | |
3 | 2349 call PLED_standard_color |
2350 | |
0 | 2351 lfsr FSR2,letter |
2352 movlw 'S' | |
2353 movwf POSTINC2 | |
2354 movlw 'e' | |
2355 movwf POSTINC2 | |
2356 movlw 'l' | |
2357 movwf POSTINC2 | |
2358 read_int_eeprom d'24' ; Get Gas6 %O2 | |
2359 movff EEDATA,lo | |
2360 bcf leftbind | |
2361 output_99 ; outputs into Postinc2! | |
2362 movlw '/' | |
2363 movwf POSTINC2 | |
2364 read_int_eeprom d'25' ; Get Gas6 %He | |
2365 movff EEDATA,lo | |
2366 output_99 ; outputs into Postinc2! | |
2367 call word_processor | |
2368 DISPLAYTEXT .123 ; O2 + | |
2369 DISPLAYTEXT .124 ; O2 - | |
2370 DISPLAYTEXT .125 ; He + | |
2371 DISPLAYTEXT .126 ; He - | |
2372 return | |
2373 | |
2374 PLED_divemode_simulator_mask: | |
2375 DISPLAYTEXT .254 ; EXIT | |
2376 DISPLAYTEXT .250 ; + 1m | |
2377 DISPLAYTEXT .251 ; - 1m | |
2378 DISPLAYTEXT .252 ; +10m | |
2379 DISPLAYTEXT .253 ; -10m | |
2380 return | |
2381 | |
2382 PLED_decoplan_bargraph: | |
9 | 2383 GETCUSTOM8 d'35' ; Standard output color |
0 | 2384 movff WREG,box_temp+0 ; Data |
30 | 2385 incf win_top,F ; +1 |
0 | 2386 movff win_top,box_temp+1 ; row top (0-239) |
2387 movff win_top,box_temp+2 ; | |
30 | 2388 movlw d'18' |
0 | 2389 addwf box_temp+2,F ; row bottom (0-239) |
2390 movlw .122 | |
2391 movff WREG,box_temp+3 ; column left (0-159) | |
2392 addwf lo,F ; Add time offset | |
2393 decf lo,F ; minus one | |
2394 movlw d'138' ; Limit length (16min) | |
2395 cpfslt lo | |
2396 movwf lo | |
2397 movff lo,box_temp+4 ; column right (0-159) | |
2398 call PLED_box | |
2399 | |
2400 movlw .0 | |
2401 movff WREG,box_temp+0 ; Data | |
2402 movff win_top,box_temp+1 ; row top (0-239) | |
2403 movff win_top,box_temp+2 ; | |
30 | 2404 movlw d'18' |
0 | 2405 addwf box_temp+2,F ; row bottom (0-239) |
2406 movff lo,box_temp+3 ; | |
2407 incf box_temp+3,F ; column left (0-159) | |
2408 movlw .139 | |
2409 movff WREG,box_temp+4 ; column right (0-159) | |
2410 call PLED_box | |
2411 return | |
2412 | |
2413 PLED_decoplan_delete: ; Delete unused rows | |
2414 movlw .0 | |
2415 movff WREG,box_temp+0 ; data 00, x0, 0y, xy clear, links, rechts, beide | |
2416 | |
2417 movff hi,box_temp+1 ; row top (0-63) | |
2418 movlw .125 | |
2419 movff WREG,box_temp+2 ; row bottom (0-63) | |
2420 movlw .100 | |
2421 movff WREG,box_temp+3 ; column left (0-159) | |
2422 movlw .159 | |
2423 movff WREG,box_temp+4 ; column right (0-159) | |
2424 call PLED_box | |
2425 return | |
2426 | |
2427 PLED_decoplan: ; display the Decoplan | |
2428 ostc_debug 'n' ; Sends debug-information to screen if debugmode active | |
2429 | |
2430 movff char_O_array_decodepth+0,lo ; Get Depth | |
2431 tstfsz lo | |
2432 bra PLED_decoplan1 | |
2433 ; No Deco, show "no Deco" | |
2434 call PLED_clear_divemode_menu ; Clear Deco area | |
2435 DISPLAYTEXT d'239' ;"No Deco" | |
2436 return | |
2437 | |
2438 PLED_decoplan1: | |
30 | 2439 setf temp5 |
2440 movlw .231 | |
2441 movwf temp6 ; row | |
2442 PLED_decoplan2: | |
2443 movlw d'25' | |
2444 addwf temp6,F | |
2445 incf temp5,F | |
2446 call PLED_decoplan_show_stop | |
2447 movlw d'5' ; 6 Stops... | |
2448 cpfseq temp5 | |
2449 bra PLED_decoplan2 | |
2450 return | |
2451 | |
2452 PLED_decoplan_show_stop: | |
0 | 2453 bsf leftbind |
2454 WIN_LEFT .100 | |
30 | 2455 movff temp6,win_top |
2456 movff temp6,hi ; copy for PLED_decoplan_bargraph | |
2457 | |
2458 lfsr FSR1,char_O_array_decodepth;+0 | |
2459 movf temp5,W ; number of entry | |
2460 movff PLUSW1,lo | |
0 | 2461 movf lo,w |
2462 btfsc STATUS,Z ; =0 | |
2463 goto PLED_decoplan_delete ; Yes, quit display | |
30 | 2464 |
0 | 2465 lfsr FSR2,letter |
2466 output_8 ; outputs into Postinc2! | |
2467 movlw 'm' | |
2468 movwf POSTINC2 | |
2469 call word_processor | |
30 | 2470 |
0 | 2471 WIN_LEFT .140 |
30 | 2472 movff temp6,win_top |
2473 | |
2474 lfsr FSR1,char_O_array_decotime;+0 | |
2475 movf temp5,W ; number of entry | |
2476 movff PLUSW1,lo | |
2477 | |
2478 lfsr FSR2,letter | |
0 | 2479 output_99x ; outputs into Postinc2! |
2480 movlw d'39' ;"'" | |
2481 movwf POSTINC2 | |
2482 call word_processor | |
2483 call PLED_decoplan_bargraph ; draws a box representing the decotime (stored in lo...) for this depth | |
2484 return | |
2485 | |
30 | 2486 ; WIN_LEFT .100 |
2487 ; movlw .025 | |
2488 ; movff WREG,win_top | |
2489 ; movwf hi ; copy for PLED_decoplan_bargraph | |
2490 ; call PLED_SetRow ; Set Row | |
2491 ; lfsr FSR2,letter | |
2492 ; movff char_O_array_decodepth+1,lo ; Get Depth | |
2493 ; movf lo,w | |
2494 ; btfsc STATUS,Z ; =0 | |
2495 ; goto PLED_decoplan_delete ; Yes, quit display | |
2496 ; output_8 ; outputs into Postinc2! | |
2497 ; movlw 'm' | |
2498 ; movwf POSTINC2 | |
2499 ; call word_processor | |
2500 ; WIN_LEFT .140 | |
2501 ; movlw .025 | |
2502 ; movff WREG,win_top | |
2503 ; lfsr FSR2,letter | |
2504 ; movff char_O_array_decotime+1,lo ; Get length for this stop | |
2505 ; output_99x ; outputs into Postinc2! | |
2506 ; movlw d'39' ;"'" | |
2507 ; movwf POSTINC2 | |
2508 ; call word_processor | |
2509 ; call PLED_decoplan_bargraph ; draws a box representing the decotime (stored in lo...) for this depth | |
2510 ; | |
2511 ; WIN_LEFT .100 | |
2512 ; movlw .050 | |
2513 ; movff WREG,win_top | |
2514 ; movwf hi ; copy for PLED_decoplan_bargraph | |
2515 ; call PLED_SetRow ; Set Row | |
2516 ; lfsr FSR2,letter | |
2517 ; movff char_O_array_decodepth+2,lo ; Get Depth | |
2518 ; movf lo,w | |
2519 ; btfsc STATUS,Z ; =0 | |
2520 ; goto PLED_decoplan_delete ; Yes, quit display | |
2521 ; output_8 ; outputs into Postinc2! | |
2522 ; movlw 'm' | |
2523 ; movwf POSTINC2 | |
2524 ; call word_processor | |
2525 ; WIN_LEFT .140 | |
2526 ; movlw .050 | |
2527 ; movff WREG,win_top | |
2528 ; lfsr FSR2,letter | |
2529 ; movff char_O_array_decotime+2,lo ; Get length for this stop | |
2530 ; output_99x ; outputs into Postinc2! | |
2531 ; movlw d'39' ;"'" | |
2532 ; movwf POSTINC2 | |
2533 ; call word_processor | |
2534 ; call PLED_decoplan_bargraph ; draws a box representing the decotime (stored in lo...) for this depth | |
2535 ; | |
2536 ; WIN_LEFT .100 | |
2537 ; movlw .075 | |
2538 ; movff WREG,win_top | |
2539 ; movwf hi ; copy for PLED_decoplan_bargraph | |
2540 ; call PLED_SetRow ; Set Row | |
2541 ; lfsr FSR2,letter | |
2542 ; movff char_O_array_decodepth+3,lo ; Get Depth | |
2543 ; movf lo,w | |
2544 ; btfsc STATUS,Z ; =0 | |
2545 ; goto PLED_decoplan_delete ; Yes, quit display | |
2546 ; output_8 ; outputs into Postinc2! | |
2547 ; movlw 'm' | |
2548 ; movwf POSTINC2 | |
2549 ; call word_processor | |
2550 ; WIN_LEFT .140 | |
2551 ; movlw .075 | |
2552 ; movff WREG,win_top | |
2553 ; lfsr FSR2,letter | |
2554 ; movff char_O_array_decotime+3,lo ; Get length for this stop | |
2555 ; output_99x ; outputs into Postinc2! | |
2556 ; movlw d'39' ;"'" | |
2557 ; movwf POSTINC2 | |
2558 ; call word_processor | |
2559 ; call PLED_decoplan_bargraph ; draws a box representing the decotime (stored in lo...) for this depth | |
2560 ; | |
2561 ; WIN_LEFT .100 | |
2562 ; movlw .100 | |
2563 ; movff WREG,win_top | |
2564 ; movwf hi ; copy for PLED_decoplan_bargraph | |
2565 ; call PLED_SetRow ; Set Row | |
2566 ; lfsr FSR2,letter | |
2567 ; movff char_O_array_decodepth+4,lo ; Get Depth | |
2568 ; movf lo,w | |
2569 ; btfsc STATUS,Z ; =0 | |
2570 ; goto PLED_decoplan_delete ; Yes, quit display | |
2571 ; output_8 ; outputs into Postinc2! | |
2572 ; movlw 'm' | |
2573 ; movwf POSTINC2 | |
2574 ; call word_processor | |
2575 ; WIN_LEFT .140 | |
2576 ; movlw .100 | |
2577 ; movff WREG,win_top | |
2578 ; lfsr FSR2,letter | |
2579 ; movff char_O_array_decotime+4,lo ; Get length for this stop | |
2580 ; output_99x ; outputs into Postinc2! | |
2581 ; movlw d'39' ;"'" | |
2582 ; movwf POSTINC2 | |
2583 ; call word_processor | |
2584 ; call PLED_decoplan_bargraph ; draws a box representing the decotime (stored in lo...) for this depth | |
2585 ; return | |
2586 ; | |
0 | 2587 PLED_gas_list: |
2588 ostc_debug 'm' ; Sends debug-information to screen if debugmode active | |
2589 | |
2590 WIN_LEFT .100 | |
2591 WIN_FONT FT_SMALL | |
2592 bsf leftbind | |
2593 | |
2594 movlw d'2' | |
2595 movwf wait_temp ; here: stores eeprom address for gas list | |
2596 movlw d'231' | |
2597 movwf waitms_temp ; here: stores row for gas list | |
2598 clrf hi ; here: Gas counter | |
2599 | |
2600 PLED_gas_list_loop: | |
2601 incf hi,F ; Increase Gas | |
2602 movlw d'4' | |
2603 addwf wait_temp,F ; Increase eeprom address for gas list | |
2604 movlw d'25' | |
2605 addwf waitms_temp,F ; Increase row | |
2606 WIN_LEFT .100 | |
2607 movff waitms_temp,win_top ; Set Row | |
2608 | |
2609 lfsr FSR2,letter | |
2610 movlw 'G' | |
2611 movwf POSTINC2 | |
2612 movff hi,lo ; copy gas number | |
2613 output_8 ; display gas number | |
2614 movlw ':' | |
2615 movwf POSTINC2 | |
2616 movff wait_temp, EEADR; Gas #hi: %O2 - Set address in internal EEPROM | |
2617 call read_eeprom ; get byte (stored in EEDATA) | |
2618 movff EEDATA,lo ; copy to lo | |
2619 output_8 ; outputs into Postinc2! | |
2620 movlw '/' | |
2621 movwf POSTINC2 | |
2622 incf EEADR,F ; Gas #hi: %He - Set address in internal EEPROM | |
2623 call read_eeprom ; get byte (stored in EEDATA) | |
2624 movff EEDATA,lo ; copy to lo | |
2625 output_8 ; outputs into Postinc2! | |
2626 | |
2627 | |
2628 read_int_eeprom d'27' ; read flag register | |
2629 movff hi,lo ; copy gas number | |
2630 PLED_gas_list_loop1: | |
2631 rrcf EEDATA ; roll flags into carry | |
2632 decfsz lo,F ; max. 5 times... | |
2633 bra PLED_gas_list_loop1 | |
19 | 2634 |
2635 movlw color_grey | |
0 | 2636 btfss STATUS,C ; test carry |
19 | 2637 call PLED_set_color ; grey out inactive gases! |
0 | 2638 |
2639 call word_processor | |
19 | 2640 call PLED_standard_color |
0 | 2641 |
2642 movlw d'5' ; list all five gases | |
2643 cpfseq hi ; All gases shown? | |
2644 bra PLED_gas_list_loop ; No | |
2645 | |
2646 return ; No, return (OC mode) | |
2647 | |
2648 PLED_splist_start: | |
2649 WIN_LEFT .100 | |
2650 WIN_FONT FT_SMALL | |
2651 bsf leftbind | |
2652 | |
2653 ; list three SP in Gaslist | |
2654 movlw d'35' ; 36 = current SP position in EEPROM | |
2655 movwf wait_temp ; here: stores eeprom address for gas list | |
2656 movlw d'231' | |
2657 movwf waitms_temp ; here: stores row for gas list | |
2658 clrf temp5 ; here: SP counter | |
2659 | |
2660 PLED_splist_loop: | |
2661 incf wait_temp,F ; EEPROM address | |
2662 incf temp5,F ; Increase SP | |
2663 | |
2664 movlw d'25' | |
2665 addwf waitms_temp,F ; Increase row | |
2666 movff waitms_temp,win_top ; Set Row | |
2667 WIN_LEFT .100 | |
2668 | |
2669 lfsr FSR2,letter | |
2670 movlw 'S' | |
2671 movwf POSTINC2 | |
2672 movlw 'P' | |
2673 movwf POSTINC2 | |
2674 movff temp5,lo ; copy gas number | |
2675 output_8 ; display gas number | |
2676 movlw ':' | |
2677 movwf POSTINC2 | |
2678 movff wait_temp, EEADR; SP #hi position | |
2679 call read_eeprom ; get byte (stored in EEDATA) | |
2680 movff EEDATA,lo ; copy to lo | |
2681 clrf hi | |
2682 output_16dp d'3' ; outputs into Postinc2! | |
2683 call word_processor | |
2684 | |
2685 movlw d'3' ; list all three SP | |
2686 cpfseq temp5 ; All gases shown? | |
2687 bra PLED_splist_loop ; No | |
2688 | |
2689 bcf leftbind | |
2690 return ; no, return | |
2691 | |
2692 PLED_clear_divemode_menu: | |
2693 movlw .0 | |
2694 movff WREG,box_temp+0 ; Data | |
2695 movlw .0 | |
2696 movff WREG,box_temp+1 ; row top (0-239) | |
30 | 2697 ; movlw .125 |
2698 movlw .185 | |
0 | 2699 movff WREG,box_temp+2 ; row bottom (0-239) |
2700 movlw .082 | |
2701 movff WREG,box_temp+3 ; column left (0-159) | |
2702 movlw .159 | |
2703 movff WREG,box_temp+4 ; column right (0-159) | |
2704 call PLED_box | |
2705 return | |
2706 | |
2707 PLED_divemenu_cursor: | |
2708 ostc_debug 'l' ; Sends debug-information to screen if debugmode active | |
2709 WIN_TOP .0 | |
2710 WIN_LEFT .85 | |
2711 WIN_FONT FT_SMALL | |
2712 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 2713 call PLED_standard_color |
0 | 2714 lfsr FSR2,letter |
2715 movlw 0xB8 | |
2716 movwf POSTINC2 | |
2717 call word_processor | |
2718 WIN_TOP .25 | |
2719 WIN_LEFT .85 | |
2720 WIN_FONT FT_SMALL | |
2721 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 2722 call PLED_standard_color |
0 | 2723 lfsr FSR2,letter |
2724 movlw 0xB8 | |
2725 movwf POSTINC2 | |
2726 call word_processor | |
2727 WIN_TOP .50 | |
2728 WIN_LEFT .85 | |
2729 WIN_FONT FT_SMALL | |
2730 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 2731 call PLED_standard_color |
0 | 2732 lfsr FSR2,letter |
2733 movlw 0xB8 | |
2734 movwf POSTINC2 | |
2735 call word_processor | |
2736 WIN_TOP .75 | |
2737 WIN_LEFT .85 | |
2738 WIN_FONT FT_SMALL | |
2739 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 2740 call PLED_standard_color |
0 | 2741 lfsr FSR2,letter |
2742 movlw 0xB8 | |
2743 movwf POSTINC2 | |
2744 call word_processor | |
2745 WIN_TOP .100 | |
2746 WIN_LEFT .85 | |
2747 WIN_FONT FT_SMALL | |
2748 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 2749 call PLED_standard_color |
0 | 2750 lfsr FSR2,letter |
2751 movlw 0xB8 | |
2752 movwf POSTINC2 | |
2753 call word_processor | |
2754 | |
2755 movff menupos,temp1 | |
2756 movlw d'0' | |
2757 dcfsnz temp1,F | |
2758 movlw d'0' | |
2759 dcfsnz temp1,F | |
2760 movlw d'25' | |
2761 dcfsnz temp1,F | |
2762 movlw d'50' | |
2763 dcfsnz temp1,F | |
2764 movlw d'75' | |
2765 dcfsnz temp1,F | |
2766 movlw d'100' | |
2767 movff WREG,win_top | |
2768 WIN_LEFT .85 | |
2769 WIN_FONT FT_SMALL | |
2770 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 2771 call PLED_standard_color |
2772 | |
0 | 2773 lfsr FSR2,letter |
2774 movlw 0xB7 ; Arrow for menu | |
2775 movwf POSTINC2 | |
2776 call word_processor | |
2777 return | |
2778 | |
33 | 2779 ;PLED_profileview_menu: |
2780 ; DISPLAYTEXT .127 ;"Exit" | |
2781 ; DISPLAYTEXT .128 ;"Delete" | |
2782 ;; DISPLAYTEXT .132 ;"Format" | |
2783 ; return | |
0 | 2784 |
2785 custom_warn_surfmode: | |
2786 movlw .0 | |
2787 movff WREG,box_temp+0 ; Data | |
2788 movlw .56 | |
2789 movff WREG,box_temp+1 ; row top (0-239) | |
2790 movlw .88 | |
2791 movff WREG,box_temp+2 ; row bottom (0-239) | |
2792 movlw .69 | |
2793 movff WREG,box_temp+3 ; column left (0-159) | |
2794 movlw .115 | |
2795 movff WREG,box_temp+4 ; column right (0-159) | |
2796 call PLED_box | |
2797 | |
9 | 2798 GETCUSTOM8 d'35' ; Standard output color |
0 | 2799 movff WREG,box_temp+0 ; Data |
2800 movlw .58 | |
2801 movff WREG,box_temp+1 ; row top (0-239) | |
2802 movlw .86 | |
2803 movff WREG,box_temp+2 ; row bottom (0-239) | |
2804 movlw .70 | |
2805 movff WREG,box_temp+3 ; column left (0-159) | |
2806 movlw .114 | |
2807 movff WREG,box_temp+4 ; column right (0-159) | |
2808 call PLED_frame | |
2809 ; warning text | |
2810 | |
2811 WIN_TOP .60 | |
2812 WIN_LEFT .71 | |
2813 WIN_FONT FT_SMALL | |
2814 WIN_INVERT .1 ; Init new Wordprocessor | |
9 | 2815 call PLED_divemask_color ; Set Color for Divemode mask |
0 | 2816 lfsr FSR2,letter |
2817 movlw 'C' | |
2818 movwf POSTINC2 | |
2819 movlw 'F' | |
2820 movwf POSTINC2 | |
2821 movff temp1,lo | |
2822 output_8 | |
2823 movlw '!' | |
2824 movwf POSTINC2 | |
2825 call word_processor | |
2826 | |
2827 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 2828 call PLED_standard_color |
0 | 2829 return |
2830 | |
2831 PLED_saturation_graph_divemode: | |
2832 ostc_debug 'h' ; Sends debug-information to screen if debugmode active | |
2833 PLED_tissue_saturation_graph: | |
2834 ostc_debug 'i' ; Sends debug-information to screen if debugmode active | |
13 | 2835 |
2836 ; Clear graph area... | |
2837 movlw .0 | |
2838 movff WREG,box_temp+0 ; Data | |
2839 movlw .25 | |
2840 movff WREG,box_temp+1 ; row top (0-239) | |
2841 movlw .120 | |
2842 movff WREG,box_temp+2 ; row bottom (0-239) | |
2843 movlw .82 | |
2844 movff WREG,box_temp+3 ; column left (0-159) | |
2845 movlw .159 | |
2846 movff WREG,box_temp+4 ; column right (0-159) | |
2847 call PLED_box | |
2848 | |
19 | 2849 ; Draw Frame |
9 | 2850 GETCUSTOM8 d'35' ; Standard output color |
0 | 2851 movff WREG,box_temp+0 ; Data |
2852 movlw .25 | |
2853 movff WREG,box_temp+1 ; row top (0-239) | |
2854 movlw .120 | |
2855 movff WREG,box_temp+2 ; row bottom (0-239) | |
2856 movlw .82 | |
2857 movff WREG,box_temp+3 ; column left (0-159) | |
2858 movlw .159 | |
2859 movff WREG,box_temp+4 ; column right (0-159) | |
2860 call PLED_frame | |
2861 | |
19 | 2862 ; Draw N2 Tissues |
0 | 2863 lfsr FSR2, char_O_tissue_saturation+.000 ; N2 |
2864 movlw d'16' | |
2865 movwf wait_temp ; 16 tissues | |
2866 clrf waitms_temp ; Row offset | |
2867 PLED_tissue_saturation_graph3: | |
9 | 2868 GETCUSTOM8 d'35' ; Standard output color |
0 | 2869 movff WREG,box_temp+0 ; Data |
2870 movlw .28 | |
2871 addwf waitms_temp,W | |
2872 movff WREG,box_temp+1 ; row top (0-239) | |
2873 movlw .28 | |
2874 addwf waitms_temp,W | |
2875 movff WREG,box_temp+2 ; row bottom (0-239) | |
2876 | |
2877 incf waitms_temp,F | |
2878 incf waitms_temp,F | |
2879 | |
2880 movlw .100 | |
2881 movff WREG,box_temp+3 ; column left (0-159) | |
2882 | |
2883 movff POSTINC2,box_temp+4 | |
2884 bcf STATUS,C | |
2885 rrcf box_temp+4,F | |
2886 bcf STATUS,C | |
2887 rrcf box_temp+4,F | |
2888 movlw .100 | |
2889 addwf box_temp+4,F ; column right (0-159) | |
2890 | |
2891 movlw d'157' ; limit display | |
2892 cpfslt box_temp+4 ; skip if 157 (WREG) < box_temp+4 | |
2893 movwf box_temp+4 | |
2894 | |
2895 call PLED_box | |
2896 | |
2897 decfsz wait_temp,F | |
2898 bra PLED_tissue_saturation_graph3 | |
2899 | |
19 | 2900 ; Draw He Tissues |
0 | 2901 lfsr FSR2, char_O_tissue_saturation+.016 ; He |
2902 movlw d'16' | |
2903 movwf wait_temp ; 16 tissues | |
2904 clrf waitms_temp ; Row offset | |
2905 PLED_tissue_saturation_graph2: | |
9 | 2906 GETCUSTOM8 d'35' ; Standard output color |
0 | 2907 movff WREG,box_temp+0 ; Data |
2908 movlw .86 | |
2909 addwf waitms_temp,W | |
2910 movff WREG,box_temp+1 ; row top (0-239) | |
2911 movlw .86 | |
2912 addwf waitms_temp,W | |
2913 movff WREG,box_temp+2 ; row bottom (0-239) | |
2914 | |
2915 incf waitms_temp,F | |
2916 incf waitms_temp,F | |
2917 | |
2918 movlw .100 | |
2919 movff WREG,box_temp+3 ; column left (0-159) | |
2920 | |
2921 movff POSTINC2,box_temp+4 | |
2922 bcf STATUS,C | |
2923 rrcf box_temp+4,F | |
2924 bcf STATUS,C | |
2925 rrcf box_temp+4,F | |
2926 movlw .100 | |
2927 addwf box_temp+4,F ; column right (0-159) | |
2928 | |
2929 movlw d'157' ; limit display | |
2930 cpfslt box_temp+4 ; skip if 157 (WREG) < box_temp+4 | |
2931 movwf box_temp+4 | |
2932 | |
2933 call PLED_box | |
2934 | |
2935 decfsz wait_temp,F | |
2936 bra PLED_tissue_saturation_graph2 | |
2937 | |
19 | 2938 ; Draw Text |
0 | 2939 WIN_LEFT .84 |
2940 WIN_TOP .32 | |
3 | 2941 call PLED_standard_color |
0 | 2942 lfsr FSR2,letter |
2943 movlw 'N' | |
2944 movwf POSTINC2 | |
2945 movlw '2' | |
2946 movwf POSTINC2 | |
2947 call word_processor | |
2948 WIN_LEFT .84 | |
2949 WIN_TOP .90 | |
3 | 2950 call PLED_standard_color |
0 | 2951 lfsr FSR2,letter |
2952 movlw 'H' | |
2953 movwf POSTINC2 | |
2954 movlw 'e' | |
2955 movwf POSTINC2 | |
2956 call word_processor | |
19 | 2957 |
2958 movff char_O_gtissue_no,wait_temp ; used as temp | |
2959 | |
2960 lfsr FSR2,letter | |
2961 lfsr FSR1,char_O_tissue_saturation+0 | |
2962 incf wait_temp,F ; make 1-16 of 0-15 | |
2963 PLED_tissue_saturation_graph4: ; point to leading tissue... | |
2964 movff POSTINC1,lo ; copy/overwrite to lo register | |
2965 decfsz wait_temp,F ; count until zero | |
2966 bra PLED_tissue_saturation_graph4 ;loop | |
2967 output_8 | |
2968 movlw '%' | |
2969 movwf POSTINC2 | |
2970 movlw ' ' | |
2971 movwf POSTINC2 | |
2972 WIN_LEFT .84 | |
2973 WIN_TOP .62 | |
2974 WIN_FONT FT_SMALL | |
2975 call PLED_standard_color | |
2976 call word_processor | |
2977 bcf leftbind | |
2978 | |
2979 ; Draw Scale | |
2980 GETCUSTOM8 d'35' ; Standard output color | |
2981 movff WREG,box_temp+0 ; Data | |
2982 movlw .73 | |
2983 movff WREG,box_temp+1 ; row top (0-239) | |
2984 movlw .74 | |
2985 movff WREG,box_temp+2 ; row bottom (0-239) | |
2986 movlw .121 | |
2987 movff WREG,box_temp+3 ; column left (0-159) | |
2988 movlw .157 | |
2989 movff WREG,box_temp+4 ; column right (0-159) | |
2990 call PLED_frame | |
2991 | |
2992 GETCUSTOM8 d'35' ; Standard output color | |
2993 movff WREG,box_temp+0 ; Data | |
2994 movlw .61 | |
2995 movff WREG,box_temp+1 ; row top (0-239) | |
2996 movlw .84 | |
2997 movff WREG,box_temp+2 ; row bottom (0-239) | |
2998 movlw .121 | |
2999 movff WREG,box_temp+3 ; column left (0-159) | |
3000 movlw .122 | |
3001 movff WREG,box_temp+4 ; column right (0-159) | |
3002 call PLED_box | |
3003 GETCUSTOM8 d'35' ; Standard output color | |
3004 movff WREG,box_temp+0 ; Data | |
3005 movlw .65 | |
3006 movff WREG,box_temp+1 ; row top (0-239) | |
3007 movlw .80 | |
3008 movff WREG,box_temp+2 ; row bottom (0-239) | |
3009 movlw .121+.9 | |
3010 movff WREG,box_temp+3 ; column left (0-159) | |
3011 movlw .122+.9 | |
3012 movff WREG,box_temp+4 ; column right (0-159) | |
3013 call PLED_box | |
3014 GETCUSTOM8 d'35' ; Standard output color | |
3015 movff WREG,box_temp+0 ; Data | |
3016 movlw .65 | |
3017 movff WREG,box_temp+1 ; row top (0-239) | |
3018 movlw .80 | |
3019 movff WREG,box_temp+2 ; row bottom (0-239) | |
3020 movlw .121+.18 | |
3021 movff WREG,box_temp+3 ; column left (0-159) | |
3022 movlw .122+.18 | |
3023 movff WREG,box_temp+4 ; column right (0-159) | |
3024 call PLED_box | |
3025 GETCUSTOM8 d'35' ; Standard output color | |
3026 movff WREG,box_temp+0 ; Data | |
3027 movlw .65 | |
3028 movff WREG,box_temp+1 ; row top (0-239) | |
3029 movlw .80 | |
3030 movff WREG,box_temp+2 ; row bottom (0-239) | |
3031 movlw .121+.27 | |
3032 movff WREG,box_temp+3 ; column left (0-159) | |
3033 movlw .122+.27 | |
3034 movff WREG,box_temp+4 ; column right (0-159) | |
3035 call PLED_box | |
3036 GETCUSTOM8 d'35' ; Standard output color | |
3037 movff WREG,box_temp+0 ; Data | |
3038 movlw .61 | |
3039 movff WREG,box_temp+1 ; row top (0-239) | |
3040 movlw .84 | |
3041 movff WREG,box_temp+2 ; row bottom (0-239) | |
3042 movlw .121+.36 | |
3043 movff WREG,box_temp+3 ; column left (0-159) | |
3044 movlw .122+.36 | |
3045 movff WREG,box_temp+4 ; column right (0-159) | |
3046 call PLED_box | |
3047 | |
0 | 3048 return |
3049 | |
3050 | |
3051 PLED_startupscreen1: | |
3052 call PLED_topline_box | |
3053 WIN_INVERT .1 ; Init new Wordprocessor | |
3054 DISPLAYTEXT d'3' ; "HeinrichsWeikamp" | |
3055 WIN_INVERT .0 ; Init new Wordprocessor | |
3056 DISPLAYTEXT .68 ; Licence 1/2 | |
3057 DISPLAYTEXT .69 | |
3058 DISPLAYTEXT .70 | |
3059 DISPLAYTEXT .71 | |
3060 DISPLAYTEXT .72 | |
3061 DISPLAYTEXT .73 | |
3062 DISPLAYTEXT .74 | |
3063 return | |
3064 | |
3065 PLED_startupscreen2: | |
3066 call PLED_topline_box | |
3067 WIN_INVERT .1 ; Init new Wordprocessor | |
3068 DISPLAYTEXT d'3' ; "HeinrichsWeikamp" | |
3069 WIN_INVERT .0 ; Init new Wordprocessor | |
3070 DISPLAYTEXT .75 ; Licence 2/2 | |
3071 DISPLAYTEXT .76 | |
3072 DISPLAYTEXT .77 | |
3073 DISPLAYTEXT .78 | |
3074 DISPLAYTEXT .79 | |
3075 DISPLAYTEXT .80 | |
3076 DISPLAYTEXT .81 | |
3077 return | |
3078 | |
3079 PLED_new_cf_warning: | |
3080 call PLED_topline_box | |
3081 WIN_INVERT .1 ; Init new Wordprocessor | |
3082 DISPLAYTEXTH .271 ; New CF added! | |
3083 WIN_INVERT .0 ; Init new Wordprocessor | |
3084 DISPLAYTEXTH .272 ; New CustomFunctions | |
3085 DISPLAYTEXTH .273 ; were added! Check | |
3086 DISPLAYTEXTH .274 ; CF I and CF II Menu | |
3087 DISPLAYTEXTH .275 ; for Details! | |
3088 return | |
3089 | |
3090 PLED_const_ppO2_value: | |
3091 btfsc multi_gf_display ; Is the Multi-GF Table displayed? | |
3092 return ; Yes, No update and return! | |
3093 | |
3094 ostc_debug 'j' ; Sends debug-information to screen if debugmode active | |
3095 | |
3096 WIN_TOP .168 | |
3097 WIN_LEFT .65 | |
3098 WIN_FONT FT_SMALL | |
3099 WIN_INVERT .0 ; Init new Wordprocessor | |
4 | 3100 |
0 | 3101 lfsr FSR2,letter |
3102 movff char_I_const_ppO2,lo | |
3103 | |
3104 tstfsz lo ; In Bailout mode (char_I_const_ppO2=0)? | |
3105 bra PLED_const_ppO2_value2 ; No, display Setpoint | |
3106 | |
3107 ; Yes, Display "Bail" | |
27
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
3108 call PLED_standard_color |
0 | 3109 OUTPUTTEXTH d'263' ;"Bail" |
3110 call word_processor | |
3111 return | |
3112 | |
3113 PLED_const_ppO2_value2: ; Display SetPoint | |
3114 ;Show fixed SP value | |
4 | 3115 movff amb_pressure+0,xA+0 |
3116 movff amb_pressure+1,xA+1 | |
3117 movlw d'10' | |
3118 movwf xB+0 | |
3119 clrf xB+1 | |
3120 ;xA/xB=xC with xA as remainder | |
3121 call div16x16 ; xC+0=p_amb/10 | |
26 | 3122 |
4 | 3123 ; char_I_const_ppO2 > p_amb/10 -> Not physically possible! -> Display actual value! |
3124 tstfsz xC+1 ; xC>255 | |
3125 setf xC+0 ; Yes, set xC+0 to 2,55bar ppO2 | |
26 | 3126 |
4 | 3127 movff ppO2_setpoint_store,WREG |
3128 cpfslt xC+0 ; Setpoint value possible? | |
26 | 3129 bra PLED_const_ppO2_value1 ; Yes |
4 | 3130 |
3131 movff xC+0,char_I_const_ppO2 ; No, Overwrite with actual value | |
3132 bra PLED_const_ppO2_value1a | |
3133 | |
3134 PLED_const_ppO2_value1: | |
26 | 3135 ; char_I_const_ppO2 < ppO2[Diluent] -> Not physically possible! -> Display actual value! |
3136 movff amb_pressure+0,xA+0 | |
3137 movff amb_pressure+1,xA+1 | |
3138 movlw d'10' | |
3139 movwf xB+0 | |
3140 clrf xB+1 | |
3141 call div16x16 ; xC=p_amb/10 | |
3142 movff xC+0,xA+0 | |
3143 movff xC+1,xA+1 | |
3144 movff char_I_O2_ratio,xB+0 | |
3145 clrf xB+1 | |
3146 call mult16x16 ; xC:2=char_I_O2_ratio * p_amb/10 | |
3147 | |
3148 movff xC+0,sub_b+0 | |
3149 movff xC+1,sub_b+1 | |
3150 movff ppO2_setpoint_store,WREG; Setpoint | |
3151 mullw d'100' ; Setpoint*100 | |
3152 movff PRODL,sub_a+0 | |
3153 movff PRODH,sub_a+1 | |
3154 call sub16 ; sub_c = sub_a - sub_b | |
3155 | |
3156 btfss neg_flag | |
3157 bra PLED_const_ppO2_value11 ; Value in range | |
3158 | |
3159 ; char_I_const_ppO2 < ppO2[Diluent] -> Not physically possible! -> Display actual value! | |
3160 | |
3161 movff xC+0,xA+0 | |
3162 movff xC+1,xA+1 | |
3163 movlw d'100' | |
3164 movwf xB+0 | |
3165 clrf xB+1 | |
3166 call div16x16 ;xA/xB=xC with xA as remainder | |
3167 | |
3168 movff xC+0,char_I_const_ppO2 ; No, Overwrite with actual value | |
3169 bra PLED_const_ppO2_value1a | |
3170 | |
3171 PLED_const_ppO2_value11: | |
3172 | |
3173 ; Setpoint in possible limits | |
4 | 3174 movff ppO2_setpoint_store,char_I_const_ppO2 ; Restore Setpoint |
3175 | |
3176 PLED_const_ppO2_value1a: | |
27
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
3177 PLED_color_code warn_ppo2 ; Color-code output |
4 | 3178 movff char_I_const_ppO2,lo |
0 | 3179 clrf hi |
3180 bsf leftbind | |
3181 output_16dp d'3' | |
3182 bcf leftbind | |
3183 call word_processor | |
27
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
3184 call PLED_standard_color |
0 | 3185 return |
3186 | |
3187 PLED_show_leading_tissue: | |
3188 call deco_main_calc_desaturation_time ; calculate desaturation time | |
3189 movlb b'00000001' ; select ram bank 1 | |
3190 | |
3191 DISPLAYTEXTH .282 ; L. Tissue: | |
3192 lfsr FSR2,letter | |
3193 movlw '#' | |
3194 movwf POSTINC2 | |
3195 movff char_O_gtissue_no,lo | |
3196 movff char_O_gtissue_no,wait_temp ; used as temp | |
3197 bsf leftbind | |
3198 output_8 | |
3199 movlw ' ' | |
3200 movwf POSTINC2 | |
3201 movlw '(' | |
3202 movwf POSTINC2 | |
3203 | |
3204 movlw d'16' | |
3205 cpfslt wait_temp | |
3206 bra PLED_show_leading_tissue_he | |
3207 movlw 'N' | |
3208 movwf POSTINC2 | |
3209 movlw '2' | |
3210 movwf POSTINC2 | |
3211 bra PLED_show_leading_tissue2 | |
3212 PLED_show_leading_tissue_he: | |
3213 movlw 'H' | |
3214 movwf POSTINC2 | |
3215 movlw 'e' | |
3216 movwf POSTINC2 | |
3217 PLED_show_leading_tissue2: | |
3218 movlw ')' | |
3219 movwf POSTINC2 | |
3220 movlw ' ' | |
3221 movwf POSTINC2 | |
3222 WIN_LEFT .100 | |
3223 WIN_TOP .25 | |
3224 WIN_FONT FT_SMALL | |
3 | 3225 call PLED_standard_color |
0 | 3226 call word_processor |
3227 | |
3228 lfsr FSR2,letter | |
3229 lfsr FSR1,char_O_tissue_saturation+0 | |
3230 incf wait_temp,F ; make 1-16 of 0-15 | |
3231 PLED_show_leading_tissue3: ; point to leading tissue... | |
3232 movff POSTINC1,lo ; copy/overwrite to lo register | |
3233 decfsz wait_temp,F ; count until zero | |
3234 bra PLED_show_leading_tissue3 ;loop | |
3235 output_8 | |
3236 movlw '%' | |
3237 movwf POSTINC2 | |
3238 movlw ' ' | |
3239 movwf POSTINC2 | |
3240 WIN_LEFT .100 | |
3241 WIN_TOP .50 | |
3242 WIN_FONT FT_SMALL | |
3 | 3243 call PLED_standard_color |
0 | 3244 call word_processor |
3245 bcf leftbind | |
3246 return | |
3247 | |
3248 PLED_topline_box_clear: ; Writes an empty box | |
3249 movlw .0 | |
3250 bra PLED_topline_box2 | |
3251 PLED_topline_box: ; Writes a filled box | |
3 | 3252 GETCUSTOM8 d'35' |
0 | 3253 PLED_topline_box2: |
3254 movff WREG,box_temp+0 ; Data | |
3255 movlw .000 | |
3256 movff WREG,box_temp+1 ; row top (0-239) | |
3257 movlw .026 | |
3258 movff WREG,box_temp+2 ; row bottom (0-239) | |
3259 movlw .000 | |
3260 movff WREG,box_temp+3 ; column left (0-159) | |
3261 movlw .159 | |
3262 movff WREG,box_temp+4 ; column right (0-159) | |
3263 call PLED_box | |
3264 return | |
3265 | |
3266 PLED_display_cns: | |
3267 btfsc multi_gf_display ; Is the Multi-GF Table displayed? | |
3268 return ; Yes, No update and return! | |
3269 | |
3270 btfsc gauge_mode ; Do not display in gauge mode | |
3271 return | |
3272 | |
3273 btfsc FLAG_apnoe_mode ; Do not display in apnoe mode | |
3274 return | |
3275 | |
3276 btfsc pled_velocity_display ; Is velocity displayed?` | |
3277 return ; Yes, do not overwrite until pled_velocity_clear was called | |
3278 | |
3279 ostc_debug 'k' ; Sends debug-information to screen if debugmode active | |
3280 | |
3281 WIN_TOP .090 | |
3282 WIN_LEFT .0 | |
3283 WIN_FONT FT_SMALL | |
27
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
3284 PLED_color_code warn_cns ; Color-code CNS output |
0 | 3285 |
3286 lfsr FSR2,letter | |
3287 movlw 'C' | |
3288 movwf POSTINC2 | |
3289 movlw 'N' | |
3290 movwf POSTINC2 | |
3291 movlw 'S' | |
3292 movwf POSTINC2 | |
3293 movlw ':' | |
3294 movwf POSTINC2 | |
3295 movff char_O_CNS_fraction,lo | |
3296 bsf leftbind | |
3297 output_8 | |
3298 bcf leftbind | |
3299 movlw '%' | |
3300 movwf POSTINC2 | |
3301 call word_processor | |
3302 return | |
3303 | |
3304 PLED_custom_text: | |
3305 read_int_eeprom d'64' | |
3306 movlw d'1' | |
3307 cpfseq EEDATA ; Custom text active? | |
3308 bra PLED_clear_custom_text ; No, Delete row | |
3309 WIN_TOP .200 | |
3310 WIN_LEFT .0 | |
3311 WIN_FONT FT_SMALL | |
3312 WIN_INVERT .0 ; Init new Wordprocessor | |
9 | 3313 call PLED_divemask_color ; Set Color for Divemode mask |
0 | 3314 |
3315 lfsr FSR2,letter | |
3316 movlw d'64' | |
3317 movwf lo | |
3318 movlw d'24' | |
3319 movwf hi ; counter | |
3320 | |
3321 PLED_custom_text1: | |
3322 incf lo,F | |
3323 call PLED_get_custom_letter ; Get one letter for the custom text | |
3324 movlw '}' ; End marker found? | |
3325 cpfseq EEDATA | |
3326 bra PLED_custom_text2 ; No | |
3327 bra PLED_custom_text3 | |
3328 PLED_custom_text2: | |
3329 movff EEDATA,POSTINC2 ; Copy into Postinc | |
3330 | |
3331 decfsz hi,F ; Max. numbers? | |
3332 bra PLED_custom_text1 ; No, get next letters | |
3333 | |
3334 PLED_custom_text3: | |
3335 call word_processor | |
3 | 3336 call PLED_standard_color |
0 | 3337 return |
3338 | |
3339 PLED_get_custom_letter: | |
3340 movff lo,EEADR ; Address for next custom text letter | |
3341 call read_eeprom ; Read letter | |
3342 return | |
3343 | |
3344 PLED_clear_custom_text: | |
3345 movlw d'24' | |
3346 movwf temp1 | |
3347 WIN_TOP .200 | |
3348 WIN_LEFT .0 | |
3349 call PLED_display_clear_common_y1 | |
3350 return | |
3351 | |
3352 | |
3353 ;PLED_const_ppO2_DEBUG: | |
3354 ; movlw .007 | |
3355 ; call PLED_SetColumn | |
3356 ; movlw .032 | |
3357 ; call PLED_SetRow | |
3358 ; lfsr FSR2,letter | |
3359 ; movff char_O_diluent,lo | |
3360 ; output_8 | |
3361 ; movlw .001 | |
3362 ; movwf scaleY | |
3363 ; call word_processor | |
3364 ; movlw .007 | |
3365 ; call PLED_SetColumn | |
3366 ; movlw .024 | |
3367 ; call PLED_SetRow | |
3368 ; lfsr FSR2,letter | |
3369 ; movff last_diluent,lo | |
3370 ; output_8 | |
3371 ; movlw .001 | |
3372 ; movwf scaleY | |
3373 ; call word_processor | |
3374 ; movlw .007 | |
3375 ; call PLED_SetColumn | |
3376 ; movlw .016 | |
3377 ; call PLED_SetRow | |
3378 ; lfsr FSR2,letter | |
3379 ; movff char_O_deco_status,lo | |
3380 ; output_8 | |
3381 ; movlw .001 | |
3382 ; movwf scaleY | |
3383 ; call word_processor | |
3384 ; return | |
3385 ; | |
3386 | |
25 | 3387 PLED_gaschange_DEBUG: |
3388 WIN_LEFT .0 | |
3389 WIN_TOP .160 | |
3390 lfsr FSR2,letter | |
3391 movff char_I_deco_He_ratio,lo | |
3392 output_8 | |
3393 call word_processor | |
3394 | |
3395 WIN_LEFT .25 | |
3396 WIN_TOP .160 | |
3397 call PLED_SetRow | |
3398 lfsr FSR2,letter | |
3399 movff char_I_deco_N2_ratio,lo | |
3400 output_8 | |
3401 call word_processor | |
3402 | |
3403 WIN_LEFT .50 | |
3404 WIN_TOP .160 | |
3405 lfsr FSR2,letter | |
3406 movff char_I_deco_gas_change,lo | |
3407 output_8 | |
3408 call word_processor | |
3409 | |
3410 WIN_LEFT .75 | |
3411 WIN_TOP .160 | |
3412 lfsr FSR2,letter | |
3413 movff hi,lo | |
3414 output_8 | |
3415 call word_processor | |
3416 return | |
0 | 3417 |
3418 | |
3419 PLED_MultiGF_deco_mask: | |
30 | 3420 movlw .0 |
3421 movff WREG,box_temp+0 ; Data | |
3422 movlw .0 | |
3423 movff WREG,box_temp+1 ; row top (0-239) | |
3424 movlw .239 | |
3425 movff WREG,box_temp+2 ; row bottom (0-239) | |
3426 movlw .082 | |
3427 movff WREG,box_temp+3 ; column left (0-159) | |
3428 movlw .159 | |
3429 movff WREG,box_temp+4 ; column right (0-159) | |
3430 call PLED_box | |
3431 return | |
0 | 3432 |
3433 PLED_MultiGF_deco_all: | |
30 | 3434 movff char_O_actual_pointer,wait_temp |
3435 movff char_O_GF_low_pointer,waitms_temp | |
3436 movf waitms_temp,F | |
3437 bz PLED_MultiGF_no_deco | |
3438 call PLED_MultiGF_table ; input wait_temp | |
3439 return | |
3440 | |
3441 PLED_MultiGF_no_deco: | |
3442 DISPLAYTEXT d'242' ;"no deco" | |
3443 return | |
3444 | |
3445 PLED_MultiGF_table: | |
3446 movlw d'9' | |
3447 movwf temp5 ; number of stops | |
3448 movlw .231 | |
3449 movwf temp6 ; row | |
3450 lfsr FSR1,char_IO_deco_table+0 | |
3451 | |
3452 PLED_MultiGF_table2: | |
3453 movlw d'25' | |
3454 addwf temp6,F | |
3455 call PLED_MultiGF_show_stop | |
3456 decfsz temp5,F | |
3457 bra PLED_MultiGF_table2 | |
3458 return | |
3459 | |
3460 PLED_MultiGF_show_stop: | |
3461 bsf leftbind | |
3462 WIN_LEFT .100 | |
3463 movff temp6,win_top | |
3464 movff temp6,hi ; copy for PLED_decoplan_bargraph | |
3465 ; call PLED_SetRow ; Set Row | |
3466 | |
3467 | |
3468 movff POSTINC1,lo ; Get Depth | |
3469 movf lo,w | |
3470 | |
3471 lfsr FSR2,letter | |
3472 ; btfsc STATUS,Z ; =0 | |
3473 ; goto PLED_decoplan_delete ; Yes, quit display | |
3474 output_8 ; outputs into Postinc2! | |
3475 movlw 'm' | |
3476 movwf POSTINC2 | |
3477 call word_processor | |
3478 WIN_LEFT .140 | |
3479 movff temp6,win_top | |
3480 | |
3481 movff POSTINC1,lo ; Get length for this stop | |
3482 | |
3483 lfsr FSR2,letter | |
3484 output_99x ; outputs into Postinc2! | |
3485 movlw d'39' ;"'" | |
3486 movwf POSTINC2 | |
3487 call word_processor | |
3488 ; call PLED_decoplan_bargraph ; draws a box representing the decotime (stored in lo...) for this depth | |
3489 return | |
3490 | |
3491 | |
3492 | |
0 | 3493 ; movlw .043 |
3494 ; movwf temp5 | |
3495 ; movlw .48 + .8 | |
3496 ; movwf temp6 | |
3497 ; movff char_O_GF_low_pointer,wait_temp | |
30 | 3498 ; |
0 | 3499 ;PLED_MultiGF_loop: |
3500 ; decfsz wait_temp,F | |
3501 ; bra PLED_MulitGF_nextentry | |
3502 ; | |
30 | 3503 ; bra PLED_MultiGF_calc_tissue_counter |
3504 ;PLED_MGF_lp_calc_tis_counter: | |
0 | 3505 ; |
3506 ;PLED_MGF_lp_clear_rem_space: | |
3507 ; lfsr FSR2,letter | |
3508 ; movlw ' ' | |
3509 ; movwf POSTINC2 | |
3510 ; movlw ' ' | |
3511 ; movwf POSTINC2 | |
3512 ; movlw ' ' | |
3513 ; movwf POSTINC2 | |
3514 ; movlw ' ' | |
3515 ; movwf POSTINC2 | |
3516 ; movlw ' ' | |
3517 ; movwf POSTINC2 | |
3518 ; movlw ' ' | |
3519 ; movwf POSTINC2 | |
3520 ; movlw .8 | |
3521 ; subwf temp6,F | |
3522 ; bnz PLED_MultiGF_column_ok_space | |
3523 ; movlw .21 | |
3524 ; subwf temp5,F | |
3525 ; bc PLED_MultiGF_new_row_space | |
3526 ; return | |
3527 ;PLED_MultiGF_new_row_space: | |
3528 ; movlw .48 | |
3529 ; movwf temp6 | |
3530 ;PLED_MultiGF_column_ok_space: | |
3531 ; movf temp5,W | |
3532 ; call PLED_SetColumn | |
3533 ; movlw .8 | |
3534 ; subwf temp6,W | |
3535 ; call PLED_SetRow | |
3536 ; call word_processor | |
3537 ; bra PLED_MGF_lp_clear_rem_space | |
3538 ; | |
3539 ;PLED_MulitGF_nextentry: | |
3540 ; lfsr FSR2,letter | |
3541 ; movff wait_temp,lo ; pointer to meter | |
3542 ; movf lo,W | |
3543 ; rlncf lo,F | |
3544 ; addwf lo,F | |
3545 ; decfsz wait_temp,W | |
3546 ; bra PLED_MGF_skip_last_deco2 | |
3547 ; movff char_I_depth_last_deco,lo | |
3548 ;PLED_MGF_skip_last_deco2: | |
3549 ; output_99 | |
3550 ; movlw 0x02 | |
3551 ; movwf POSTINC2 | |
3552 ; movlw ':' | |
3553 ; movwf POSTINC2 | |
3554 ; movlw 0x02 | |
3555 ; movwf POSTINC2 | |
3556 ; lfsr FSR0,0x250 | |
3557 ; movf wait_temp,W | |
3558 ; movff PLUSW0,lo | |
3559 ; movlw d'10' ; gray code | |
3560 ; tstfsz lo | |
3561 ; movlw b'00001111' ; gray code | |
3562 ; movwf grayvalue | |
3563 ; bsf leftbind | |
3564 ; output_99 | |
3565 ; bcf leftbind | |
3566 ; movlw ' ' | |
3567 ; movwf POSTINC2 | |
3568 ; movlw .8 | |
3569 ; subwf temp6,F | |
3570 ; bnz PLED_MultiGF_column_ok | |
3571 ; movlw .21 | |
3572 ; subwf temp5,F | |
3573 ; bc PLED_MultiGF_new_row | |
3574 ; return | |
3575 ;PLED_MultiGF_new_row: | |
3576 ; movlw .48 | |
3577 ; movwf temp6 | |
3578 ;PLED_MultiGF_column_ok: | |
3579 ; movf temp5,W | |
3580 ; call PLED_SetColumn | |
3581 ; movlw .8 | |
3582 ; subwf temp6,W | |
3583 ; call PLED_SetRow | |
3584 ; call word_processor | |
3585 ; movlw b'00001111' ; gray code | |
3586 ; movwf grayvalue | |
3587 ; bra PLED_MultiGF_loop | |
3588 ; | |
3589 ; | |
3590 ;PLED_MultiGF_depth: | |
3591 ; lfsr FSR2,letter | |
3592 ; movff rel_pressure+0,lo | |
3593 ; movff rel_pressure+1,hi | |
3594 ; call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mBar] | |
3595 ; bsf leftbind | |
3596 ; bsf ignore_digit5 ; do not display 1cm depth | |
3597 ; output_16dp d'3' | |
3598 ; bcf leftbind | |
3599 ; movlw .004 | |
3600 ; movwf wait_temp | |
3601 ; movff wait_temp,0x086 ; left | |
3602 ; movlw .049 | |
3603 ; movwf wait_temp | |
3604 ; movff wait_temp,0x087 ; top | |
3605 ; movlw .015 | |
3606 ; movwf wait_temp | |
3607 ; movff wait_temp,0x088 ; heightmax | |
3608 ; movff dd_oled_brightness_offset,wait_temp | |
3609 ; movff wait_temp,0x089 ; oled_brightness_offset_const | |
3610 ; call main_DD2_write_incon24 | |
3611 ; movlb b'00000001' ; Back to Bank1 | |
3612 ; return | |
3613 ; | |
3614 ;PLED_MultiGF_deco_depth_actual: | |
3615 ; lfsr FSR2,letter | |
3616 ; movff char_O_actual_pointer,lo ; pointer to meter | |
3617 ; movf lo,W | |
3618 ; rlncf lo,F | |
3619 ; addwf lo,F | |
3620 ; movff char_O_actual_pointer,wait_temp ; test last_deco | |
3621 ; decfsz wait_temp,F | |
3622 ; bra PLED_MGF_skip_last_deco_depth | |
3623 ; movff char_I_depth_last_deco,lo | |
3624 ;PLED_MGF_skip_last_deco_depth: | |
3625 ; output_99 | |
3626 ; movlw 'm' | |
3627 ; movwf POSTINC2 | |
3628 ; movlw ' ' | |
3629 ; movwf POSTINC2 | |
3630 ; movlw .23 | |
3631 ; call PLED_SetColumn | |
3632 ; movlw .57 | |
3633 ; call PLED_SetRow | |
3634 ; goto word_processor | |
3635 ; | |
3636 ;PLED_MultiGF_gradient: | |
3637 ; lfsr FSR2,letter | |
3638 ; movff char_O_gradient_factor,lo | |
3639 ; bsf leftbind | |
3640 ; output_99 | |
3641 ; bcf leftbind | |
3642 ; movlw '%' | |
3643 ; movwf POSTINC2 | |
3644 ; movlw ' ' | |
3645 ; movwf POSTINC2 | |
3646 ; movlw .23 | |
3647 ; call PLED_SetColumn | |
3648 ; movlw .49 | |
3649 ; call PLED_SetRow | |
3650 ; goto word_processor | |
3651 ; | |
3652 ;PLED_MultiGF_time_at_deco: | |
3653 ; movlw .045 | |
3654 ; movwf wait_temp | |
3655 ; movff wait_temp,0x086 ; left | |
3656 ; movlw .050 | |
3657 ; movwf wait_temp | |
3658 ; movff wait_temp,0x087 ; top | |
3659 ; movlw .015 | |
3660 ; movwf wait_temp | |
3661 ; movff wait_temp,0x088 ; heightmax | |
3662 ; movff dd_oled_brightness_offset,wait_temp | |
3663 ; movff wait_temp,0x089 ; oled_brightness_offset_const | |
3664 ; lfsr FSR2,letter | |
3665 ; lfsr FSR0,0x250 | |
3666 ; movff char_O_actual_pointer,lo | |
3667 ; movf lo,W | |
3668 ; movff PLUSW0,lo | |
3669 ; bsf leftbind | |
3670 ; output_99 | |
3671 ; movlw '<' ; Textmapping to "'"! | |
3672 ; movwf POSTINC2 | |
3673 ; call main_DD2_write_incon24 | |
3674 ; movlb b'00000001' ; Back to Bank1 | |
3675 ; return | |
3676 ; | |
3677 ;PLED_MultiGF_clear_behind_depth: | |
3678 ; movlw 0x01 | |
3679 ; movwf wait_temp | |
3680 ; movff wait_temp,width ; font select left side before decpoint | |
3681 ; movff wait_temp,box_temp+5 ; font select right side decpoint and after | |
3682 ; movlw .063 | |
3683 ; movwf wait_temp | |
3684 ; movff wait_temp,box_temp+1 ; bottom row | |
3685 ; movlw .020 | |
3686 ; movwf wait_temp | |
3687 ; movff wait_temp,box_temp+2 ; start column | |
3688 ; movlw .063 | |
3689 ; movwf wait_temp | |
3690 ; movff wait_temp,box_temp+3 ; end column | |
3691 ; movlw .051 | |
3692 ; movwf wait_temp | |
3693 ; movff wait_temp,box_temp+4 ; start column dec point | |
3694 ; lfsr FSR2,letter | |
3695 ;; call DD_Main | |
3696 ; return | |
3697 ;; movlw 0x31 | |
3698 ; movwf wait_temp | |
3699 ; movff wait_temp,box_temp+1 ; row | |
3700 ; movlw 0x00 | |
3701 ; movwf wait_temp | |
3702 ; movff wait_temp,box_temp+0 ; color | |
3703 ; call DD_hline | |
3704 ; return | |
3705 ; | |
3706 | |
3707 ;PLED_MulitGF_nextentry_tissues: | |
3708 ; lfsr FSR2,letter | |
3709 ; lfsr FSR0,0x200 | |
3710 ; rlncf wait_temp,W | |
3711 ; movff PLUSW0,lo | |
3712 ; addlw .001 | |
3713 ; movff PLUSW0,hi | |
3714 ; output_16 | |
3715 ; movlw ' ' | |
3716 ; movwf POSTINC2 | |
3717 ; movlw .8 | |
3718 ; subwf temp6,F | |
3719 ; bnz PLED_MultiGF_column_ok_tissues | |
3720 ; movlw b'00001111' ; gray code | |
3721 ; movwf grayvalue | |
3722 ; movlw .21 | |
3723 ; subwf temp5,F | |
3724 ; bc PLED_MultiGF_new_row_tissues | |
3725 ; return | |
3726 ;PLED_MultiGF_new_row_tissues: | |
3727 ; movlw .48 | |
3728 ; movwf temp6 | |
3729 ;PLED_MultiGF_column_ok_tissues: | |
3730 ; movf temp5,W | |
3731 ; call PLED_SetColumn | |
3732 ; movlw .8 | |
3733 ; subwf temp6,W | |
3734 ; call PLED_SetRow | |
3735 ; call word_processor | |
3736 ; bra PLED_MultiGF_loop_tissues | |
3737 ; | |
3738 | |
3739 ;PLED_MultiGF_uart_out: | |
3740 ; call rs232_wait_tx | |
3741 ;; header ff ff | |
3742 ; movlw 0xff | |
3743 ; movwf wait_temp | |
3744 ; movff wait_temp,TXREG | |
3745 ; call rs232_wait_tx | |
3746 ; movff wait_temp,TXREG | |
3747 ; call rs232_wait_tx | |
3748 ;; 2sec counter | |
3749 ; movff 0x290,TXREG | |
3750 ; call rs232_wait_tx | |
3751 ; movff 0x291,TXREG | |
3752 ; call rs232_wait_tx | |
3753 ;; movff ,TXREG | |
3754 ;; pres_respiration | |
3755 ; movff amb_pressure,TXREG | |
3756 ; call rs232_wait_tx | |
3757 ; movff amb_pressure+1,TXREG | |
3758 ; call rs232_wait_tx | |
3759 ;; pres_surface | |
3760 ; movff last_surfpressure,TXREG | |
3761 ; call rs232_wait_tx | |
3762 ; movff last_surfpressure+1,TXREG | |
3763 ; call rs232_wait_tx | |
3764 ;; tissue pres | |
3765 ; lfsr FSR0,0x200 | |
3766 ; movlw .64 | |
3767 ; movwf wait_temp | |
3768 ;pled_multigraf_tissue_uart_loop: | |
3769 ; movff POSTINC0,TXREG | |
3770 ; call rs232_wait_tx | |
3771 ; decfsz wait_temp | |
3772 ; bra pled_multigraf_tissue_uart_loop | |
3773 ;; movff ,TXREG | |
3774 ;; call rs232_wait_tx | |
3775 ; return | |
3776 | |
3777 ;PLED_MulitGF_nextentry_debug: | |
3778 ; lfsr FSR2,letter | |
3779 ; movff wait_temp,lo | |
3780 ; output_99 | |
3781 ; movlw 0x02 | |
3782 ; movwf POSTINC2 | |
3783 ; movlw ':' | |
3784 ; movwf POSTINC2 | |
3785 ; movlw 0x02 | |
3786 ; movwf POSTINC2 | |
3787 ; lfsr FSR0,0x300 | |
3788 ; movf wait_temp,W | |
3789 ; movff PLUSW0,lo | |
3790 ; output_99 | |
3791 ; movlw ' ' | |
3792 ; movwf POSTINC2 | |
3793 ; movlw .8 | |
3794 ; subwf temp6,F | |
3795 ; bnz PLED_MultiGF_column_ok_debug | |
3796 ; movlw b'00001111' ; gray code | |
3797 ; movwf grayvalue | |
3798 ; movlw .21 | |
3799 ; subwf temp5,F | |
3800 ; bc PLED_MultiGF_new_row_debug | |
3801 ; return | |
3802 ;PLED_MultiGF_new_row_debug: | |
3803 ; movlw .48 | |
3804 ; movwf temp6 | |
3805 ;PLED_MultiGF_column_ok_debug: | |
3806 ; movf temp5,W | |
3807 ; call PLED_SetColumn | |
3808 ; movlw .8 | |
3809 ; subwf temp6,W | |
3810 ; call PLED_SetRow | |
3811 ; call word_processor | |
3812 ; bra PLED_MultiGF_loop_debug | |
3813 | |
3814 ;PLED_MultiGF_calc_tissue_counter: | |
3815 ; movlw d'8' ; gray code | |
3816 ; movwf grayvalue | |
3817 ; movff 0x290,lo | |
3818 ; movff 0x291,hi | |
3819 ; movlw '(' | |
3820 ; movwf POSTINC2 | |
3821 ; output_16 | |
3822 ; movlw ')' | |
3823 ; movwf POSTINC2 | |
3824 ; movlw .8 | |
3825 ; subwf temp6,F | |
3826 ; bnz PLED_MGF_ok_col_calc_tis_cter | |
3827 ; movlw b'00001111' ; gray code | |
3828 ; movwf grayvalue | |
3829 ; movlw .21 | |
3830 ; subwf temp5,F | |
3831 ; bc PLED_MGF_n_row_calc_tis_cter | |
3832 ; return | |
3833 ;PLED_MGF_n_row_calc_tis_cter: | |
3834 ; movlw .48 | |
3835 ; movwf temp6 | |
3836 ;PLED_MGF_ok_col_calc_tis_cter: | |
3837 ; movf temp5,W | |
3838 ; call PLED_SetColumn | |
3839 ; movlw .8 | |
3840 ; subwf temp6,W | |
3841 ; call PLED_SetRow | |
3842 ; call word_processor | |
3843 ; bra PLED_MGF_lp_calc_tis_counter | |
3844 ; | |
3845 | |
3846 ;PLED_debug_deko: | |
3847 ; movlw .009 | |
3848 ; call PLED_SetColumn | |
3849 ; movlw .008 | |
3850 ; call PLED_SetRow | |
3851 ; lfsr FSR2,letter | |
3852 ; movff char_O_deco_status,lo | |
3853 ; output_8 | |
3854 ; call word_processor | |
3855 ; | |
3856 ; movlw .009 | |
3857 ; call PLED_SetColumn | |
3858 ; movlw .016 | |
3859 ; call PLED_SetRow | |
3860 ; lfsr FSR2,letter | |
3861 ; movff char_O_array_decodepth+0,lo | |
3862 ; output_8 | |
3863 ; call word_processor | |
3864 ; return | |
3865 ; | |
3866 | |
33 | 3867 PLED_simdata_screen: ;Display Pre-Dive Screen |
3868 ; List active gases/Setpoints | |
3869 btfsc FLAG_const_ppO2_mode ; in ppO2 mode? | |
3870 bra PLED_simdata_screen3 ; Yes, display SetPoint/Sensor result list | |
3871 | |
3872 PLED_simdata_screen2: | |
3873 ostc_debug 'm' ; Sends debug-information to screen if debugmode active | |
3874 | |
3875 WIN_LEFT .0 | |
3876 WIN_FONT FT_SMALL | |
3877 bsf leftbind | |
3878 | |
3879 movlw d'2' | |
3880 movwf wait_temp ; here: stores eeprom address for gas list | |
34 | 3881 movlw d'10' |
33 | 3882 movwf waitms_temp ; here: stores row for gas list |
3883 clrf hi ; here: Gas counter | |
3884 | |
3885 PLED_simdata_screen2_loop: | |
3886 incf hi,F ; Increase Gas | |
3887 movlw d'4' | |
3888 addwf wait_temp,F ; Increase eeprom address for gas list | |
3889 | |
3890 lfsr FSR2,letter | |
3891 movlw 'G' | |
3892 movwf POSTINC2 | |
3893 movff hi,lo ; copy gas number | |
3894 output_8 ; display gas number | |
3895 movlw ':' | |
3896 movwf POSTINC2 | |
3897 movff wait_temp, EEADR; Gas #hi: %O2 - Set address in internal EEPROM | |
3898 call read_eeprom ; get byte (stored in EEDATA) | |
3899 movff EEDATA,lo ; copy to lo | |
3900 output_8 ; outputs into Postinc2! | |
3901 movlw '/' | |
3902 movwf POSTINC2 | |
3903 incf EEADR,F ; Gas #hi: %He - Set address in internal EEPROM | |
3904 call read_eeprom ; get byte (stored in EEDATA) | |
3905 movff EEDATA,lo ; copy to lo | |
3906 output_8 ; outputs into Postinc2! | |
34 | 3907 movlw ' ' |
3908 movwf POSTINC2 | |
3909 movf hi,W ; Gas number | |
3910 addlw d'27' ; -> Adress of change depth register | |
3911 call read_int_eeprom_1 | |
3912 movff EEDATA,lo ; Change depth in m | |
3913 output_99 ; outputs into Postinc2! | |
3914 movlw 'm' | |
3915 movwf POSTINC2 | |
33 | 3916 read_int_eeprom d'27' ; read flag register |
3917 movff hi,lo ; copy gas number | |
3918 PLED_simdata_screen2_loop1: | |
3919 rrcf EEDATA ; roll flags into carry | |
3920 decfsz lo,F ; max. 5 times... | |
3921 bra PLED_simdata_screen2_loop1 | |
3922 | |
3923 btfsc STATUS,C ; test carry | |
3924 bra PLED_simdata_white | |
3925 | |
3926 movlw color_grey | |
3927 call PLED_set_color ; grey out inactive gases! | |
3928 bra PLED_simdata_color_done | |
3929 | |
3930 PLED_simdata_white: | |
3931 call PLED_standard_color | |
3932 | |
3933 PLED_simdata_color_done: | |
3934 movlw d'25' | |
3935 addwf waitms_temp,F ; Increase row | |
3936 WIN_LEFT .0 | |
3937 movff waitms_temp,win_top ; Set Row | |
34 | 3938 call word_processor ; display gas |
33 | 3939 |
3940 PLED_simdata_screen2b: | |
3941 call PLED_standard_color | |
3942 | |
34 | 3943 movlw d'5' ; list all five gases |
33 | 3944 cpfseq hi ; All gases shown? |
3945 bra PLED_simdata_screen2_loop ; No | |
3946 | |
3947 return ; No, return (OC mode) | |
3948 | |
3949 PLED_simdata_screen3: | |
3950 WIN_LEFT .0 | |
3951 WIN_FONT FT_SMALL | |
3952 bsf leftbind | |
3953 | |
3954 ; list three SP in Gaslist | |
3955 movlw d'35' ; 36 = current SP position in EEPROM | |
3956 movwf wait_temp ; here: stores eeprom address for gas list | |
34 | 3957 movlw d'10' |
33 | 3958 movwf waitms_temp ; here: stores row for gas list |
3959 clrf temp5 ; here: SP counter | |
3960 | |
3961 PLED_simdata_screen3_loop: | |
3962 incf wait_temp,F ; EEPROM address | |
3963 incf temp5,F ; Increase SP | |
3964 | |
3965 movlw d'25' | |
3966 addwf waitms_temp,F ; Increase row | |
3967 WIN_LEFT .0 | |
3968 movff waitms_temp,win_top ; Set Row | |
3969 | |
3970 lfsr FSR2,letter | |
3971 movlw 'S' | |
3972 movwf POSTINC2 | |
3973 movlw 'P' | |
3974 movwf POSTINC2 | |
3975 movff temp5,lo ; copy gas number | |
3976 output_8 ; display gas number | |
3977 movlw ':' | |
3978 movwf POSTINC2 | |
3979 movlw ' ' | |
3980 movwf POSTINC2 | |
3981 movff wait_temp, EEADR; SP #hi position | |
3982 call read_eeprom ; get byte (stored in EEDATA) | |
3983 movff EEDATA,lo ; copy to lo | |
3984 clrf hi | |
3985 output_16dp d'3' ; outputs into Postinc2! | |
3986 call word_processor | |
3987 | |
3988 movlw d'3' ; list all three SP | |
3989 cpfseq temp5 ; All gases shown? | |
3990 bra PLED_simdata_screen3_loop ;no | |
3991 | |
3992 read_int_eeprom d'33' ; Read byte (stored in EEDATA) | |
3993 movff EEDATA,active_gas ; Read start gas (1-5) | |
3994 decf active_gas,W ; Gas 0-4 | |
3995 mullw d'4' | |
3996 movf PRODL,W | |
3997 addlw d'7' ; = address for He ratio | |
3998 movwf EEADR | |
3999 call read_eeprom ; Read He ratio | |
4000 movff EEDATA,hi ; And copy into hold register | |
4001 decf active_gas,W ; Gas 0-4 | |
4002 mullw d'4' | |
4003 movf PRODL,W | |
4004 addlw d'6' ; = address for O2 ratio | |
4005 movwf EEADR | |
4006 call read_eeprom ; Read O2 ratio | |
4007 movff EEDATA, lo ; O2 ratio | |
4008 | |
4009 WIN_LEFT .0 | |
34 | 4010 WIN_TOP .110 |
33 | 4011 lfsr FSR2,letter |
4012 movlw 'D' | |
4013 movwf POSTINC2 | |
4014 movlw 'i' | |
4015 movwf POSTINC2 | |
4016 movlw 'l' | |
4017 movwf POSTINC2 | |
4018 movlw ':' | |
4019 movwf POSTINC2 | |
4020 output_8 ; O2 Ratio | |
4021 movlw '/' | |
4022 movwf POSTINC2 | |
4023 movff hi,lo | |
4024 output_8 ; He Ratio | |
4025 call word_processor | |
4026 | |
4027 bcf leftbind | |
4028 return ; Return (CC Mode) | |
4029 | |
0 | 4030 |
4031 | |
4032 adjust_depth_with_salinity: ; computes salinity setting into lo:hi [mBar] | |
4033 | |
4034 btfsc simulatormode_active ; Do apply salinity in Simulatormode | |
4035 return | |
4036 | |
4037 read_int_eeprom d'26' ; Read Salinity from EEPROM | |
4038 movff EEDATA, wait_temp ; salinity | |
4039 | |
4040 movlw d'105' ; 105% ? | |
4041 cpfslt wait_temp ; Salinity higher limit | |
4042 return ; Out of limit, do not adjust lo:hi | |
4043 | |
4044 movlw d'99' ; 99% ? | |
4045 cpfsgt wait_temp ; Salinity lower limit | |
4046 return ; Out of limit, do not adjust lo:hi | |
4047 | |
4048 movff lo,xA+0 | |
4049 movff hi,xA+1 | |
4050 | |
4051 movlw d'100' | |
4052 movwf xB+0 | |
4053 clrf xB+1 | |
4054 | |
4055 call mult16x16 ;xA*xB=xC (lo:hi * 100) | |
4056 | |
4057 movff wait_temp,xB+0 ; Salinity | |
4058 clrf xB+1 | |
4059 | |
4060 call div32x16 ; xC:4 / xB:2 = xC+3:xC+2 with xC+1:xC+0 as remainder | |
4061 | |
4062 movff xC+0,lo | |
4063 movff xC+1,hi ; restore lo and hi with updated value | |
4064 | |
4065 return |