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