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