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