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