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