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