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