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