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