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