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