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