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