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