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