Mercurial > public > mk2
annotate code_part1/OSTC_code_asm_part1/pled_outputs.asm @ 141:622da16b768f
LowBatt! Warning in divemode
author | heinrichsweikamp |
---|---|
date | Thu, 06 Jan 2011 18:36:22 +0100 |
parents | 87a53efbb5ba |
children | 8b75ba28d641 |
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: | |
140 | 1534 movff int_O_desaturation_time+0,lo |
1535 movff int_O_desaturation_time+1,hi ; Copy | |
1536 tstfsz lo ; =0? | |
1537 bra PLED_desaturation_time2 ; No! | |
1538 tstfsz hi ; =0? | |
1539 bra PLED_desaturation_time2 ; No! | |
1540 return ; Do not display Desat | |
1541 | |
1542 PLED_desaturation_time2: | |
0 | 1543 ostc_debug 'h' |
1544 WIN_TOP .150 | |
56 | 1545 WIN_LEFT .1 |
0 | 1546 WIN_FONT FT_SMALL |
1547 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 1548 call PLED_standard_color |
1549 | |
0 | 1550 lfsr FSR2,letter |
1551 OUTPUTTEXT d'14' ; Desat | |
123 | 1552 PUTC ' ' |
0 | 1553 movff int_O_desaturation_time+0,lo ; divide by 60... |
1554 movff int_O_desaturation_time+1,hi | |
1555 call convert_time ; converts hi:lo in minutes to hours (hi) and minutes (lo) | |
1556 bsf leftbind | |
1557 movf lo,W | |
1558 movff hi,lo | |
1559 movwf hi ; exchange lo and hi... | |
1560 output_8 ; Hours | |
123 | 1561 PUTC ':' |
0 | 1562 movff hi,lo ; Minutes |
1563 output_99x | |
1564 bcf leftbind | |
1565 call word_processor | |
1566 return | |
1567 | |
1568 PLED_nofly_time: | |
140 | 1569 movff nofly_time+0,lo |
1570 movff nofly_time+1,hi ; Copy | |
141 | 1571 movlw d'1' |
1572 cpfseq lo ; =1? | |
140 | 1573 bra PLED_nofly_time2 ; No! |
1574 tstfsz hi ; =0? | |
1575 bra PLED_nofly_time2 ; No! | |
1576 return | |
1577 | |
1578 PLED_nofly_time2: | |
0 | 1579 ostc_debug 'g' |
1580 WIN_TOP .125 | |
56 | 1581 WIN_LEFT .1 |
0 | 1582 WIN_FONT FT_SMALL |
1583 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 1584 call PLED_standard_color |
1585 | |
0 | 1586 lfsr FSR2,letter |
1587 OUTPUTTEXT d'35' ; NoFly | |
123 | 1588 PUTC ' ' |
0 | 1589 movff nofly_time+0,lo ; divide by 60... |
1590 movff nofly_time+1,hi | |
1591 call convert_time ; converts hi:lo in minutes to hours (hi) and minutes (lo) | |
1592 bsf leftbind | |
1593 movf lo,W | |
1594 movff hi,lo | |
1595 movwf hi ; exchange lo and hi... | |
1596 output_8 ; Hours | |
123 | 1597 PUTC ':' |
0 | 1598 movff hi,lo ; Minutes |
1599 decf lo,F | |
1600 btfsc lo,7 ; keep Nofly time | |
1601 clrf lo | |
1602 output_99x | |
1603 bcf leftbind | |
1604 call word_processor | |
1605 return | |
1606 | |
1607 | |
1608 update_surf_press: | |
1609 btfsc premenu ; Do not update when "Menu?" is displayed! | |
1610 return | |
1611 | |
1612 ostc_debug 'b' ; Sends debug-information to screen if debugmode active | |
1613 WIN_TOP .25 | |
56 | 1614 WIN_LEFT .1 |
0 | 1615 WIN_FONT FT_SMALL |
1616 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 1617 call PLED_standard_color |
1618 | |
0 | 1619 lfsr FSR2,letter |
1620 movff amb_pressure+0,lo | |
1621 movff amb_pressure+1,hi | |
1622 bsf leftbind | |
1623 output_16 | |
1624 bcf leftbind | |
123 | 1625 STRCAT_PRINT "mbar " |
0 | 1626 return |
1627 | |
1628 update_batt_voltage_divemode: | |
141 | 1629 call PLED_warnings_color |
1630 DISPLAYTEXT d'246' ; LowBatt! | |
1631 call PLED_standard_color | |
1632 return | |
0 | 1633 |
1634 update_batt_voltage: | |
1635 ostc_debug 'f' | |
1636 | |
1637 GETCUSTOM8 d'31' ; =1 if battery voltage should be visible | |
1638 movwf lo | |
1639 movlw d'1' | |
1640 cpfseq lo ; =1? | |
1641 bra update_batt_voltage2 ; No, show symbol | |
1642 | |
1643 WIN_TOP .175 | |
56 | 1644 WIN_LEFT .1 |
0 | 1645 WIN_FONT FT_SMALL |
1646 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 1647 call PLED_standard_color |
1648 | |
0 | 1649 lfsr FSR2,letter |
1650 movff batt_voltage+0,lo | |
1651 movff batt_voltage+1,hi | |
1652 movlw d'1' | |
1653 movwf ignore_digits | |
1654 bsf ignore_digit5 ; do not display mV | |
1655 bsf leftbind | |
1656 output_16dp d'2' ; e.g. 3.45V | |
1657 bcf leftbind | |
123 | 1658 STRCAT_PRINT "V " |
0 | 1659 return |
1660 | |
1661 update_batt_voltage2: | |
123 | 1662 WIN_FRAME_STD .174, .194, .1, .32 |
0 | 1663 |
25 | 1664 ; 4100-Vbatt |
1665 movlw LOW d'4100' | |
0 | 1666 movwf sub_a+0 |
25 | 1667 movlw HIGH d'4100' |
0 | 1668 movwf sub_a+1 |
1669 movff batt_voltage+0,sub_b+0 | |
1670 movff batt_voltage+1,sub_b+1 | |
1671 call sub16 ; sub_c = sub_a - sub_b | |
25 | 1672 ; Battery full (>4100mV? |
0 | 1673 btfsc neg_flag |
1674 bra update_batt_voltage2_full | |
1675 | |
25 | 1676 ; Vbatt-3500 |
1677 movlw LOW d'3500' | |
0 | 1678 movwf sub_b+0 |
25 | 1679 movlw HIGH d'3500' |
0 | 1680 movwf sub_b+1 |
1681 movff batt_voltage+0,sub_a+0 | |
1682 movff batt_voltage+1,sub_a+1 | |
1683 call sub16 ; sub_c = sub_a - sub_b | |
25 | 1684 ; Battery lower then 3500mV? |
0 | 1685 btfsc neg_flag |
1686 bra update_batt_voltage2_empty | |
1687 | |
25 | 1688 ; Battery is between 3500 and 4100mV |
0 | 1689 ; sub_c:2 is between 0 and 600 |
1690 movff sub_c+0,xA+0 | |
1691 movff sub_c+1,xA+1 | |
1692 movlw d'20' | |
1693 movwf xB+0 | |
1694 clrf xB+1 | |
1695 call div16x16 ;xA/xB=xC with xA as remainder | |
1696 ; xC is between 0 and 30 | |
1697 movff xC+0,wait_temp ;save value | |
56 | 1698 incf wait_temp,F ; +1 |
1699 | |
1700 movlw d'3' | |
0 | 1701 cpfsgt wait_temp |
56 | 1702 movwf wait_temp ; Minimum = 3 |
0 | 1703 |
1704 update_batt_voltage2a: | |
123 | 1705 WIN_BOX_STD .181, .187, .32, .34 |
25 | 1706 |
0 | 1707 update_batt_voltage3: |
25 | 1708 GETCUSTOM8 d'34' ; Color battery |
123 | 1709 call PLED_set_color |
1710 | |
25 | 1711 movlw .176 |
123 | 1712 movff WREG,win_top ; row top (0-239) |
1713 movlw .192-.176 | |
1714 movff WREG,win_height ; row bottom (0-239) | |
56 | 1715 movlw .2 |
123 | 1716 movff WREG,win_leftx2 ; column left (0-159) |
1717 movff wait_temp,win_width ; column right (0-159) | |
0 | 1718 call PLED_box |
1719 | |
25 | 1720 call PLED_standard_color |
0 | 1721 return |
1722 | |
1723 update_batt_voltage2_empty: | |
1724 movlw d'1' | |
1725 movwf wait_temp | |
1726 bra update_batt_voltage2a | |
1727 | |
1728 update_batt_voltage2_full: | |
1729 movlw d'30' | |
1730 movwf wait_temp | |
25 | 1731 bra update_batt_voltage2a |
0 | 1732 |
1733 PLED_convert_date: ; converts into "DD/MM/YY" or "MM/DD/YY" or "YY/MM/DD" in postinc2 | |
1734 read_int_eeprom d'91' ; Read date format (0=MMDDYY, 1=DDMMYY, 2=YYMMDD) | |
1735 tstfsz EEDATA | |
1736 bra PLED_convert_date1 | |
1737 | |
1738 ; Use MMDDYY | |
1739 movff convert_value_temp+0,lo ;month | |
1740 bsf leftbind | |
1741 output_99x | |
1742 bcf leftbind | |
140 | 1743 PUTC '.' |
0 | 1744 movff convert_value_temp+1,lo ;day |
1745 bra PLED_convert_date1_common ;year | |
1746 | |
1747 PLED_convert_date1: | |
1748 read_int_eeprom d'91' ; Read date format (0=MMDDYY, 1=DDMMYY, 2=YYMMDD) | |
1749 decfsz EEDATA,F | |
1750 bra PLED_convert_date2 | |
1751 | |
1752 ; Use DDMMYY | |
1753 movff convert_value_temp+1,lo ;day | |
1754 bsf leftbind | |
1755 output_99x | |
1756 bcf leftbind | |
140 | 1757 PUTC '.' |
0 | 1758 movff convert_value_temp+0,lo ;month |
1759 | |
1760 PLED_convert_date1_common: | |
1761 bsf leftbind | |
1762 output_99x | |
1763 bcf leftbind | |
140 | 1764 PUTC '.' |
0 | 1765 movff convert_value_temp+2,lo ;year |
1766 bsf leftbind | |
1767 output_99x | |
1768 return | |
1769 | |
1770 PLED_convert_date2: | |
1771 ; Use YYMMDD | |
1772 movff convert_value_temp+2,lo ;year | |
1773 bsf leftbind | |
1774 output_99x | |
1775 bcf leftbind | |
140 | 1776 PUTC '.' |
0 | 1777 movff convert_value_temp+0,lo ;month |
1778 bsf leftbind | |
1779 output_99x | |
1780 bcf leftbind | |
140 | 1781 PUTC '.' |
0 | 1782 movff convert_value_temp+1,lo ;day |
1783 bsf leftbind | |
1784 output_99x | |
1785 return | |
1786 | |
1787 PLED_convert_date_short: ; converts into "DD/MM" or "MM/DD" or "MM/DD" in postinc2 | |
1788 read_int_eeprom d'91' ; Read date format (0=MMDDYY, 1=DDMMYY, 2=YYMMDD) | |
1789 tstfsz EEDATA | |
1790 bra PLED_convert_date_short1 | |
1791 | |
1792 ; Use MMDDYY | |
1793 PLED_convert_date_short_common: | |
1794 movff convert_value_temp+0,lo ;month | |
1795 bsf leftbind | |
1796 output_99x | |
1797 bcf leftbind | |
140 | 1798 PUTC '.' |
0 | 1799 movff convert_value_temp+1,lo ;day |
1800 bsf leftbind | |
1801 output_99x | |
1802 bcf leftbind | |
1803 return | |
1804 | |
1805 PLED_convert_date_short1: | |
1806 read_int_eeprom d'91' ; Read date format (0=MMDDYY, 1=DDMMYY, 2=YYMMDD) | |
1807 decfsz EEDATA,F | |
1808 bra PLED_convert_date_short_common ; Use YYMMDD | |
1809 | |
1810 ; Use DDMMYY | |
1811 movff convert_value_temp+1,lo ;day | |
1812 bsf leftbind | |
1813 output_99x | |
1814 bcf leftbind | |
140 | 1815 PUTC '.' |
0 | 1816 movff convert_value_temp+0,lo ;month |
1817 bsf leftbind | |
1818 output_99x | |
1819 bcf leftbind | |
1820 return | |
1821 | |
1822 update_date: | |
1823 ostc_debug 'd' | |
1824 WIN_TOP .75 | |
56 | 1825 WIN_LEFT .1 |
0 | 1826 WIN_FONT FT_SMALL |
1827 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 1828 call PLED_standard_color |
1829 | |
0 | 1830 lfsr FSR2,letter |
1831 | |
1832 movff month,convert_value_temp+0 | |
1833 movff day,convert_value_temp+1 | |
1834 movff year,convert_value_temp+2 | |
1835 call PLED_convert_date ; converts into "DD/MM/YY" or "MM/DD/YY" or "YY/MM/DD" in postinc2 | |
1836 call word_processor | |
1837 return | |
1838 | |
1839 PLED_menu_clear: | |
123 | 1840 WIN_BOX_BLACK .0, .26, .65, .100 |
0 | 1841 return |
1842 | |
1843 PLED_max_pressure: | |
1844 ostc_debug 'p' ; Sends debug-information to screen if debugmode active | |
75 | 1845 movff max_pressure+0,lo |
1846 movff max_pressure+1,hi | |
1847 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mBar] | |
1848 | |
1849 movlw .039 | |
1850 cpfslt hi | |
1851 bra maxdepth_greater_99_84mtr | |
1852 | |
1853 ; Display normal "xx.y" | |
1854 lfsr FSR2,letter | |
1855 call PLED_standard_color | |
0 | 1856 WIN_TOP .184 |
1857 WIN_LEFT .0 | |
1858 WIN_FONT FT_MEDIUM | |
1859 WIN_INVERT .0 ; Init new Wordprocessor | |
1860 bsf leftbind | |
1861 bsf ignore_digit5 ; do not display 1cm depth | |
1862 output_16dp d'3' | |
1863 bcf leftbind | |
1864 bcf show_last3 | |
1865 call word_processor | |
1866 WIN_FONT FT_SMALL | |
1867 return | |
1868 | |
75 | 1869 maxdepth_greater_99_84mtr: ; Display only in full meters |
1870 btfss maxdepth_greater_100m ; Is max.depth>100m already? | |
1871 call PLED_clear_maxdepth ; No, clear maxdepth area and set flag | |
1872 ; max Depth is already in hi:lo | |
1873 ; Show max depth in Full meters | |
1874 ; That means ignore figure 4 and 5 | |
1875 lfsr FSR2,letter | |
1876 call PLED_standard_color | |
1877 WIN_TOP .184 | |
1878 WIN_LEFT .0 | |
1879 WIN_FONT FT_MEDIUM | |
1880 WIN_INVERT .0 ; Init new Wordprocessor | |
1881 | |
1882 bsf ignore_digit4 | |
1883 bsf leftbind | |
1884 output_16 | |
1885 bcf leftbind | |
1886 call word_processor | |
1887 bcf ignore_digit4 | |
1888 WIN_FONT FT_SMALL | |
1889 return | |
1890 | |
1891 PLED_clear_maxdepth: | |
123 | 1892 WIN_BOX_BLACK .184, .215, .0, .41 |
75 | 1893 bsf maxdepth_greater_100m ; Set Flag |
1894 return | |
1895 | |
0 | 1896 PLED_divemins: |
1897 btfsc menubit ; Divemode menu active? | |
1898 return ; Yes, do not update divetime | |
1899 | |
1900 ostc_debug 'A' ; Sends debug-information to screen if debugmode active | |
1901 | |
1902 btfsc gauge_mode ; different display in gauge mode | |
1903 bra PLED_divemins_gauge | |
1904 | |
1905 btfsc FLAG_apnoe_mode ; different display in apnoe mode | |
1906 bra PLED_divemins_apnoe | |
1907 | |
1908 GETCUSTOM8 d'38' ; Show seconds (=1?) | |
1909 movwf lo | |
1910 movlw d'1' | |
1911 cpfseq lo ; =1? | |
1912 bra PLED_divemins2 ; No, minutes only | |
1913 bra PLED_divemins_gauge ; Yes, use Gauge routine | |
1914 | |
1915 PLED_divemins2: | |
1916 movff divemins+0,lo | |
1917 movff divemins+1,hi | |
1918 bcf leftbind | |
1919 lfsr FSR2,letter | |
1920 output_16_3 ; displays only last three figures from a 16Bit value (0-999) | |
1921 WIN_TOP .20 | |
1922 WIN_LEFT .120 | |
1923 WIN_FONT FT_MEDIUM | |
3 | 1924 call PLED_standard_color |
0 | 1925 call word_processor |
1926 WIN_FONT FT_SMALL | |
1927 return | |
1928 | |
1929 PLED_display_apnoe_surface: | |
1930 btfsc menubit ; Divemode menu active? | |
1931 return ; Yes, do not display surface mode timeout | |
1932 | |
9 | 1933 call PLED_divemask_color ; Set Color for Divemode mask |
0 | 1934 DISPLAYTEXT d'140' ; "SURFACE" |
3 | 1935 call PLED_standard_color |
1936 | |
0 | 1937 |
1938 WIN_TOP .85 | |
1939 WIN_LEFT .90 | |
1940 WIN_FONT FT_MEDIUM | |
3 | 1941 call PLED_standard_color |
1942 | |
0 | 1943 |
1944 movff apnoe_surface_mins,lo | |
1945 bcf leftbind | |
1946 lfsr FSR2,letter | |
1947 output_8 | |
123 | 1948 PUTC ':' |
0 | 1949 movff apnoe_surface_secs,lo |
1950 output_99x | |
1951 call word_processor | |
1952 WIN_FONT FT_SMALL | |
1953 return | |
1954 | |
1955 PLED_apnoe_clear_surface: | |
1956 ; Clear Surface timer.... | |
123 | 1957 WIN_BOX_BLACK .60, .119, .90, .159 |
0 | 1958 return |
1959 | |
1960 | |
1961 PLED_display_apnoe_descent: | |
9 | 1962 call PLED_divemask_color ; Set Color for Divemode mask |
0 | 1963 DISPLAYTEXT d'139' ; "Descent" |
3 | 1964 call PLED_standard_color |
1965 | |
0 | 1966 |
1967 WIN_TOP .145 | |
1968 WIN_LEFT .90 | |
1969 WIN_FONT FT_MEDIUM | |
3 | 1970 call PLED_standard_color |
1971 | |
0 | 1972 |
1973 movff apnoe_mins,lo | |
1974 lfsr FSR2,letter | |
1975 output_8 | |
123 | 1976 PUTC ':' |
0 | 1977 movff apnoe_secs,lo |
1978 output_99x | |
1979 call word_processor | |
1980 WIN_FONT FT_SMALL | |
1981 return | |
1982 | |
1983 PLED_divemins_apnoe: | |
1984 | |
1985 PLED_divemins_gauge: | |
1986 movff divemins+0,lo | |
1987 movff divemins+1,hi | |
1988 bcf leftbind | |
1989 bsf show_last3 | |
1990 lfsr FSR2,letter | |
1991 output_16_3 ;Displays only 0...999 | |
123 | 1992 PUTC ':' |
0 | 1993 movff divesecs,lo |
1994 output_99x | |
1995 WIN_TOP .20 | |
1996 WIN_LEFT .90 | |
1997 WIN_FONT FT_MEDIUM | |
3 | 1998 call PLED_standard_color |
1999 | |
0 | 2000 call word_processor |
2001 bcf show_last3 | |
2002 WIN_FONT FT_SMALL | |
2003 return | |
2004 | |
2005 PLED_stopwatch_show: | |
2006 ; Stopwatch | |
9 | 2007 call PLED_divemask_color ; Set Color for Divemode mask |
87 | 2008 DISPLAYTEXTH d'283' ; Stopwatch |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
91
diff
changeset
|
2009 |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
91
diff
changeset
|
2010 PLED_stopwatch_show2: |
3 | 2011 call PLED_standard_color |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
91
diff
changeset
|
2012 ostc_debug 'V' ; Sends debug-information to screen if debugmode active |
87 | 2013 WIN_TOP .192 |
0 | 2014 WIN_LEFT .110 |
2015 WIN_FONT FT_SMALL | |
3 | 2016 call PLED_standard_color |
2017 | |
0 | 2018 lfsr FSR2,letter |
2019 movff average_divesecs+0,lo ; Stopwatch | |
2020 movff average_divesecs+1,hi ; Stopwatch | |
2021 movlw d'2' | |
2022 subwf lo,F | |
2023 movlw d'0' | |
2024 subwfb hi,F ; Subtract 2 seconds | |
2025 | |
2026 call convert_time ; converts hi:lo in seconds to mins (hi) and secs (lo) | |
2027 | |
2028 movff lo,wait_temp | |
2029 movff hi,lo | |
2030 clrf hi | |
2031 | |
2032 movlw d'0' | |
2033 bcf leftbind | |
2034 bsf show_last3 | |
2035 output_16_3 ;Displays only 0...999 | |
123 | 2036 PUTC ':' |
0 | 2037 movff wait_temp,lo |
2038 output_99x | |
2039 call word_processor | |
2040 | |
2041 ostc_debug 'U' ; Sends debug-information to screen if debugmode active | |
2042 | |
87 | 2043 WIN_TOP .216 |
2044 WIN_LEFT .110 | |
0 | 2045 WIN_FONT FT_SMALL |
3 | 2046 call PLED_standard_color |
2047 | |
0 | 2048 lfsr FSR2,letter |
2049 movff avr_rel_pressure+0,lo | |
2050 movff avr_rel_pressure+1,hi | |
2051 call adjust_depth_with_salinity ; computes salinity setting into lo:hi [mBar] | |
2052 bsf ignore_digit5 ; do not display 1cm depth | |
2053 output_16dp d'3' | |
2054 bcf leftbind | |
123 | 2055 STRCAT_PRINT "m" |
0 | 2056 return |
2057 | |
129
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
127
diff
changeset
|
2058 PLED_total_average_show: |
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
127
diff
changeset
|
2059 ; Non-Resettable Average |
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
127
diff
changeset
|
2060 call PLED_divemask_color ; Set Color for Divemode mask |
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
127
diff
changeset
|
2061 DISPLAYTEXTH d'281' ; Avr.Depth |
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
127
diff
changeset
|
2062 |
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
127
diff
changeset
|
2063 PLED_total_average_show2: |
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
127
diff
changeset
|
2064 WIN_TOP .192 |
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
127
diff
changeset
|
2065 WIN_LEFT .110 |
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
127
diff
changeset
|
2066 WIN_FONT FT_SMALL |
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
127
diff
changeset
|
2067 call PLED_standard_color |
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
127
diff
changeset
|
2068 |
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
127
diff
changeset
|
2069 lfsr FSR2,letter |
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
127
diff
changeset
|
2070 movff avr_rel_pressure_total+0,lo |
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
127
diff
changeset
|
2071 movff avr_rel_pressure_total+1,hi |
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
127
diff
changeset
|
2072 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
|
2073 bsf ignore_digit5 ; do not display 1cm depth |
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
127
diff
changeset
|
2074 bcf leftbind |
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
127
diff
changeset
|
2075 output_16dp d'3' |
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
127
diff
changeset
|
2076 STRCAT_PRINT "m" |
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
127
diff
changeset
|
2077 return |
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
127
diff
changeset
|
2078 |
0 | 2079 |
2080 PLED_serial: ; Writes OSTC #Serial and Firmware version in surfacemode | |
2081 ostc_debug 'a' ; Sends debug-information to screen if debugmode active | |
2082 WIN_TOP .0 | |
56 | 2083 WIN_LEFT .1 |
0 | 2084 WIN_FONT FT_SMALL |
2085 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 2086 call PLED_standard_color |
2087 | |
0 | 2088 lfsr FSR2,letter |
107 | 2089 OUTPUTTEXTH d'262' ; "OSTC " |
2090 clrf EEADRH | |
2091 clrf EEADR ; Get Serial number LOW | |
2092 call read_eeprom ; read byte | |
2093 movff EEDATA,lo | |
2094 incf EEADR,F ; Get Serial number HIGH | |
2095 call read_eeprom ; read byte | |
2096 movff EEDATA,hi | |
2097 | |
2098 bsf leftbind | |
2099 output_16 | |
129
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
127
diff
changeset
|
2100 STRCAT " \x85\x86 V" ; Scribble logo... |
0 | 2101 movlw softwareversion_x |
2102 movwf lo | |
2103 bsf leftbind | |
2104 output_8 | |
123 | 2105 PUTC '.' |
0 | 2106 movlw softwareversion_y |
2107 movwf lo | |
2108 bsf leftbind | |
2109 output_99x | |
2110 bcf leftbind | |
2111 call word_processor | |
140 | 2112 |
2113 movlw softwareversion_beta ; =1: Beta, =0: Release | |
2114 decfsz WREG,F | |
2115 return ; Release version -> Return | |
2116 | |
2117 call PLED_warnings_color | |
2118 DISPLAYTEXT d'243' ; beta | |
2119 call PLED_standard_color | |
0 | 2120 return |
2121 | |
2122 PLED_divemode_menu_mask_first: ; Write Divemode menu1 mask | |
2123 ostc_debug 'o' ; Sends debug-information to screen if debugmode active | |
2124 call PLED_menu_clear ; clear "Menu?" | |
123 | 2125 call PLED_standard_color |
0 | 2126 |
2127 btfsc FLAG_const_ppO2_mode ; are we in ppO2 mode? | |
2128 bra PLED_divemode_menu_mask_first2 | |
73
2227459e8ef2
Exchanged Decoplan and Gaslist in dive mode menu
heinrichsweikamp
parents:
71
diff
changeset
|
2129 |
0 | 2130 ; in OC Mode |
2131 DISPLAYTEXT .32 ;"Gaslist" | |
73
2227459e8ef2
Exchanged Decoplan and Gaslist in dive mode menu
heinrichsweikamp
parents:
71
diff
changeset
|
2132 DISPLAYTEXT .31 ;"Decoplan" |
0 | 2133 bra PLED_divemode_menu_mask_first3 |
2134 | |
2135 PLED_divemode_menu_mask_first2: | |
2136 ; in CC Mode | |
73
2227459e8ef2
Exchanged Decoplan and Gaslist in dive mode menu
heinrichsweikamp
parents:
71
diff
changeset
|
2137 DISPLAYTEXT .238 ;"SetPoint" |
2227459e8ef2
Exchanged Decoplan and Gaslist in dive mode menu
heinrichsweikamp
parents:
71
diff
changeset
|
2138 DISPLAYTEXT .31 ;"Decoplan" |
0 | 2139 |
2140 PLED_divemode_menu_mask_first3: | |
2141 ; In all modes | |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
91
diff
changeset
|
2142 call customview_menu_entry3 ; Show customview-dependent menu entry |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
91
diff
changeset
|
2143 DISPLAYTEXT .241 ;"Display" |
0 | 2144 DISPLAYTEXT .34 ;"Exit" |
2145 return | |
2146 | |
2147 PLED_divemode_set_xgas: ; Displayes the "Set Gas" menu | |
2148 WIN_LEFT .100 | |
2149 WIN_TOP .0 | |
2150 WIN_FONT FT_SMALL | |
3 | 2151 call PLED_standard_color |
2152 | |
123 | 2153 STRCPY "Sel" |
0 | 2154 read_int_eeprom d'24' ; Get Gas6 %O2 |
2155 movff EEDATA,lo | |
2156 bcf leftbind | |
2157 output_99 ; outputs into Postinc2! | |
123 | 2158 PUTC '/' |
0 | 2159 read_int_eeprom d'25' ; Get Gas6 %He |
2160 movff EEDATA,lo | |
2161 output_99 ; outputs into Postinc2! | |
2162 call word_processor | |
2163 DISPLAYTEXT .123 ; O2 + | |
2164 DISPLAYTEXT .124 ; O2 - | |
2165 DISPLAYTEXT .125 ; He + | |
2166 DISPLAYTEXT .126 ; He - | |
2167 return | |
2168 | |
2169 PLED_divemode_simulator_mask: | |
124 | 2170 call PLED_standard_color |
2171 DISPLAYTEXT .254 ; Close | |
2172 DISPLAYTEXT .250 ; + 1m | |
2173 DISPLAYTEXT .251 ; - 1m | |
2174 DISPLAYTEXT .252 ; +10m | |
2175 DISPLAYTEXT .253 ; -10m | |
2176 return | |
0 | 2177 |
123 | 2178 ;----------------------------------------------------------------------------- |
124 | 2179 ; Draw a stop of the deco plan (simulator or dive). |
2180 ; Inputs: lo = depth. Range 3m...93m | |
2181 ; hi = minutes. range 1'..240'. | |
2182 ; win_top = line to draw on screen. | |
2183 ; Trashed: hi, lo, win_height, win_leftx2, win_width, win_color*, | |
2184 ; WREG, PROD, TBLPTR TABLAT. | |
2185 | |
2186 PLED_decoplan_show_stop: | |
2187 ;---- Print depth ---------------------------------------------------- | |
2188 WIN_LEFT .100 | |
2189 call PLED_standard_color | |
2190 lfsr FSR2,letter | |
2191 bsf leftbind | |
2192 output_8 ; outputs into Postinc2! | |
2193 STRCAT_PRINT "m " | |
2194 | |
2195 ;---- Print duration ------------------------------------------------- | |
2196 WIN_LEFT .140 | |
2197 lfsr FSR2,letter | |
2198 | |
2199 movf lo,W ; Swap hi & lo | |
2200 movff hi,lo | |
2201 movwf hi | |
2202 | |
2203 output_8 ; Allow up to 240' | |
2204 STRCAT_PRINT "' " ; 1 to 3 chars for depth. | |
2205 | |
2206 movf lo,W ; Swap back hi & lo | |
2207 movff hi,lo | |
2208 movwf hi | |
2209 | |
2210 ;--------------------------------------------------------------------- | |
2211 ; Draw the bar graph used for deco stops (decoplan in simulator or dive). | |
2212 movff win_top,WREG ; Increment win_top (BANK SAFE) | |
2213 incf WREG | |
2214 movff WREG,win_top | |
2215 movlw d'18'+1 ; 19 --> height (bank safe !) | |
2216 movff WREG,win_height | |
2217 movlw .122 | |
2218 movff WREG,win_leftx2 ; column left (0-159) | |
2219 | |
2220 ; Draw used area (lo = minutes): | |
2221 call PLED_standard_color | |
2222 movlw d'16' ; Limit length (16min) | |
2223 cpfslt hi | |
2224 movwf hi | |
2225 movff hi,win_width ; Bar width | |
2226 tstfsz hi ; Skip 0-size bar... | |
2227 call PLED_box | |
2228 | |
2229 ; Clear unused area: | |
2230 movlw .0 | |
2231 movff WREG,win_color1 | |
2232 movff WREG,win_color2 | |
2233 movlw .122 ; (width+left-1)+1 | |
2234 addwf hi,W | |
2235 movff WREG,win_leftx2 ; --> left | |
2236 movf hi,W | |
2237 sublw .16 ; 16-left --> width | |
2238 movff WREG,win_width | |
2239 tstfsz WREG ; Skip 0-size bar. | |
2240 call PLED_box | |
2241 | |
2242 ; Restore win_top | |
2243 movff win_top,WREG ; decf win_top (BANK SAFE) | |
2244 decf WREG | |
2245 movff WREG,win_top | |
2246 return | |
123 | 2247 |
2248 ;----------------------------------------------------------------------------- | |
124 | 2249 ; Clear unused area belw last stop |
2250 ; Inputs: win_top : last used area... | |
2251 PLED_decoplan_clear_bottom: | |
2252 movff win_top,WREG ; Get back from bank0 | |
2253 btfsc divemode ; In dive mode ? | |
2254 sublw .170 ; Yes: bottom row in divemode | |
2255 btfss divemode ; In dive mode ? | |
2256 sublw .240 ; No: bottom row in planning | |
2257 movff WREG,win_height | |
2258 | |
2259 WIN_LEFT .82 ; Full divemenu width | |
2260 movlw .160-.82+1 | |
2261 movff WREG,win_width | |
2262 | |
2263 clrf WREG ; Fill with black | |
2264 movff WREG,win_color1 | |
2265 movff WREG,win_color2 | |
2266 | |
2267 goto PLED_box | |
123 | 2268 |
2269 ;----------------------------------------------------------------------------- | |
124 | 2270 ; Display the decoplan (simulator or divemode) for GF model |
2271 ; Inputs: char_O_deco_table (array of stop times, in minutes) | |
2272 ; decoplan_page = page number. Displays 5 stop by page. | |
2273 ; | |
2274 decoplan_index equ apnoe_mins ; within each page | |
2275 decoplan_gindex equ apnoe_secs ; global index | |
2276 decoplan_last equ apnoe_max_pressure ; Depth of last stop (CF#29) | |
2277 decoplan_max equ apnoe_max_pressure+1; Number of lines per page. 7 in planning, 5 in diving. | |
2278 | |
2279 PLED_decoplan_gf: | |
2280 ostc_debug 'n' ; Sends debug-information to screen if debugmode active | |
2281 | |
2282 WIN_INVERT 0 | |
2283 | |
2284 ;---- Is there deco stops ? ------------------------------------------ | |
2285 lfsr FSR1,char_O_deco_table | |
2286 movlw .1 | |
2287 movf PLUSW1,W ; char_O_deco_table[1] --> WREG | |
2288 bnz PLED_decoplan_gf_1 | |
2289 | |
2290 ;---- No Deco -------------------------------------------------------- | |
2291 call PLED_standard_color | |
2292 DISPLAYTEXT d'239' ;"No Deco" | |
2293 bsf last_ceiling_gf_shown | |
2294 return | |
2295 | |
2296 PLED_decoplan_gf_1: | |
2297 GETCUSTOM8 d'29' ; Last decostop depth, in m | |
2298 movwf decoplan_last ; --> decoplan_last | |
2299 | |
2300 movlw .8 ; 8 lines/page in decoplan | |
2301 btfsc divemode | |
2302 movlw .6 ; 6 lines/page in divemode. | |
2303 movwf decoplan_max | |
2304 | |
2305 movlw .1 | |
2306 movwf decoplan_index ; Start with index = 1 | |
2307 clrf WREG | |
2308 movff WREG,win_top ; and row = 0 | |
2309 | |
2310 ; Read stop parameters, indexed by decoplan_index and decoplan_page | |
2311 movf decoplan_page,W ; decoplan_gindex = 6*decoplan_page + decoplan_index | |
2312 mulwf decoplan_max | |
2313 movf decoplan_index,W | |
2314 addwf PRODL,W | |
2315 movwf decoplan_gindex ; --> decoplan_gindex | |
2316 | |
2317 bcf last_ceiling_gf_shown ; Not finished yet... | |
2318 | |
2319 PLED_decoplan_gf_2: | |
2320 btfsc decoplan_gindex,5 ; Reached table length (32) ? | |
2321 bra PLED_decoplan_gf_99 ; YES: finished... | |
2322 | |
2323 ; Compute new depth | |
2324 movf decoplan_gindex,W ; depth = 3 * (global index) | |
2325 mullw .3 ; --> PROD | |
2326 movf decoplan_last,W ; depth < decoplan_last (CF#29) ? | |
2327 cpfslt PRODL | |
2328 movf PRODL,W ; NO: take depth, else keep decoplan_last. | |
2329 movwf lo ; --> lo | |
2330 | |
2331 ; Read deepest depth from other bank. | |
2332 movff char_O_array_decodepth,WREG | |
2333 xorwf lo,W ; This is last stop ? | |
2334 btfsc STATUS,Z | |
2335 bsf last_ceiling_gf_shown ; YES: mark for latter... | |
2336 | |
2337 ; Read stop duration | |
2338 movf decoplan_gindex,W ; index | |
2339 movff PLUSW1,hi ; char_O_deco_table[index] --> hi | |
2340 movf hi,W ; time = zero ? | |
2341 bz PLED_decoplan_gf_4 ; Do not display it: continue. | |
2342 | |
2343 ; Display the stop line | |
2344 call PLED_decoplan_show_stop | |
2345 | |
2346 ; Next | |
2347 movff win_top,WREG ; row: += 24 | |
2348 addlw .24 | |
2349 movff WREG,win_top | |
2350 incf decoplan_index,F ; local index += 1 | |
2351 PLED_decoplan_gf_4: | |
2352 incf decoplan_gindex,F ; global index += 1 | |
2353 | |
2354 btfsc last_ceiling_gf_shown ; Last one done ? | |
2355 bra PLED_decoplan_gf_99 ; YES: finished... | |
2356 | |
2357 ; Max number of lines/page reached ? | |
2358 incf decoplan_max,W ; index+1 == max+1 ? | |
2359 cpfseq decoplan_index | |
2360 bra PLED_decoplan_gf_2 ; NO: loop | |
2361 | |
2362 ; Check if next stop if end-of-list ? | |
2363 movlw .3 ; Next stop is lo + 3m | |
2364 addwf lo,W | |
2365 xorwf decoplan_last,W ; == last stop ? | |
2366 bz PLED_decoplan_gf_99 ; End of list... | |
2367 | |
2368 ; Display the message "more..." | |
2369 rcall PLED_decoplan_clear_bottom ; Clear from next line | |
2370 | |
2371 WIN_LEFT .130 - 7*3 | |
2372 call PLED_standard_color | |
2373 STRCPY_PRINT "more..." | |
2374 bcf last_ceiling_gf_shown ; More page to display... | |
2375 return | |
2376 | |
2377 PLED_decoplan_gf_99: | |
2378 bsf last_ceiling_gf_shown ; Nothing more in table to display. | |
2379 rcall PLED_decoplan_clear_bottom ; Clear from next line | |
2380 return | |
2381 | |
2382 ;----------------------------------------------------------------------------- | |
2383 ; Display the decoplan (simulator or divemode) for ZHL-16c model | |
2384 PLED_decoplan: | |
2385 ostc_debug 'n' ; Sends debug-information to screen if debugmode active | |
2386 | |
2387 WIN_INVERT 0 | |
2388 | |
2389 ;---- Is there deco information -------------------------------------- | |
2390 lfsr FSR0,char_O_array_decodepth | |
2391 lfsr FSR1,char_O_array_decotime | |
2392 | |
2393 movf INDF0,W | |
2394 bnz PLED_decoplan1 | |
2395 | |
2396 ;---- No Deco -------------------------------------------------------- | |
2397 call PLED_standard_color | |
2398 DISPLAYTEXT d'239' ;"No Deco" | |
2399 bsf last_ceiling_gf_shown | |
2400 return | |
0 | 2401 |
2402 PLED_decoplan1: | |
124 | 2403 GETCUSTOM8 d'29' ; Last decostop depth, in m |
2404 movwf decoplan_last ; --> decoplan_last | |
2405 | |
2406 movlw .6 ; Max 6 lines in all modes. | |
2407 movwf decoplan_max | |
2408 | |
2409 clrf decoplan_index ; Starts with index = 0 | |
2410 clrf WREG | |
2411 movff WREG,win_top ; and row = 0 | |
2412 | |
30 | 2413 PLED_decoplan2: |
124 | 2414 ; Read stop parameters, indexed by decoplan_index |
2415 movf decoplan_index,W | |
2416 movff PLUSW0,lo ; array_decodepth[index] | |
2417 movff PLUSW1,hi ; array_decotime[index] | |
2418 | |
2419 ; 0 time == end-of-table. | |
2420 movf hi,w | |
2421 bz PLED_decoplan_0 | |
2422 | |
2423 call PLED_decoplan_show_stop | |
2424 | |
2425 movff win_top,WREG ; row += 24 | |
2426 addlw .24 | |
2427 movff WREG,win_top | |
2428 incf decoplan_index,F ; index += 1 | |
2429 | |
2430 ; 6 Stops max... | |
2431 movf decoplan_max,W | |
2432 cpfseq decoplan_index | |
2433 bra PLED_decoplan2 | |
2434 | |
2435 ;---- Additional time in the decoplan ? ------------------------------ | |
2436 movf decoplan_max,W ; Read array_decotime[6] | |
2437 movf PLUSW1,W ; set Z flag | |
2438 movwf lo ; and copy to lo | |
2439 btfsc STATUS,Z ; Zero: nothing to add. | |
2440 return | |
2441 | |
2442 WIN_LEFT .100 | |
2443 call PLED_standard_color | |
2444 | |
2445 STRCPY "add:" | |
2446 output_8 | |
2447 STRCAT_PRINT "'" | |
2448 return | |
2449 | |
2450 PLED_decoplan_0: | |
2451 ;---- Plan not finished to compute ? --------------------------------- | |
2452 decf decoplan_index,W | |
2453 movf PLUSW0,W ; array_decodepth[index-1] | |
2454 subwf decoplan_last,W ; == last stop depth ? | |
2455 bz PLED_decoplan_99 | |
2456 | |
2457 WIN_LEFT .100 | |
2458 call PLED_standard_color | |
2459 STRCPY_PRINT "..." | |
2460 | |
2461 PLED_decoplan_99: | |
2462 return | |
2463 | |
2464 ;----------------------------------------------------------------------------- | |
0 | 2465 PLED_gas_list: |
2466 ostc_debug 'm' ; Sends debug-information to screen if debugmode active | |
2467 | |
2468 WIN_LEFT .100 | |
2469 WIN_FONT FT_SMALL | |
2470 bsf leftbind | |
2471 | |
2472 movlw d'2' | |
2473 movwf wait_temp ; here: stores eeprom address for gas list | |
2474 movlw d'231' | |
71
6beb680a6130
1.72beta - color-coded gaslist, small fix with stopwatch
heinrichsweikamp
parents:
70
diff
changeset
|
2475 movwf waitms_temp ; here: stores row for gas list |
0 | 2476 clrf hi ; here: Gas counter |
2477 | |
2478 PLED_gas_list_loop: | |
2479 incf hi,F ; Increase Gas | |
2480 movlw d'4' | |
2481 addwf wait_temp,F ; Increase eeprom address for gas list | |
2482 movlw d'25' | |
2483 addwf waitms_temp,F ; Increase row | |
2484 WIN_LEFT .100 | |
2485 movff waitms_temp,win_top ; Set Row | |
2486 | |
123 | 2487 STRCPY "G" |
0 | 2488 movff hi,lo ; copy gas number |
2489 output_8 ; display gas number | |
123 | 2490 PUTC ':' |
0 | 2491 movff wait_temp, EEADR; Gas #hi: %O2 - Set address in internal EEPROM |
2492 call read_eeprom ; get byte (stored in EEDATA) | |
2493 movff EEDATA,lo ; copy to lo | |
2494 output_8 ; outputs into Postinc2! | |
123 | 2495 PUTC '/' |
0 | 2496 incf EEADR,F ; Gas #hi: %He - Set address in internal EEPROM |
2497 call read_eeprom ; get byte (stored in EEDATA) | |
2498 movff EEDATA,lo ; copy to lo | |
2499 output_8 ; outputs into Postinc2! | |
71
6beb680a6130
1.72beta - color-coded gaslist, small fix with stopwatch
heinrichsweikamp
parents:
70
diff
changeset
|
2500 |
6beb680a6130
1.72beta - color-coded gaslist, small fix with stopwatch
heinrichsweikamp
parents:
70
diff
changeset
|
2501 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
|
2502 call read_eeprom ; get byte (stored in EEDATA) |
6beb680a6130
1.72beta - color-coded gaslist, small fix with stopwatch
heinrichsweikamp
parents:
70
diff
changeset
|
2503 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
|
2504 ; Check if gas needs to be greyed-out (inactive) |
0 | 2505 read_int_eeprom d'27' ; read flag register |
2506 movff hi,lo ; copy gas number | |
2507 PLED_gas_list_loop1: | |
2508 rrcf EEDATA ; roll flags into carry | |
2509 decfsz lo,F ; max. 5 times... | |
2510 bra PLED_gas_list_loop1 | |
19 | 2511 |
2512 movlw color_grey | |
0 | 2513 btfss STATUS,C ; test carry |
19 | 2514 call PLED_set_color ; grey out inactive gases! |
0 | 2515 |
2516 call word_processor | |
19 | 2517 call PLED_standard_color |
0 | 2518 |
2519 movlw d'5' ; list all five gases | |
2520 cpfseq hi ; All gases shown? | |
2521 bra PLED_gas_list_loop ; No | |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
91
diff
changeset
|
2522 |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
91
diff
changeset
|
2523 DISPLAYTEXT d'122' ; Gas 6.. |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
91
diff
changeset
|
2524 |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
91
diff
changeset
|
2525 return ; return (OC mode) |
0 | 2526 |
2527 PLED_splist_start: | |
2528 WIN_LEFT .100 | |
2529 WIN_FONT FT_SMALL | |
2530 bsf leftbind | |
127 | 2531 call PLED_standard_color |
0 | 2532 |
2533 ; list three SP in Gaslist | |
2534 movlw d'35' ; 36 = current SP position in EEPROM | |
2535 movwf wait_temp ; here: stores eeprom address for gas list | |
2536 movlw d'231' | |
2537 movwf waitms_temp ; here: stores row for gas list | |
124 | 2538 clrf decoplan_index ; here: SP counter |
0 | 2539 |
2540 PLED_splist_loop: | |
2541 incf wait_temp,F ; EEPROM address | |
124 | 2542 incf decoplan_index,F ; Increase SP |
0 | 2543 |
2544 movlw d'25' | |
2545 addwf waitms_temp,F ; Increase row | |
2546 movff waitms_temp,win_top ; Set Row | |
2547 WIN_LEFT .100 | |
2548 | |
123 | 2549 STRCPY "SP" |
124 | 2550 movff decoplan_index,lo ; copy gas number |
0 | 2551 output_8 ; display gas number |
123 | 2552 PUTC ':' |
0 | 2553 movff wait_temp, EEADR; SP #hi position |
2554 call read_eeprom ; get byte (stored in EEDATA) | |
2555 movff EEDATA,lo ; copy to lo | |
2556 clrf hi | |
2557 output_16dp d'3' ; outputs into Postinc2! | |
2558 call word_processor | |
2559 | |
2560 movlw d'3' ; list all three SP | |
124 | 2561 cpfseq decoplan_index ; All gases shown? |
0 | 2562 bra PLED_splist_loop ; No |
2563 | |
2564 bcf leftbind | |
2565 return ; no, return | |
2566 | |
2567 PLED_clear_divemode_menu: | |
128 | 2568 WIN_BOX_BLACK .0, .168, .82, .160 |
0 | 2569 return |
2570 | |
2571 PLED_divemenu_cursor: | |
2572 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
|
2573 |
123 | 2574 WIN_BOX_BLACK .0, .150, .85, .95 |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
91
diff
changeset
|
2575 |
0 | 2576 WIN_TOP .0 |
2577 WIN_LEFT .85 | |
2578 WIN_FONT FT_SMALL | |
2579 WIN_INVERT .0 ; Init new Wordprocessor | |
3 | 2580 call PLED_standard_color |
84 | 2581 |
0 | 2582 movff menupos,temp1 |
2583 movlw d'0' | |
2584 dcfsnz temp1,F | |
2585 movlw d'0' | |
2586 dcfsnz temp1,F | |
2587 movlw d'25' | |
2588 dcfsnz temp1,F | |
2589 movlw d'50' | |
2590 dcfsnz temp1,F | |
2591 movlw d'75' | |
2592 dcfsnz temp1,F | |
2593 movlw d'100' | |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
91
diff
changeset
|
2594 dcfsnz temp1,F |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
91
diff
changeset
|
2595 movlw d'125' |
0 | 2596 movff WREG,win_top |
3 | 2597 |
129
06c4899ddb4b
Custom views in dive mode configrable (New CF50-CF53)
Heinrichsweikamp
parents:
127
diff
changeset
|
2598 STRCPY_PRINT "\xB7" ; Cursor |
0 | 2599 return |
2600 | |
128 | 2601 |
2602 ;============================================================================= | |
2603 ; Draw saturation graph, is surface mode or in dive mode. | |
2604 ; | |
0 | 2605 PLED_tissue_saturation_graph: |
2606 ostc_debug 'i' ; Sends debug-information to screen if debugmode active | |
13 | 2607 |
128 | 2608 ;---- Draw Frame --------------------------------------------------------- |
2609 btfsc divemode | |
2610 bra PLED_tsg_1 | |
2611 | |
2612 WIN_FRAME_STD .25, .120, .82, .159 ; Surfmode | |
2613 bra PLED_tsg_2 | |
2614 PLED_tsg_1: | |
2615 WIN_FRAME_STD .169, .239, .90, .159 ; Divemode | |
2616 PLED_tsg_2: | |
2617 | |
2618 ;---- Draw grid ---------------------------------------------------------- | |
133 | 2619 btfss divemode |
2620 bra PLED_no_graph_grid | |
2621 | |
128 | 2622 movlw color_grey |
2623 call PLED_set_color | |
2624 | |
2625 movlw .169+.1 ; divemode | |
2626 movff WREG,win_top | |
2627 movlw .239-.169-.1 ; divemode | |
2628 movff WREG,win_height | |
2629 | |
2630 movlw 1 | |
2631 movff WREG,win_width | |
2632 | |
2633 movlw .122 | |
2634 movff WREG,win_leftx2 | |
2635 call PLED_box | |
2636 movlw .131 | |
2637 movff WREG,win_leftx2 | |
2638 call PLED_box | |
2639 movlw .140 | |
2640 movff WREG,win_leftx2 | |
2641 call PLED_box | |
2642 movlw .149 | |
2643 movff WREG,win_leftx2 | |
2644 call PLED_box | |
133 | 2645 PLED_no_graph_grid: |
128 | 2646 |
2647 ;---- Draw N2 Tissues ---------------------------------------------------- | |
0 | 2648 lfsr FSR2, char_O_tissue_saturation+.000 ; N2 |
2649 movlw d'16' | |
128 | 2650 movwf wait_temp ; 16 tissues |
2651 clrf waitms_temp ; Row offset | |
2652 | |
2653 call PLED_standard_color | |
123 | 2654 movlw .1 |
2655 movff WREG,win_height ; row bottom (0-239) | |
128 | 2656 movlw .82+.18 ; surfmode |
2657 btfsc divemode | |
133 | 2658 movlw .90+.18 ; divemode |
123 | 2659 movff WREG,win_leftx2 ; column left (0-159) |
2660 | |
0 | 2661 PLED_tissue_saturation_graph3: |
128 | 2662 movlw .25+3 ; surfmode: 3pix below top border |
2663 btfsc divemode | |
2664 movlw .169+3 ; divemode | |
0 | 2665 addwf waitms_temp,W |
123 | 2666 movff WREG,win_top ; row top (0-239) |
0 | 2667 |
2668 incf waitms_temp,F | |
2669 incf waitms_temp,F | |
2670 | |
123 | 2671 movf POSTINC2,W |
2672 bcf STATUS,C ; Clear carry | |
2673 rrcf WREG ; And divide by 4 | |
0 | 2674 bcf STATUS,C |
123 | 2675 rrcf WREG |
133 | 2676 movwf temp1 |
2677 | |
2678 movlw .57 ; surfmode: max 57pix | |
2679 btfsc divemode | |
2680 movlw .57-8 ; divemode: 8pix less...s | |
2681 cpfslt temp1 ; skip if 57 (WREG) < win_width | |
2682 movwf temp1 | |
2683 movff temp1,win_width | |
0 | 2684 |
2685 call PLED_box | |
2686 | |
2687 decfsz wait_temp,F | |
2688 bra PLED_tissue_saturation_graph3 | |
2689 | |
128 | 2690 ;---- Draw He Tissues ---------------------------------------------------- |
0 | 2691 lfsr FSR2, char_O_tissue_saturation+.016 ; He |
2692 movlw d'16' | |
128 | 2693 movwf wait_temp ; 16 tissues |
2694 clrf waitms_temp ; Row offset | |
123 | 2695 |
0 | 2696 PLED_tissue_saturation_graph2: |
123 | 2697 |
128 | 2698 movlw .120-.33 ; surfmode : 33pix above bottom border |
2699 btfsc divemode | |
2700 movlw .239-.33 ; divemode | |
0 | 2701 addwf waitms_temp,W |
123 | 2702 movff WREG,win_top ; row top (0-239) |
0 | 2703 |
2704 incf waitms_temp,F | |
2705 incf waitms_temp,F | |
2706 | |
123 | 2707 movf POSTINC2,W |
2708 bcf STATUS,C ; Clear carry | |
2709 rrcf WREG ; And divide by 4 | |
0 | 2710 bcf STATUS,C |
123 | 2711 rrcf WREG |
133 | 2712 movwf temp1 |
2713 movlw .57 ; surfmode: max 57pix | |
2714 btfsc divemode | |
2715 movlw .57-8 ; divemode: 8pix less...s | |
2716 cpfslt temp1 ; skip if 57 (WREG) < win_width | |
2717 movwf temp1 | |
2718 movff temp1,win_width | |
0 | 2719 |
2720 call PLED_box | |
2721 | |
2722 decfsz wait_temp,F | |
2723 bra PLED_tissue_saturation_graph2 | |
2724 | |
128 | 2725 ;---- Draw N2/He Text ---------------------------------------------------- |
2726 movlw .82+2 ; surfmode: 2pix right of left border | |
2727 btfsc divemode | |
2728 movlw .90+2 ; divemode | |
2729 movff WREG,win_leftx2 | |
2730 | |
2731 movlw .25+7 ; surfmode: 7pix below top border | |
2732 btfsc divemode | |
2733 movlw .169+7 ; divemode | |
2734 movff WREG,win_top | |
123 | 2735 STRCPY_PRINT "N2" |
2736 | |
128 | 2737 movlw .120-.30 ; surfmode: 30pix above bottom border |
2738 btfsc divemode | |
2739 movlw .239-.30 ; divemode | |
2740 movff WREG,win_top | |
123 | 2741 STRCPY_PRINT "He" |
128 | 2742 |
2743 ;---- Draw scale and O2[16]% --------------------------------------------- | |
2744 btfsc divemode | |
2745 return | |
19 | 2746 |
2747 movff char_O_gtissue_no,wait_temp ; used as temp | |
2748 | |
2749 lfsr FSR1,char_O_tissue_saturation+0 | |
2750 incf wait_temp,F ; make 1-16 of 0-15 | |
123 | 2751 |
19 | 2752 PLED_tissue_saturation_graph4: ; point to leading tissue... |
2753 movff POSTINC1,lo ; copy/overwrite to lo register | |
2754 decfsz wait_temp,F ; count until zero | |
2755 bra PLED_tissue_saturation_graph4 ;loop | |
123 | 2756 |
19 | 2757 WIN_TOP .62 |
2758 WIN_FONT FT_SMALL | |
128 | 2759 lfsr FSR2,letter |
2760 bsf leftbind | |
2761 output_8 | |
19 | 2762 bcf leftbind |
2763 | |
128 | 2764 STRCAT_PRINT "% " |
2765 | |
2766 ;---- Draw Scale --------------------------------------------------------- | |
123 | 2767 WIN_BOX_STD .73, .74, .121, .157 |
2768 WIN_BOX_STD .61, .84, .121, .122 | |
2769 WIN_BOX_STD .65, .80, .130, .131 | |
2770 WIN_BOX_STD .65, .80, .139, .140 | |
2771 WIN_BOX_STD .65, .80, .148, .149 | |
2772 WIN_BOX_STD .61, .84, .157, .158 | |
0 | 2773 return |
2774 | |
128 | 2775 ;============================================================================= |
2776 | |
0 | 2777 PLED_startupscreen1: |
2778 call PLED_topline_box | |
2779 WIN_INVERT .1 ; Init new Wordprocessor | |
2780 DISPLAYTEXT d'3' ; "HeinrichsWeikamp" | |
2781 WIN_INVERT .0 ; Init new Wordprocessor | |
2782 DISPLAYTEXT .68 ; Licence 1/2 | |
2783 DISPLAYTEXT .69 | |
2784 DISPLAYTEXT .70 | |
2785 DISPLAYTEXT .71 | |
2786 DISPLAYTEXT .72 | |
2787 DISPLAYTEXT .73 | |
2788 DISPLAYTEXT .74 | |
2789 return | |
2790 | |
2791 PLED_startupscreen2: | |
2792 call PLED_topline_box | |
2793 WIN_INVERT .1 ; Init new Wordprocessor | |
2794 DISPLAYTEXT d'3' ; "HeinrichsWeikamp" | |
2795 WIN_INVERT .0 ; Init new Wordprocessor | |
2796 DISPLAYTEXT .75 ; Licence 2/2 | |
2797 DISPLAYTEXT .76 | |
2798 DISPLAYTEXT .77 | |
2799 DISPLAYTEXT .78 | |
2800 DISPLAYTEXT .79 | |
2801 DISPLAYTEXT .80 | |
2802 DISPLAYTEXT .81 | |
2803 return | |
2804 | |
2805 PLED_new_cf_warning: | |
2806 call PLED_topline_box | |
2807 WIN_INVERT .1 ; Init new Wordprocessor | |
2808 DISPLAYTEXTH .271 ; New CF added! | |
2809 WIN_INVERT .0 ; Init new Wordprocessor | |
2810 DISPLAYTEXTH .272 ; New CustomFunctions | |
2811 DISPLAYTEXTH .273 ; were added! Check | |
2812 DISPLAYTEXTH .274 ; CF I and CF II Menu | |
2813 DISPLAYTEXTH .275 ; for Details! | |
2814 return | |
2815 | |
2816 PLED_const_ppO2_value: | |
2817 btfsc multi_gf_display ; Is the Multi-GF Table displayed? | |
2818 return ; Yes, No update and return! | |
2819 | |
2820 ostc_debug 'j' ; Sends debug-information to screen if debugmode active | |
2821 | |
2822 WIN_TOP .168 | |
75 | 2823 WIN_LEFT .50 |
0 | 2824 WIN_FONT FT_SMALL |
2825 WIN_INVERT .0 ; Init new Wordprocessor | |
4 | 2826 |
0 | 2827 lfsr FSR2,letter |
2828 movff char_I_const_ppO2,lo | |
2829 | |
2830 tstfsz lo ; In Bailout mode (char_I_const_ppO2=0)? | |
2831 bra PLED_const_ppO2_value2 ; No, display Setpoint | |
2832 | |
2833 ; Yes, Display "Bail" | |
27
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
2834 call PLED_standard_color |
0 | 2835 OUTPUTTEXTH d'263' ;"Bail" |
2836 call word_processor | |
2837 return | |
2838 | |
2839 PLED_const_ppO2_value2: ; Display SetPoint | |
2840 ;Show fixed SP value | |
4 | 2841 movff amb_pressure+0,xA+0 |
2842 movff amb_pressure+1,xA+1 | |
2843 movlw d'10' | |
2844 movwf xB+0 | |
2845 clrf xB+1 | |
2846 ;xA/xB=xC with xA as remainder | |
2847 call div16x16 ; xC+0=p_amb/10 | |
26 | 2848 |
4 | 2849 ; char_I_const_ppO2 > p_amb/10 -> Not physically possible! -> Display actual value! |
2850 tstfsz xC+1 ; xC>255 | |
2851 setf xC+0 ; Yes, set xC+0 to 2,55bar ppO2 | |
26 | 2852 |
4 | 2853 movff ppO2_setpoint_store,WREG |
2854 cpfslt xC+0 ; Setpoint value possible? | |
26 | 2855 bra PLED_const_ppO2_value1 ; Yes |
4 | 2856 |
2857 movff xC+0,char_I_const_ppO2 ; No, Overwrite with actual value | |
2858 bra PLED_const_ppO2_value1a | |
2859 | |
2860 PLED_const_ppO2_value1: | |
26 | 2861 ; char_I_const_ppO2 < ppO2[Diluent] -> Not physically possible! -> Display actual value! |
2862 movff amb_pressure+0,xA+0 | |
2863 movff amb_pressure+1,xA+1 | |
2864 movlw d'10' | |
2865 movwf xB+0 | |
2866 clrf xB+1 | |
2867 call div16x16 ; xC=p_amb/10 | |
2868 movff xC+0,xA+0 | |
2869 movff xC+1,xA+1 | |
2870 movff char_I_O2_ratio,xB+0 | |
2871 clrf xB+1 | |
2872 call mult16x16 ; xC:2=char_I_O2_ratio * p_amb/10 | |
2873 | |
2874 movff xC+0,sub_b+0 | |
2875 movff xC+1,sub_b+1 | |
2876 movff ppO2_setpoint_store,WREG; Setpoint | |
2877 mullw d'100' ; Setpoint*100 | |
2878 movff PRODL,sub_a+0 | |
2879 movff PRODH,sub_a+1 | |
2880 call sub16 ; sub_c = sub_a - sub_b | |
2881 | |
2882 btfss neg_flag | |
2883 bra PLED_const_ppO2_value11 ; Value in range | |
2884 | |
2885 ; char_I_const_ppO2 < ppO2[Diluent] -> Not physically possible! -> Display actual value! | |
2886 | |
2887 movff xC+0,xA+0 | |
2888 movff xC+1,xA+1 | |
2889 movlw d'100' | |
2890 movwf xB+0 | |
2891 clrf xB+1 | |
2892 call div16x16 ;xA/xB=xC with xA as remainder | |
2893 | |
2894 movff xC+0,char_I_const_ppO2 ; No, Overwrite with actual value | |
138 | 2895 |
2896 GETCUSTOM8 d'39' ; Adjust fixed SP? | |
2897 dcfsnz WREG,F | |
2898 bra PLED_const_ppO2_value1a ; Yes! | |
2899 ; Do not adjust -> restore original SetPoint | |
26 | 2900 |
2901 PLED_const_ppO2_value11: | |
2902 ; Setpoint in possible limits | |
4 | 2903 movff ppO2_setpoint_store,char_I_const_ppO2 ; Restore Setpoint |
2904 | |
2905 PLED_const_ppO2_value1a: | |
27
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
2906 PLED_color_code warn_ppo2 ; Color-code output |
4 | 2907 movff char_I_const_ppO2,lo |
0 | 2908 clrf hi |
2909 bsf leftbind | |
2910 output_16dp d'3' | |
2911 bcf leftbind | |
2912 call word_processor | |
27
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
2913 call PLED_standard_color |
0 | 2914 return |
2915 | |
2916 PLED_show_leading_tissue: | |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
91
diff
changeset
|
2917 call PLED_divemask_color ; Set Color for Divemode mask |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
91
diff
changeset
|
2918 DISPLAYTEXTH .282 ; L. Tissue: |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
91
diff
changeset
|
2919 PLED_show_leading_tissue_2: |
116 | 2920 call deco_calc_desaturation_time ; calculate desaturation time |
0 | 2921 movlb b'00000001' ; select ram bank 1 |
2922 | |
123 | 2923 STRCPY "#" |
0 | 2924 movff char_O_gtissue_no,lo |
2925 movff char_O_gtissue_no,wait_temp ; used as temp | |
2926 bsf leftbind | |
2927 output_8 | |
123 | 2928 STRCAT " (" |
0 | 2929 |
2930 movlw d'16' | |
2931 cpfslt wait_temp | |
2932 bra PLED_show_leading_tissue_he | |
123 | 2933 STRCAT "N2" |
0 | 2934 bra PLED_show_leading_tissue2 |
123 | 2935 |
0 | 2936 PLED_show_leading_tissue_he: |
123 | 2937 STRCAT "He" |
2938 | |
0 | 2939 PLED_show_leading_tissue2: |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
91
diff
changeset
|
2940 WIN_LEFT .95 |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
91
diff
changeset
|
2941 WIN_TOP .192 |
0 | 2942 WIN_FONT FT_SMALL |
3 | 2943 call PLED_standard_color |
123 | 2944 |
2945 STRCAT_PRINT ") " | |
2946 | |
0 | 2947 lfsr FSR1,char_O_tissue_saturation+0 |
2948 incf wait_temp,F ; make 1-16 of 0-15 | |
2949 PLED_show_leading_tissue3: ; point to leading tissue... | |
2950 movff POSTINC1,lo ; copy/overwrite to lo register | |
2951 decfsz wait_temp,F ; count until zero | |
2952 bra PLED_show_leading_tissue3 ;loop | |
123 | 2953 |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
91
diff
changeset
|
2954 WIN_LEFT .95 |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
91
diff
changeset
|
2955 WIN_TOP .216 |
0 | 2956 WIN_FONT FT_SMALL |
123 | 2957 |
2958 lfsr FSR2,letter | |
2959 output_8 | |
2960 STRCAT_PRINT "% " | |
0 | 2961 bcf leftbind |
2962 return | |
2963 | |
2964 PLED_topline_box_clear: ; Writes an empty box | |
2965 movlw .0 | |
2966 bra PLED_topline_box2 | |
98
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
91
diff
changeset
|
2967 PLED_topline_box: ; Writes a filled box... |
6f8e3a08011e
1.73beta rc1 (Added new customview for divemode)
heinrichsweikamp
parents:
91
diff
changeset
|
2968 GETCUSTOM8 d'35' ; ... with the standard color |
0 | 2969 PLED_topline_box2: |
123 | 2970 WIN_BOX_COLOR .0, .26, .0, .159 |
0 | 2971 return |
2972 | |
2973 PLED_display_cns: | |
2974 btfsc multi_gf_display ; Is the Multi-GF Table displayed? | |
2975 return ; Yes, No update and return! | |
2976 | |
2977 btfsc gauge_mode ; Do not display in gauge mode | |
2978 return | |
2979 | |
2980 btfsc FLAG_apnoe_mode ; Do not display in apnoe mode | |
2981 return | |
2982 | |
2983 btfsc pled_velocity_display ; Is velocity displayed?` | |
2984 return ; Yes, do not overwrite until pled_velocity_clear was called | |
2985 | |
2986 ostc_debug 'k' ; Sends debug-information to screen if debugmode active | |
2987 | |
2988 WIN_TOP .090 | |
2989 WIN_LEFT .0 | |
2990 WIN_FONT FT_SMALL | |
27
29341afd2060
NEW: Depth, CNS, GF, ppO2 and Velocity are Color-coded
heinrichsweikamp
parents:
26
diff
changeset
|
2991 PLED_color_code warn_cns ; Color-code CNS output |
0 | 2992 |
123 | 2993 STRCPY "CNS:" |
0 | 2994 movff char_O_CNS_fraction,lo |
2995 bsf leftbind | |
2996 output_8 | |
2997 bcf leftbind | |
123 | 2998 STRCAT_PRINT "%" |
0 | 2999 return |
3000 | |
43 | 3001 PLED_display_cns_surface: |
3002 ; Check if CNS should be displayed | |
3003 movff char_O_CNS_fraction,lo ; copy into bank1 | |
3004 GETCUSTOM8 d'15' ; cns_display_high_surfacemode | |
3005 subwf lo,W | |
3006 btfss STATUS,C | |
3007 return ; Do not show... | |
3008 ; Show CNS | |
3009 | |
3010 ostc_debug 'W' ; Sends debug-information to screen if debugmode active | |
3011 | |
3012 WIN_TOP .175 | |
3013 WIN_LEFT .45 | |
3014 WIN_FONT FT_SMALL | |
3015 WIN_INVERT .0 ; Init new Wordprocessor | |
3016 PLED_color_code warn_cns ; Color-code CNS output | |
3017 | |
123 | 3018 STRCPY "CNS:" |
43 | 3019 movff char_O_CNS_fraction,lo |
3020 bsf leftbind | |
3021 output_8 | |
3022 bcf leftbind | |
123 | 3023 STRCAT_PRINT "%" |
43 | 3024 return |
3025 | |
3026 | |
0 | 3027 PLED_custom_text: |
3028 read_int_eeprom d'64' | |
3029 movlw d'1' | |
3030 cpfseq EEDATA ; Custom text active? | |
3031 bra PLED_clear_custom_text ; No, Delete row | |
3032 WIN_TOP .200 | |
62 | 3033 WIN_LEFT .0 |
0 | 3034 WIN_FONT FT_SMALL |
3035 WIN_INVERT .0 ; Init new Wordprocessor | |
9 | 3036 call PLED_divemask_color ; Set Color for Divemode mask |
0 | 3037 |
3038 lfsr FSR2,letter | |
3039 movlw d'64' | |
3040 movwf lo | |
3041 movlw d'24' | |
3042 movwf hi ; counter | |
3043 | |
3044 PLED_custom_text1: | |
3045 incf lo,F | |
3046 call PLED_get_custom_letter ; Get one letter for the custom text | |
3047 movlw '}' ; End marker found? | |
3048 cpfseq EEDATA | |
3049 bra PLED_custom_text2 ; No | |
3050 bra PLED_custom_text3 | |
3051 PLED_custom_text2: | |
3052 movff EEDATA,POSTINC2 ; Copy into Postinc | |
3053 | |
3054 decfsz hi,F ; Max. numbers? | |
3055 bra PLED_custom_text1 ; No, get next letters | |
3056 | |
3057 PLED_custom_text3: | |
3058 call word_processor | |
3 | 3059 call PLED_standard_color |
0 | 3060 return |
3061 | |
3062 PLED_get_custom_letter: | |
3063 movff lo,EEADR ; Address for next custom text letter | |
3064 call read_eeprom ; Read letter | |
3065 return | |
3066 | |
3067 PLED_clear_custom_text: | |
3068 movlw d'24' | |
3069 movwf temp1 | |
3070 WIN_TOP .200 | |
3071 WIN_LEFT .0 | |
3072 call PLED_display_clear_common_y1 | |
3073 return | |
3074 | |
33 | 3075 PLED_simdata_screen: ;Display Pre-Dive Screen |
3076 ; List active gases/Setpoints | |
3077 btfsc FLAG_const_ppO2_mode ; in ppO2 mode? | |
3078 bra PLED_simdata_screen3 ; Yes, display SetPoint/Sensor result list | |
3079 | |
3080 PLED_simdata_screen2: | |
3081 ostc_debug 'm' ; Sends debug-information to screen if debugmode active | |
3082 | |
3083 WIN_LEFT .0 | |
3084 WIN_FONT FT_SMALL | |
3085 bsf leftbind | |
3086 | |
3087 movlw d'2' | |
3088 movwf wait_temp ; here: stores eeprom address for gas list | |
34 | 3089 movlw d'10' |
33 | 3090 movwf waitms_temp ; here: stores row for gas list |
3091 clrf hi ; here: Gas counter | |
3092 | |
3093 PLED_simdata_screen2_loop: | |
3094 incf hi,F ; Increase Gas | |
3095 movlw d'4' | |
3096 addwf wait_temp,F ; Increase eeprom address for gas list | |
3097 | |
123 | 3098 STRCPY "G" |
33 | 3099 movff hi,lo ; copy gas number |
3100 output_8 ; display gas number | |
123 | 3101 PUTC ':' |
33 | 3102 movff wait_temp, EEADR; Gas #hi: %O2 - Set address in internal EEPROM |
3103 call read_eeprom ; get byte (stored in EEDATA) | |
3104 movff EEDATA,lo ; copy to lo | |
3105 output_8 ; outputs into Postinc2! | |
123 | 3106 PUTC '/' |
33 | 3107 incf EEADR,F ; Gas #hi: %He - Set address in internal EEPROM |
3108 call read_eeprom ; get byte (stored in EEDATA) | |
3109 movff EEDATA,lo ; copy to lo | |
3110 output_8 ; outputs into Postinc2! | |
123 | 3111 PUTC ' ' |
34 | 3112 movf hi,W ; Gas number |
3113 addlw d'27' ; -> Adress of change depth register | |
3114 call read_int_eeprom_1 | |
3115 movff EEDATA,lo ; Change depth in m | |
3116 output_99 ; outputs into Postinc2! | |
123 | 3117 PUTC 'm' |
33 | 3118 read_int_eeprom d'27' ; read flag register |
3119 movff hi,lo ; copy gas number | |
3120 PLED_simdata_screen2_loop1: | |
3121 rrcf EEDATA ; roll flags into carry | |
3122 decfsz lo,F ; max. 5 times... | |
3123 bra PLED_simdata_screen2_loop1 | |
3124 | |
3125 btfsc STATUS,C ; test carry | |
3126 bra PLED_simdata_white | |
3127 | |
3128 movlw color_grey | |
3129 call PLED_set_color ; grey out inactive gases! | |
3130 bra PLED_simdata_color_done | |
3131 | |
3132 PLED_simdata_white: | |
3133 call PLED_standard_color | |
3134 | |
3135 PLED_simdata_color_done: | |
3136 movlw d'25' | |
3137 addwf waitms_temp,F ; Increase row | |
3138 WIN_LEFT .0 | |
3139 movff waitms_temp,win_top ; Set Row | |
34 | 3140 call word_processor ; display gas |
33 | 3141 |
3142 PLED_simdata_screen2b: | |
3143 call PLED_standard_color | |
3144 | |
34 | 3145 movlw d'5' ; list all five gases |
33 | 3146 cpfseq hi ; All gases shown? |
3147 bra PLED_simdata_screen2_loop ; No | |
3148 | |
3149 return ; No, return (OC mode) | |
3150 | |
3151 PLED_simdata_screen3: | |
3152 WIN_LEFT .0 | |
3153 WIN_FONT FT_SMALL | |
3154 bsf leftbind | |
3155 | |
3156 ; list three SP in Gaslist | |
3157 movlw d'35' ; 36 = current SP position in EEPROM | |
3158 movwf wait_temp ; here: stores eeprom address for gas list | |
34 | 3159 movlw d'10' |
33 | 3160 movwf waitms_temp ; here: stores row for gas list |
124 | 3161 clrf decoplan_index ; here: SP counter |
33 | 3162 |
3163 PLED_simdata_screen3_loop: | |
3164 incf wait_temp,F ; EEPROM address | |
124 | 3165 incf decoplan_index,F ; Increase SP |
33 | 3166 |
3167 movlw d'25' | |
3168 addwf waitms_temp,F ; Increase row | |
3169 WIN_LEFT .0 | |
3170 movff waitms_temp,win_top ; Set Row | |
3171 | |
123 | 3172 STRCPY "SP" |
124 | 3173 movff decoplan_index,lo ; copy gas number |
33 | 3174 output_8 ; display gas number |
123 | 3175 STRCAT ": " |
33 | 3176 movff wait_temp, EEADR; SP #hi position |
3177 call read_eeprom ; get byte (stored in EEDATA) | |
3178 movff EEDATA,lo ; copy to lo | |
3179 clrf hi | |
3180 output_16dp d'3' ; outputs into Postinc2! | |
3181 call word_processor | |
3182 | |
3183 movlw d'3' ; list all three SP | |
124 | 3184 cpfseq decoplan_index ; All gases shown? |
33 | 3185 bra PLED_simdata_screen3_loop ;no |
3186 | |
3187 read_int_eeprom d'33' ; Read byte (stored in EEDATA) | |
3188 movff EEDATA,active_gas ; Read start gas (1-5) | |
3189 decf active_gas,W ; Gas 0-4 | |
3190 mullw d'4' | |
3191 movf PRODL,W | |
3192 addlw d'7' ; = address for He ratio | |
3193 movwf EEADR | |
3194 call read_eeprom ; Read He ratio | |
3195 movff EEDATA,hi ; And copy into hold register | |
3196 decf active_gas,W ; Gas 0-4 | |
3197 mullw d'4' | |
3198 movf PRODL,W | |
3199 addlw d'6' ; = address for O2 ratio | |
3200 movwf EEADR | |
3201 call read_eeprom ; Read O2 ratio | |
3202 movff EEDATA, lo ; O2 ratio | |
3203 | |
3204 WIN_LEFT .0 | |
34 | 3205 WIN_TOP .110 |
123 | 3206 |
3207 STRCPY "Dil:" | |
33 | 3208 output_8 ; O2 Ratio |
123 | 3209 STRCAT "/" |
33 | 3210 movff hi,lo |
3211 output_8 ; He Ratio | |
3212 call word_processor | |
3213 | |
3214 bcf leftbind | |
3215 return ; Return (CC Mode) | |
3216 | |
0 | 3217 |
3218 | |
3219 adjust_depth_with_salinity: ; computes salinity setting into lo:hi [mBar] | |
3220 | |
3221 btfsc simulatormode_active ; Do apply salinity in Simulatormode | |
3222 return | |
3223 | |
3224 read_int_eeprom d'26' ; Read Salinity from EEPROM | |
3225 movff EEDATA, wait_temp ; salinity | |
3226 | |
3227 movlw d'105' ; 105% ? | |
3228 cpfslt wait_temp ; Salinity higher limit | |
3229 return ; Out of limit, do not adjust lo:hi | |
3230 | |
3231 movlw d'99' ; 99% ? | |
3232 cpfsgt wait_temp ; Salinity lower limit | |
3233 return ; Out of limit, do not adjust lo:hi | |
3234 | |
3235 movff lo,xA+0 | |
3236 movff hi,xA+1 | |
3237 | |
3238 movlw d'100' | |
3239 movwf xB+0 | |
3240 clrf xB+1 | |
3241 | |
3242 call mult16x16 ;xA*xB=xC (lo:hi * 100) | |
3243 | |
3244 movff wait_temp,xB+0 ; Salinity | |
3245 clrf xB+1 | |
3246 | |
3247 call div32x16 ; xC:4 / xB:2 = xC+3:xC+2 with xC+1:xC+0 as remainder | |
3248 | |
3249 movff xC+0,lo | |
3250 movff xC+1,hi ; restore lo and hi with updated value | |
3251 | |
3252 return |