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