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