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