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