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