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