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