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