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