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