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