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