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