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