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