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