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