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