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