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