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