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