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