Mercurial > public > mk2
annotate code_part1/OSTC_code_asm_part1/menu_gassetup.asm @ 39:1705b3f7e5b3
1.62 beta rc2
author | heinrichsweikamp |
---|---|
date | Tue, 01 Jun 2010 12:23:17 +0200 |
parents | 3c38ba950dfb |
children | 3ab1188651af |
rev | line source |
---|---|
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 ; Gas Setup menu | |
20 ; written by: Matthias Heinrichs, info@heinrichsweikamp.com | |
21 ; written: 10/08/07 | |
22 ; last updated: 080906 | |
23 ; known bugs: | |
24 ; ToDo: | |
25 | |
26 menu_gassetup: | |
27 movlw d'1' | |
28 movwf menupos | |
29 | |
30 menu_gassetup_prelist: | |
36
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
31 call PLED_ClearScreen |
35 | 32 call gassetup_sort_gaslist ; Sorts Gaslist according to change depth |
0 | 33 clrf timeout_counter2 |
34 bcf sleepmode | |
35 bcf menubit2 | |
36 bcf menubit3 | |
37 call PLED_topline_box | |
38 WIN_INVERT .1 ; Init new Wordprocessor | |
39 DISPLAYTEXT .106 ; Gas List | |
40 WIN_INVERT .0 ; Init new Wordprocessor | |
41 clrf decodata+0 ; Here: # of gas 0-4 | |
42 clrf divemins+0 ; Here: # of Gas * 4 | |
43 movlw d'5' | |
44 movwf waitms_temp ; here: stores row for gas list | |
45 movlw d'2' | |
46 movwf wait_temp ; here: stores eeprom address for gas list | |
47 | |
48 ; Changed v1.44se | |
49 menu_gassetup_list: | |
50 WIN_LEFT .20 | |
51 movlw d'4' | |
52 addwf wait_temp,F ; Increase eeprom address for gas list | |
53 movlw d'30' | |
54 addwf waitms_temp,F ; Increase row | |
55 movf waitms_temp,W ; Load row into WREG | |
56 movff WREG,win_top | |
57 lfsr FSR2,letter | |
58 movlw 'G' | |
59 movwf POSTINC2 | |
60 movff decodata+0,lo | |
61 incf lo,F | |
62 bsf leftbind | |
63 output_99 | |
64 movlw ':' | |
65 movwf POSTINC2 | |
66 | |
67 call menu_gassetup_grey_inactive ; Sets Greyvalue for inactive gases | |
68 call word_processor | |
69 WIN_LEFT .40 | |
70 movf waitms_temp,W ; Load row into WREG | |
71 movff WREG,win_top | |
72 lfsr FSR2,letter | |
73 | |
74 movlw d'33' | |
75 movwf EEADR | |
76 call read_eeprom ; Get current startgas 1-5 # into EEDATA | |
77 decf EEDATA,W ; 0-4 | |
78 cpfseq decodata+0 ; =current displayed gas #? | |
79 bra menu_gassetup_Tx ; no, do not display * | |
80 movlw '*' ; display * | |
81 movwf POSTINC2 | |
82 | |
83 ; New v1.44se | |
84 menu_gassetup_Tx: | |
85 call menu_gassetup_grey_inactive ; Sets Greyvalue for inactive gases | |
86 call word_processor | |
87 | |
88 WIN_LEFT .48 | |
89 movf waitms_temp,W ; Load row into WREG | |
90 movff WREG,win_top | |
91 lfsr FSR2,letter | |
92 | |
93 movff wait_temp, EEADR ; Gas %He - Set address in internal EEPROM | |
94 incf EEADR,F ; Gas %He - Set address in internal EEPROM | |
95 call read_eeprom ; Read He value from EEPROM | |
96 movff EEDATA,lo ; Move EEDATA -> lo | |
97 movf lo,f ; Move lo -> f | |
98 movlw d'0' ; Move 0 -> WREG | |
99 cpfsgt lo ; He > 0? | |
100 bra menu_gassetup_Nx ; NO check o2 | |
101 | |
102 ; YES Write TX 15/55 | |
103 call gassetup_write_Tx | |
104 movff wait_temp, EEADR ; Gas %O2 - Set address in internal EEPROM | |
105 call read_eeprom ; O2 value | |
106 movff EEDATA,lo | |
107 output_8 | |
108 movlw '/' | |
109 movwf POSTINC2 | |
110 incf EEADR,F ; Gas #hi: %He - Set address in internal EEPROM | |
111 call read_eeprom ; He value | |
112 movff EEDATA,lo | |
113 output_8 | |
114 bra menu_gassetup_list0 | |
115 | |
116 ; New v1.44se | |
117 menu_gassetup_Nx: | |
118 movff wait_temp, EEADR ; Gas %O2 - Set address in internal EEPROM | |
119 call read_eeprom ; Read O2 value from EEPROM | |
120 movff EEDATA,lo ; Move EEDATA -> lo | |
121 movf lo,f ; Move lo -> f | |
122 movlw d'21' ; Move 21 -> WREG | |
123 cpfsgt lo ; o2 > 21% | |
124 bra menu_gassetup_Air ; NO AIR | |
125 movlw d'100' ; Move 100 -> WREG | |
126 cpfslt lo ; o2 < 100% | |
127 bra menu_gassetup_O2 ; NO write O2 | |
128 | |
129 ; YES Write NX 32 | |
130 call gassetup_write_Nx | |
131 output_8 | |
132 bra menu_gassetup_list0 | |
133 | |
134 ; New v1.44se | |
135 menu_gassetup_O2: | |
136 movlw 'O' | |
137 movwf POSTINC2 | |
138 movlw '2' | |
139 movwf POSTINC2 | |
140 movlw ' ' | |
141 movwf POSTINC2 | |
142 output_8 | |
143 bra menu_gassetup_list0 | |
144 | |
145 ; New v1.44se | |
146 menu_gassetup_Air: | |
147 cpfseq lo ; o2 = 21% | |
148 call menu_gassetup_Err | |
149 | |
150 movlw 'A' | |
151 movwf POSTINC2 | |
152 movlw 'I' | |
153 movwf POSTINC2 | |
154 movlw 'R' | |
155 movwf POSTINC2 | |
156 movlw ' ' | |
157 movwf POSTINC2 | |
158 output_8 | |
159 bra menu_gassetup_list0 | |
160 | |
161 ; New v1.44se | |
162 menu_gassetup_Err: | |
163 movlw 'E' | |
164 movwf POSTINC2 | |
165 movlw 'R' | |
166 movwf POSTINC2 | |
167 movlw 'R' | |
168 movwf POSTINC2 | |
169 movlw ' ' | |
170 movwf POSTINC2 | |
171 output_8 | |
172 | |
173 ; Changed v1.44se | |
174 menu_gassetup_list0: | |
175 call menu_gassetup_grey_inactive ; Sets Greyvalue for inactive gases | |
176 call word_processor | |
177 | |
178 WIN_LEFT .105 | |
179 movf waitms_temp,W ; Load row into WREG | |
180 movff WREG,win_top | |
181 lfsr FSR2,letter | |
182 | |
183 movlw ' ' | |
184 movwf POSTINC2 | |
185 movlw 'i' | |
186 movwf POSTINC2 | |
187 movlw 'n' | |
188 movwf POSTINC2 | |
189 movlw ' ' | |
190 movwf POSTINC2 | |
191 movf decodata+0,W ; read current value | |
192 addlw d'28' ; offset in memory | |
193 movwf EEADR | |
194 call read_eeprom ; Low-value | |
195 movff EEDATA,lo | |
196 output_8 | |
197 movlw 'm' | |
198 movwf POSTINC2 | |
199 call menu_gassetup_grey_inactive ; Sets Greyvalue for inactive gases | |
200 call word_processor | |
201 | |
3 | 202 call PLED_standard_color |
0 | 203 |
204 incf decodata+0,F | |
205 movlw d'5' | |
206 cpfseq decodata+0 | |
207 goto menu_gassetup_list | |
208 | |
209 DISPLAYTEXT .11 ; Exit | |
210 call wait_switches ; Waits until switches are released, resets flag if button stays pressed! | |
211 call PLED_menu_cursor | |
212 | |
213 gassetup_list_loop: | |
214 call check_switches_logbook | |
215 | |
216 btfsc menubit3 | |
217 bra gassetup_list2 ; move cursor | |
218 | |
219 btfsc menubit2 | |
220 bra do_gassetup_list; call gas-specific submenu | |
221 | |
222 btfsc divemode | |
223 goto restart ; dive started! | |
224 | |
225 btfsc onesecupdate | |
226 call timeout_surfmode | |
227 | |
228 btfsc onesecupdate | |
229 call set_dive_modes | |
230 | |
231 bcf onesecupdate ; 1 sec. functions done | |
232 | |
233 btfsc sleepmode | |
234 bra exit_gassetup_list | |
235 | |
236 bra gassetup_list_loop | |
237 | |
238 gassetup_list2: | |
239 incf menupos,F | |
240 movlw d'7' | |
241 cpfseq menupos ; =7? | |
242 bra gassetup_list3 ; No | |
243 movlw d'1' | |
244 movwf menupos | |
245 | |
246 gassetup_list3: | |
247 clrf timeout_counter2 | |
248 call PLED_menu_cursor | |
249 | |
250 call wait_switches ; Waits until switches are released, resets flag if button stays pressed! | |
251 | |
252 bcf menubit3 ; clear flag | |
253 bra gassetup_list_loop | |
254 | |
255 exit_gassetup_list: ; exit... | |
256 movlw d'2' | |
257 movwf menupos | |
258 goto menu2 | |
259 | |
260 do_gassetup_list: | |
261 dcfsnz menupos,F | |
262 bra gassetup_list_edit_gas1 | |
263 dcfsnz menupos,F | |
264 bra gassetup_list_edit_gas2 | |
265 dcfsnz menupos,F | |
266 bra gassetup_list_edit_gas3 | |
267 dcfsnz menupos,F | |
268 bra gassetup_list_edit_gas4 | |
269 dcfsnz menupos,F | |
270 bra gassetup_list_edit_gas5 | |
271 bra exit_gassetup_list ; Exit List | |
272 | |
273 gassetup_list_edit_gas1: | |
274 movlw d'0' | |
275 movwf decodata+0 | |
276 movlw d'0' | |
277 movwf divemins+0 | |
278 bra menu_gassetup_page1 | |
279 | |
280 gassetup_list_edit_gas2: | |
281 movlw d'1' | |
282 movwf decodata+0 | |
283 movlw d'4' | |
284 movwf divemins+0 | |
285 bra menu_gassetup_page1 | |
286 | |
287 gassetup_list_edit_gas3: | |
288 movlw d'2' | |
289 movwf decodata+0 | |
290 movlw d'8' | |
291 movwf divemins+0 | |
292 bra menu_gassetup_page1 | |
293 | |
294 gassetup_list_edit_gas4: | |
295 movlw d'3' | |
296 movwf decodata+0 | |
297 movlw d'12' | |
298 movwf divemins+0 | |
299 bra menu_gassetup_page1 | |
300 | |
301 gassetup_list_edit_gas5: | |
302 movlw d'4' | |
303 movwf decodata+0 | |
304 movlw d'16' | |
305 movwf divemins+0 | |
306 bra menu_gassetup_page1 | |
307 | |
308 menu_gassetup_page1: | |
309 movlw d'1' | |
310 movwf menupos | |
311 bcf gas_setup_page2 ; Page 1 of gassetup | |
312 bcf menubit4 | |
313 bcf cursor | |
314 bcf sleepmode | |
315 bcf first_FA ; Here: =1: -, =0: + | |
316 | |
317 menu_gassetup0: | |
318 call PLED_ClearScreen | |
319 DISPLAYTEXT .30 ; More... | |
320 DISPLAYTEXT .11 ; Exit | |
321 | |
322 menu_gassetup1: | |
323 clrf timeout_counter2 | |
324 bcf menubit2 | |
325 bcf menubit3 | |
326 | |
327 rcall gassetup_title_bar2 ; Displays the title bar with the current Gas info | |
328 | |
329 WIN_TOP .65 | |
330 WIN_LEFT .20 | |
331 lfsr FSR2,letter | |
332 movlw 'O' | |
333 movwf POSTINC2 | |
334 movlw '2' | |
335 movwf POSTINC2 | |
336 movlw ':' | |
337 movwf POSTINC2 | |
338 movlw ' ' | |
339 movwf POSTINC2 | |
340 | |
341 movf divemins+0,W | |
342 addlw 0x06 | |
343 movwf EEADR | |
344 call read_eeprom ; O2 value | |
345 movff EEDATA,lo | |
346 output_8 | |
347 movlw '%' | |
348 movwf POSTINC2 | |
349 movlw ' ' | |
350 movwf POSTINC2 | |
351 movlw '(' | |
352 movwf POSTINC2 | |
353 movlw 'M' | |
354 movwf POSTINC2 | |
355 movlw 'O' | |
356 movwf POSTINC2 | |
357 movlw 'D' | |
358 movwf POSTINC2 | |
359 movlw ':' | |
360 movwf POSTINC2 | |
361 | |
362 ; Show MOD in m | |
363 GETCUSTOM8 .18 ; ppO2 warnvalue in WREG | |
364 mullw d'10' | |
365 movff PRODL,xA+0 | |
366 movff PRODH,xA+1 ; ppO2 in [0.01Bar] * 10 | |
367 | |
368 movf divemins+0,W | |
369 addlw 0x06 | |
370 movwf EEADR | |
371 call read_eeprom ; O2 value | |
372 movff EEDATA,xB+0 | |
373 clrf xB+1 | |
374 call div16x16 ;xA/xB=xC with xA as remainder | |
375 movlw d'10' | |
376 subwf xC+0,F ; Subtract 10m... | |
377 movff xC+0,lo | |
378 movlw d'0' | |
379 subwfb xC+1,F | |
380 movff xC+1,hi | |
381 output_16 | |
382 movlw 'm' | |
383 movwf POSTINC2 | |
384 movlw ')' | |
385 movwf POSTINC2 | |
386 movlw ' ' | |
387 movwf POSTINC2 | |
388 movlw ' ' | |
389 movwf POSTINC2 | |
390 call word_processor | |
391 | |
392 WIN_TOP .95 | |
393 lfsr FSR2,letter | |
394 movlw 'H' | |
395 movwf POSTINC2 | |
396 movlw 'e' | |
397 movwf POSTINC2 | |
398 movlw ':' | |
399 movwf POSTINC2 | |
400 movlw ' ' | |
401 movwf POSTINC2 | |
402 movf divemins+0,W | |
403 addlw 0x07 | |
404 movwf EEADR | |
405 call read_eeprom ; He value | |
406 movff EEDATA,lo | |
407 output_8 | |
408 movlw '%' | |
409 movwf POSTINC2 | |
410 movlw ' ' | |
411 movwf POSTINC2 | |
412 movlw ' ' | |
413 movwf POSTINC2 | |
414 call word_processor | |
415 | |
416 WIN_TOP .125 | |
417 lfsr FSR2,letter | |
418 movlw '+' | |
419 movwf POSTINC2 | |
420 movlw '/' | |
421 movwf POSTINC2 | |
422 movlw '-' | |
423 movwf POSTINC2 | |
424 movlw ':' | |
425 movwf POSTINC2 | |
426 movlw ' ' | |
427 movwf POSTINC2 | |
428 movlw '+' | |
429 btfsc first_FA | |
430 movlw '-' | |
431 movwf POSTINC2 | |
432 call word_processor | |
433 | |
434 WIN_TOP .155 | |
435 lfsr FSR2,letter | |
436 OUTPUTTEXT .89 ; Default: | |
437 movf divemins+0,W | |
438 addlw 0x04 | |
439 movwf EEADR | |
440 call read_eeprom ; Default O2 value | |
441 movff EEDATA,lo | |
442 output_8 | |
443 movlw '/' | |
444 movwf POSTINC2 | |
445 movf divemins+0,W | |
446 addlw 0x05 | |
447 movwf EEADR | |
448 call read_eeprom ; Default He value | |
449 movff EEDATA,lo | |
450 output_8 | |
451 movlw ' ' | |
452 movwf POSTINC2 | |
453 movlw ' ' | |
454 movwf POSTINC2 | |
455 call word_processor | |
456 | |
457 call wait_switches ; Waits until switches are released, resets flag if button stays pressed! | |
458 call PLED_menu_cursor | |
459 | |
460 gassetup_loop: | |
461 call check_switches_logbook | |
462 | |
463 btfsc menubit3 | |
464 bra gassetup2 ; move cursor | |
465 | |
466 btfsc menubit2 | |
467 bra do_gassetup ; call submenu | |
468 | |
469 btfsc divemode | |
470 goto restart ; dive started! | |
471 | |
472 btfsc onesecupdate | |
473 call timeout_surfmode | |
474 | |
475 btfsc onesecupdate | |
476 call set_dive_modes | |
477 | |
478 bcf onesecupdate ; 1 sec. functions done | |
479 | |
480 btfsc sleepmode | |
481 bra exit_gassetup | |
482 | |
483 bra gassetup_loop | |
484 | |
485 gassetup2: | |
486 incf menupos,F | |
487 movlw d'7' | |
488 cpfseq menupos ; =7? | |
489 bra gassetup3 ; No | |
490 movlw d'1' | |
491 movwf menupos | |
492 | |
493 gassetup3: | |
494 | |
495 clrf timeout_counter2 | |
496 call PLED_menu_cursor | |
497 | |
498 call wait_switches ; Waits until switches are released, resets flag if button stays pressed! | |
499 | |
500 bcf menubit3 ; clear flag | |
501 bra gassetup_loop | |
502 | |
503 do_gassetup: | |
504 dcfsnz menupos,F | |
505 bra next_gas_page | |
506 dcfsnz menupos,F | |
507 bra adjust_o2 | |
508 dcfsnz menupos,F | |
509 bra adjust_he | |
510 dcfsnz menupos,F | |
511 bra toggle_plus_minus_gassetup | |
512 dcfsnz menupos,F | |
513 bra restore_gas | |
514 exit_gassetup: ; exit... | |
515 movff decodata+0,menupos | |
516 incf menupos,F | |
517 bra menu_gassetup_prelist | |
518 | |
519 toggle_plus_minus_gassetup: | |
520 btg first_FA | |
521 movlw d'4' | |
522 movwf menupos | |
523 bra menu_gassetup1 ; return | |
524 | |
525 next_gas: | |
526 movlw d'1' | |
527 movwf menupos | |
528 bra menu_gassetup0 ; incl. clear screen | |
529 | |
530 adjust_o2: | |
531 movf divemins+0,W ; read current value | |
532 addlw 0x06 | |
533 movwf EEADR | |
534 call read_eeprom ; Low-value | |
535 movff EEDATA,lo | |
536 | |
537 btfsc first_FA ; Minus? | |
538 bra adjust_o2_1 ; yes, minus! | |
539 | |
540 incf lo,F ; increase O2 | |
541 movlw d'101' | |
542 cpfseq lo | |
543 bra adjust_o2_2 | |
544 movlw d'4' ; LOWER O2 Limit | |
545 movwf lo | |
546 bra adjust_o2_2 | |
547 | |
548 adjust_o2_1: | |
549 decf lo,F ; decrease O2 | |
550 movlw d'3' | |
551 cpfseq lo | |
552 bra adjust_o2_2 | |
553 | |
554 movf divemins+0,W | |
555 addlw 0x07 | |
556 movwf EEADR | |
557 call read_eeprom ; read He value | |
558 | |
559 movlw d'100' | |
560 movwf lo | |
561 movf EEDATA,W ; He value | |
562 subwf lo,F ; lo=100% - He% | |
563 | |
564 adjust_o2_2: ; test if O2+He>100... | |
565 movf divemins+0,W | |
566 addlw 0x07 | |
567 movwf EEADR | |
568 call read_eeprom ; read He value | |
569 movf EEDATA,W ; He value | |
570 addwf lo,W ; add O2 value | |
571 movwf hi ; store in temp | |
572 movlw d'101' | |
573 cpfseq hi ; O2 and He > 100? | |
574 bra adjust_o2_3 ; No! | |
575 | |
576 movlw d'4' ; LOWER O2 Limit | |
577 movwf lo | |
578 | |
579 adjust_o2_3: | |
580 movf divemins+0,W ; save current value | |
581 addlw 0x06 | |
582 movwf EEADR | |
583 movff lo,EEDATA | |
584 call write_eeprom ; Low-value | |
585 | |
586 movlw d'2' | |
587 movwf menupos | |
588 bra menu_gassetup1 | |
589 | |
590 adjust_he: | |
591 movf divemins+0,W ; read current value | |
592 addlw 0x07 | |
593 movwf EEADR | |
594 call read_eeprom ; Low-value | |
595 movff EEDATA,lo | |
596 | |
597 btfsc first_FA ; Minus? | |
598 bra adjust_he_1 ; yes, minus! | |
599 | |
600 incf lo,F | |
601 movlw d'92' ; He limited to (useless) 90% | |
602 cpfseq lo | |
603 bra adjust_he_2 | |
604 clrf lo | |
605 bra adjust_he_2 | |
606 | |
607 adjust_he_1: | |
608 decf lo,F ; decrease He | |
609 movlw d'255' | |
610 cpfseq lo | |
611 bra adjust_he_2 | |
612 clrf lo | |
613 | |
614 adjust_he_2: ; test if O2+He>100... | |
615 movf divemins+0,W | |
616 addlw 0x06 | |
617 movwf EEADR | |
618 call read_eeprom ; read He value | |
619 movf EEDATA,W ; He value | |
620 addwf lo,W ; add O2 value | |
621 movwf hi ; store in temp | |
622 movlw d'101' | |
623 cpfseq hi ; O2 and He > 100? | |
624 bra adjust_he_3 ; No! | |
625 ; clrf lo ; Yes, clear He to zero | |
626 decf lo,F ; reduce He again = unchanged after operation | |
627 | |
628 adjust_he_3: | |
629 movf divemins+0,W ; save current value | |
630 addlw 0x07 | |
631 movwf EEADR | |
632 movff lo,EEDATA | |
633 call write_eeprom ; Low-value | |
634 | |
635 movlw d'3' | |
636 movwf menupos | |
637 bra menu_gassetup1 ; | |
638 | |
639 restore_gas: | |
640 movf divemins+0,W ; read Default value | |
641 addlw 0x04 | |
642 movwf EEADR | |
643 call read_eeprom ; Low-value | |
644 movff EEDATA,lo | |
645 movf divemins+0,W | |
646 addlw 0x05 | |
647 movwf EEADR | |
648 call read_eeprom ; High-value | |
649 movff EEDATA,hi | |
650 | |
651 movf divemins+0,W ; save Default value | |
652 addlw 0x06 | |
653 movwf EEADR | |
654 movff lo,EEDATA | |
655 call write_eeprom ; Low-value | |
656 movf divemins+0,W | |
657 addlw 0x07 | |
658 movwf EEADR | |
659 movff hi,EEDATA | |
660 call write_eeprom ; High-value | |
661 | |
662 movlw d'5' | |
663 movwf menupos | |
664 bra menu_gassetup1 ; | |
665 | |
666 | |
667 next_gas_page: | |
668 call PLED_ClearScreen | |
669 movlw d'1' | |
670 movwf menupos | |
671 DISPLAYTEXT .109 ; Back | |
672 | |
673 DISPLAYTEXT .11 ; Exit | |
674 | |
675 next_gas_page1: | |
676 clrf timeout_counter2 | |
677 bcf menubit2 | |
678 bcf menubit3 | |
679 | |
680 rcall gassetup_title_bar2 ; Displays the title bar with the current Gas info | |
681 rcall gassetup_show_ppO2 ; Display the ppO2 of the change depth with the current gas | |
682 | |
683 WIN_TOP .65 | |
684 WIN_LEFT .20 | |
685 lfsr FSR2,letter | |
686 OUTPUTTEXT .105 ; "Active Gas? " | |
687 read_int_eeprom d'27' ; read flag register | |
688 | |
689 ; hi contains active gas flags in BIT0:4 .... | |
690 | |
691 movff decodata+0,lo ; Gas 0-4 | |
692 incf lo,F ; Gas 1-5 | |
693 | |
694 active_gas_display: | |
695 rrcf EEDATA ; roll flags into carry | |
696 decfsz lo,F ; max. 5 times... | |
697 bra active_gas_display | |
698 | |
699 btfss STATUS,C ; test carry | |
700 bra active_gas_display_no | |
701 | |
702 OUTPUTTEXT .96 ; Yes | |
703 bra active_gas_display_end | |
704 | |
705 active_gas_display_no: | |
706 movlw ' ' ; three spaces instead of "Yes" | |
707 movwf POSTINC2 | |
708 movlw ' ' | |
709 movwf POSTINC2 | |
710 movlw ' ' | |
711 movwf POSTINC2 | |
712 | |
713 active_gas_display_end: | |
714 call word_processor | |
715 | |
716 WIN_TOP .95 | |
717 WIN_LEFT .20 | |
718 lfsr FSR2,letter | |
719 OUTPUTTEXT .88 ; First Gas? | |
720 movlw ' ' | |
721 movwf POSTINC2 | |
722 | |
723 movlw d'33' | |
724 movwf EEADR | |
725 call read_eeprom ; Get current startgas 1-5 # into EEDATA | |
726 decf EEDATA,W ; 0-4 | |
727 cpfseq decodata+0 ; =current displayed gas #? | |
728 bra menu_firstgas0 ; no, display three spaces | |
729 | |
730 OUTPUTTEXT .96 ; Yes | |
731 bra menu_firstgas1 | |
732 | |
733 menu_firstgas0: | |
734 movlw ' ' | |
735 movwf POSTINC2 | |
736 movlw ' ' | |
737 movwf POSTINC2 | |
738 movlw ' ' | |
739 movwf POSTINC2 | |
740 | |
741 menu_firstgas1: | |
742 call word_processor | |
743 | |
744 WIN_TOP .125 | |
745 WIN_LEFT .20 | |
746 lfsr FSR2,letter | |
747 OUTPUTTEXT .107 ; Change+ | |
748 call word_processor | |
749 | |
750 WIN_TOP .155 | |
751 WIN_LEFT .20 | |
752 lfsr FSR2,letter | |
753 OUTPUTTEXT .108 ; Change- | |
754 call word_processor | |
755 | |
756 call wait_switches ; Waits until switches are released, resets flag if button stays pressed! | |
757 call PLED_menu_cursor | |
758 | |
759 next_gas_page_loop: | |
760 call check_switches_logbook | |
761 | |
762 btfsc menubit3 | |
763 bra next_gas_page2 ; move cursor | |
764 | |
765 btfsc menubit2 | |
766 bra do_next_gas_page ; call submenu | |
767 | |
768 btfsc divemode | |
769 goto restart ; dive started! | |
770 | |
771 btfsc onesecupdate | |
772 call timeout_surfmode | |
773 | |
774 btfsc onesecupdate | |
775 call set_dive_modes | |
776 | |
777 bcf onesecupdate ; 1 sec. functions done | |
778 | |
779 btfsc sleepmode | |
780 bra exit_gassetup | |
781 | |
782 bra next_gas_page_loop | |
783 | |
784 next_gas_page2: | |
785 incf menupos,F | |
786 | |
787 movlw d'7' | |
788 cpfseq menupos ; =7? | |
789 bra next_gas_page3 ; No | |
790 movlw d'1' | |
791 movwf menupos | |
792 | |
793 next_gas_page3: | |
794 clrf timeout_counter2 | |
795 call PLED_menu_cursor | |
796 | |
797 call wait_switches ; Waits until switches are released, resets flag if button stays pressed! | |
798 | |
799 bcf menubit3 ; clear flag | |
800 bra next_gas_page_loop | |
801 | |
802 do_next_gas_page: | |
803 dcfsnz menupos,F | |
804 bra next_gas | |
805 dcfsnz menupos,F | |
806 bra toggle_active_gas | |
807 dcfsnz menupos,F | |
808 bra make_first_gas | |
809 dcfsnz menupos,F | |
810 bra change_gas_depth_plus | |
811 dcfsnz menupos,F | |
812 bra change_gas_depth_minus | |
813 bra exit_gassetup ; Exit menu | |
814 | |
815 make_first_gas: | |
816 movff decodata+0,EEDATA ; current gas (0-4) into EEDATA | |
817 incf EEDATA,F ; current gas (1-5) into EEDATA | |
818 movlw d'33' | |
819 movwf EEADR | |
820 call write_eeprom ; store in internal EEPROM | |
821 movlw d'3' | |
822 movwf menupos | |
823 bra next_gas_page1 | |
824 | |
825 toggle_active_gas: | |
826 read_int_eeprom d'27' ; read flag register | |
827 movff decodata+0,lo ; selected gas 0-4 | |
828 incf lo,F | |
829 dcfsnz lo,F | |
830 btg EEDATA,0 | |
831 dcfsnz lo,F | |
832 btg EEDATA,1 | |
833 dcfsnz lo,F | |
834 btg EEDATA,2 | |
835 dcfsnz lo,F | |
836 btg EEDATA,3 | |
837 dcfsnz lo,F | |
838 btg EEDATA,4 | |
839 write_int_eeprom d'27' ; write flag register | |
840 movlw d'2' | |
841 movwf menupos | |
842 bra next_gas_page1 | |
843 | |
844 change_gas_depth_plus: | |
845 movf decodata+0,W ; read current value | |
846 addlw d'28' ; offset in memory | |
847 movwf EEADR | |
848 call read_eeprom ; Low-value | |
849 movff EEDATA,lo | |
850 | |
851 incf lo,F ; increase depth | |
852 movlw d'100' ; Change depth limit + 1 | |
853 cpfseq lo | |
854 bra change_gas_depth_plus2 | |
855 movlw d'99' ; Change depth limit | |
856 movwf lo | |
857 change_gas_depth_plus2: | |
858 movff lo,EEDATA ; write result | |
859 call write_eeprom ; save result in EEPROM | |
860 | |
861 movlw d'4' | |
862 movwf menupos | |
863 bra next_gas_page1 | |
864 | |
865 | |
866 change_gas_depth_minus: | |
867 movf decodata+0,W ; read current value | |
868 addlw d'28' ; offset in memory | |
869 movwf EEADR | |
870 call read_eeprom ; Low-value | |
871 movff EEDATA,lo | |
872 | |
873 decf lo,F ; decrease depth | |
874 movlw d'255' | |
875 cpfseq lo | |
876 bra change_gas_depth_minus2 | |
877 movlw d'0' | |
878 movwf lo | |
879 | |
880 change_gas_depth_minus2: | |
881 movff lo,EEDATA ; write result | |
882 call write_eeprom ; save result in EEPROM | |
883 | |
884 movlw d'5' | |
885 movwf menupos | |
886 bra next_gas_page1 | |
887 | |
888 ; Changed v1.44se | |
889 gassetup_title_bar2: | |
890 call PLED_topline_box | |
891 WIN_INVERT .1 ; Init new Wordprocessor | |
892 WIN_TOP .2 | |
893 WIN_LEFT .0 | |
894 lfsr FSR2,letter | |
895 OUTPUTTEXT .95 ; Gas# | |
896 movff decodata+0,lo | |
897 incf lo,F | |
898 bsf leftbind | |
899 output_99 | |
900 movlw ':' | |
901 movwf POSTINC2 | |
902 movlw ' ' | |
903 movwf POSTINC2 | |
904 call word_processor | |
905 | |
906 WIN_TOP .2 | |
907 WIN_LEFT .50 | |
908 lfsr FSR2,letter | |
909 | |
910 ;He check | |
911 movf divemins+0,W | |
912 addlw 0x07 | |
913 movwf EEADR | |
914 call read_eeprom ; He value | |
915 movff EEDATA,lo ; Move EEData -> lo | |
916 movf lo,f ; Move lo -> f | |
917 movlw d'0' ; Move 0 -> WREG | |
918 cpfsgt lo ; He > 0? | |
919 bra gassetup_title_bar3 ; NO check o2 | |
920 | |
921 ; YES Write TX 15/55 | |
922 call gassetup_write_Tx ; Write TX | |
923 movf divemins+0,W | |
924 addlw 0x06 | |
925 movwf EEADR | |
926 call read_eeprom ; O2 value | |
927 movff EEDATA,lo | |
928 output_8 ; Write O2 | |
929 movlw '/' | |
930 movwf POSTINC2 | |
931 movf divemins+0,W | |
932 addlw 0x07 | |
933 movwf EEADR | |
934 call read_eeprom ; He value | |
935 movff EEDATA,lo | |
936 output_8 ; Write He | |
937 bra gassetup_title_bar7 | |
938 | |
939 ; New v1.44se | |
940 gassetup_title_bar3: ; O2 Check | |
941 movf divemins+0,W | |
942 addlw 0x06 | |
943 movwf EEADR | |
944 call read_eeprom ; O2 value | |
945 movff EEDATA,lo | |
946 movf lo,f ; Move lo -> f | |
947 movlw d'21' ; Move 21 -> WREG | |
948 cpfseq lo ; o2 = 21 | |
949 cpfsgt lo ; o2 > 21% | |
950 bra gassetup_title_bar5 ; NO AIR | |
951 movlw d'100' ; Move 100 -> WREG | |
952 cpfslt lo ; o2 < 100% | |
953 bra gassetup_title_bar4 ; NO write O2 | |
954 | |
955 ; YES Write NX 32 | |
956 call gassetup_write_Nx | |
957 output_8 | |
958 bra gassetup_title_bar7 | |
959 | |
960 ; New v1.44se | |
961 gassetup_title_bar4: | |
962 movlw 'O' | |
963 movwf POSTINC2 | |
964 movlw '2' | |
965 movwf POSTINC2 | |
966 movlw ' ' | |
967 movwf POSTINC2 | |
968 output_8 | |
969 bra gassetup_title_bar7 | |
970 | |
971 ; New v1.44se | |
972 gassetup_title_bar5: | |
973 cpfseq lo ; o2 = 21% | |
974 bra gassetup_title_bar6 | |
975 | |
976 movlw 'A' | |
977 movwf POSTINC2 | |
978 movlw 'I' | |
979 movwf POSTINC2 | |
980 movlw 'R' | |
981 movwf POSTINC2 | |
982 movlw ' ' | |
983 movwf POSTINC2 | |
984 output_8 | |
985 bra gassetup_title_bar7 | |
986 | |
987 ; New v1.44se | |
988 gassetup_title_bar6: ; ERROR | |
989 movlw 'E' | |
990 movwf POSTINC2 | |
991 movlw 'R' | |
992 movwf POSTINC2 | |
993 movlw 'R' | |
994 movwf POSTINC2 | |
995 movlw ' ' | |
996 movwf POSTINC2 | |
997 output_8 | |
998 bra gassetup_title_bar7 | |
999 | |
1000 gassetup_title_bar7: | |
1001 movlw ' ' | |
1002 movwf POSTINC2 | |
1003 movlw 'i' | |
1004 movwf POSTINC2 | |
1005 movlw 'n' | |
1006 movwf POSTINC2 | |
1007 movlw ' ' | |
1008 movwf POSTINC2 | |
1009 movf decodata+0,W ; read current value | |
1010 addlw d'28' ; offset in memory | |
1011 movwf EEADR | |
1012 call read_eeprom ; Low-value | |
1013 movff EEDATA,lo | |
1014 output_8 | |
1015 movlw 'm' | |
1016 movwf POSTINC2 | |
1017 movlw ' ' | |
1018 movwf POSTINC2 | |
1019 | |
1020 call word_processor | |
1021 WIN_INVERT .0 ; Init new Wordprocessor | |
1022 return | |
1023 | |
1024 ; New v1.44se | |
1025 gassetup_write_Nx: | |
1026 movlw 'N' | |
1027 movwf POSTINC2 | |
1028 movlw 'X' | |
1029 movwf POSTINC2 | |
1030 movlw ' ' | |
1031 movwf POSTINC2 | |
1032 return | |
1033 | |
1034 ; New v1.44se | |
1035 gassetup_write_Tx: | |
1036 movlw 'T' | |
1037 movwf POSTINC2 | |
1038 movlw 'X' | |
1039 movwf POSTINC2 | |
1040 movlw ' ' | |
1041 movwf POSTINC2 | |
1042 return | |
1043 | |
1044 ; New v1.44se | |
1045 menu_gassetup_grey_inactive: | |
1046 ; Set Greyvalue to lower value when gas is inactive | |
1047 read_int_eeprom d'27' ; read flag register | |
1048 movff decodata+0,lo ; copy gas number 0-4 | |
1049 incf lo,F ; 1-5 | |
1050 menu_gassetup_list1: | |
1051 rrcf EEDATA ; roll flags into carry | |
1052 decfsz lo,F ; max. 5 times... | |
1053 bra menu_gassetup_list1 | |
3 | 1054 |
0 | 1055 btfss STATUS,C ; test carry |
3 | 1056 bra menu_gassetup_list1_grey |
1057 | |
1058 GETCUSTOM8 d'35' ;movlw color_white | |
1059 call PLED_set_color ; grey out inactive gases! | |
1060 return | |
1061 | |
1062 menu_gassetup_list1_grey: | |
0 | 1063 movlw color_grey |
1064 call PLED_set_color ; grey out inactive gases! | |
1065 return | |
1066 | |
1067 gassetup_show_ppO2: | |
1068 movf divemins+0,W | |
1069 addlw 0x06 | |
1070 movwf EEADR | |
1071 call read_eeprom ; O2 value | |
1072 movff EEDATA,hi | |
1073 | |
1074 movf decodata+0,W ; read current value | |
1075 addlw d'28' ; offset in memory | |
1076 movwf EEADR | |
1077 call read_eeprom ; Change depth in m | |
1078 movff EEDATA,lo | |
1079 movlw d'10' | |
1080 addwf lo,F ; Depth+10m=lo | |
1081 movf hi,W | |
1082 mulwf lo ; (Depth+10m)*O2 | |
1083 movff PRODL,xA+0 | |
1084 movff PRODH,xA+1 | |
1085 movlw d'10' | |
1086 movwf xB+0 | |
1087 clrf xB+1 | |
1088 call div16x16 ;xA/xB=xC with xA as remainder | |
1089 movff xC+0,lo ; ((Depth+10m)*O2)/10 = [0.01Bar] ppO2 | |
1090 movff xC+1,hi | |
1091 | |
1092 WIN_LEFT .55 | |
1093 WIN_TOP .35 | |
1094 lfsr FSR2,letter | |
1095 movlw '(' | |
1096 movwf POSTINC2 | |
1097 movlw 'p' | |
1098 movwf POSTINC2 | |
1099 movlw 'p' | |
1100 movwf POSTINC2 | |
1101 movlw 'O' | |
1102 movwf POSTINC2 | |
1103 movlw '2' | |
1104 movwf POSTINC2 | |
1105 movlw ':' | |
1106 movwf POSTINC2 | |
1107 output_16dp d'3' | |
1108 movlw 'B' | |
1109 movwf POSTINC2 | |
1110 movlw 'a' | |
1111 movwf POSTINC2 | |
1112 movlw 'r' | |
1113 movwf POSTINC2 | |
1114 movlw ')' | |
1115 movwf POSTINC2 | |
1116 movlw ' ' | |
1117 movwf POSTINC2 | |
1118 call word_processor | |
35 | 1119 return |
1120 | |
1121 | |
1122 gassetup_sort_gaslist: ; Sorts Gaslist according to change depth | |
1123 ; EEPROM Locations of Gaslist | |
1124 ; Gas1: | |
1125 ; O2 Default:4 | |
1126 ; He Default:5 | |
1127 ; O2 Current:6 | |
1128 ; He Current:7 | |
1129 ; Change: 28 | |
1130 ; Active: 27,0 | |
1131 | |
1132 ; Gas2: | |
1133 ; O2 Default:8 | |
1134 ; He Default:9 | |
1135 ; O2 Current:10 | |
1136 ; He Current:11 | |
1137 ; Change: 29 | |
1138 ; Active: 27,1 | |
1139 | |
1140 ; Gas3: | |
1141 ; O2 Default:12 | |
1142 ; He Default:13 | |
1143 ; O2 Current:14 | |
1144 ; He Current:15 | |
1145 ; Change: 30 | |
1146 ; Active: 27,2 | |
1147 | |
1148 ; Gas4: | |
1149 ; O2 Default:16 | |
1150 ; He Default:17 | |
1151 ; O2 Current:18 | |
1152 ; He Current:19 | |
1153 ; Change: 31 | |
1154 ; Active: 27,3 | |
1155 | |
1156 ; Gas5: | |
1157 ; O2 Default:20 | |
1158 ; He Default:21 | |
1159 ; O2 Current:22 | |
1160 ; He Current:23 | |
1161 ; Change: 32 | |
1162 ; Active: 27,4 | |
1163 | |
36
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1164 ; Find deepest Gas |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1165 |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1166 ; Copy all to RAM |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1167 movlw d'3' |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1168 movwf EEADR |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1169 clrf EEADRH |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1170 lfsr FSR2,letter ; Store gases in Letter buffer (max. 26Byte!) |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1171 gassetup_sort_gaslist1: |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1172 incf EEADR,F ; Next Adress |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1173 call read_eeprom ; Read byte |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1174 movff EEDATA,POSTINC2 ; Copy into RAM |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1175 movlw d'23' |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1176 cpfseq EEADR ; All done? |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1177 bra gassetup_sort_gaslist1 ; No, not yet |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1178 ; Letter+0 = EEPROM 4 |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1179 ; ... |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1180 ; Letter+20 = EEPROM 23 |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1181 read_int_eeprom d'28' |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1182 movff EEDATA,POSTINC2 ; Change Depth Gas1 -> Letter+21 |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1183 read_int_eeprom d'29' |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1184 movff EEDATA,POSTINC2 ; Change Depth Gas2 -> Letter+22 |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1185 read_int_eeprom d'30' |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1186 movff EEDATA,POSTINC2 ; Change Depth Gas3 -> Letter+23 |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1187 read_int_eeprom d'31' |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1188 movff EEDATA,POSTINC2 ; Change Depth Gas4 -> Letter+24 |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1189 read_int_eeprom d'32' |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1190 movff EEDATA,POSTINC2 ; Change Depth Gas5 -> Letter+25 |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1191 read_int_eeprom d'27' |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1192 movff EEDATA,POSTINC2 ; Active Byte -> Letter+26 |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1193 |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1194 ; All change depths = 0? -> Skip sort! |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1195 lfsr FSR2,letter+.20 ; Change depths... |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1196 movlw d'5' |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1197 movwf logbook_temp3 ; Gas (0-4) |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1198 clrf logbook_temp1 ; counter |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1199 gassetup_sort_gaslist1a: |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1200 movf POSTINC2,W |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1201 addwf logbook_temp1,F ; sum |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1202 decfsz logbook_temp3,F ; Loop |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1203 bra gassetup_sort_gaslist1a |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1204 |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1205 tstfsz logbook_temp1 ; All depths = 0? |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1206 bra gassetup_sort_gaslist1b ; No |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1207 return ; Yes, skip all! |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1208 |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1209 gassetup_sort_gaslist1b: |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1210 ; Initialize sorting... |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1211 bcf menubit2 ; Change Start gas only 1x |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1212 movlw d'99' |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1213 movwf logbook_temp4 ; Last Gas change depth |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1214 |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1215 rcall gassetup_sort_sort ; Sort! |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1216 ; Done. Copy Gas #logbook_temp3 into EEPROM Place Gas 5 |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1217 movlw d'5' ; Gas 5 |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1218 movwf logbook_temp5 |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1219 rcall gassetup_sort_store |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1220 movff logbook_temp1,EEDATA ; Change depth -> EEDATA |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1221 write_int_eeprom d'32' ; Write Change Depth Gas 5 |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1222 |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1223 rcall gassetup_sort_sort ; Sort! |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1224 ; Done. Copy Gas #logbook_temp3 into EEPROM Place Gas 4 |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1225 movlw d'4' ; Gas 4 |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1226 movwf logbook_temp5 |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1227 rcall gassetup_sort_store |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1228 movff logbook_temp1,EEDATA ; Change depth -> EEDATA |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1229 write_int_eeprom d'31' ; Write Change Depth Gas 4 |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1230 |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1231 rcall gassetup_sort_sort ; Sort! |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1232 ; Done. Copy Gas #logbook_temp3 into EEPROM Place Gas 3 |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1233 movlw d'3' ; Gas 3 |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1234 movwf logbook_temp5 |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1235 rcall gassetup_sort_store |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1236 movff logbook_temp1,EEDATA ; Change depth -> EEDATA |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1237 write_int_eeprom d'30' ; Write Change Depth Gas 3 |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1238 |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1239 rcall gassetup_sort_sort ; Sort! |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1240 ; Done. Copy Gas #logbook_temp3 into EEPROM Place Gas 2 |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1241 movlw d'2' ; Gas 2 |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1242 movwf logbook_temp5 |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1243 rcall gassetup_sort_store |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1244 movff logbook_temp1,EEDATA ; Change depth -> EEDATA |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1245 write_int_eeprom d'29' ; Write Change Depth Gas 2 |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1246 |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1247 rcall gassetup_sort_sort ; Sort! |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1248 ; Done. Copy Gas #logbook_temp3 into EEPROM Place Gas 1 |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1249 movlw d'1' ; Gas 1 |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1250 movwf logbook_temp5 |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1251 rcall gassetup_sort_store |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1252 movff logbook_temp1,EEDATA ; Change depth -> EEDATA |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1253 write_int_eeprom d'28' ; Write Change Depth Gas 1 |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1254 return |
35 | 1255 |
36
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1256 gassetup_sort_sort: |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1257 clrf logbook_temp2 ; Gas (0-4) |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1258 clrf logbook_temp1 ; Here: Change depth in m |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1259 clrf logbook_temp3 ; Gas (0-4) |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1260 |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1261 lfsr FSR2,letter+.20 ; Change depths... |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1262 gassetup_sort_gaslist2: |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1263 movf POSTINC2,W ; Get Change depth into WREG |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1264 |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1265 cpfsgt logbook_temp4 ; logbook_temp4 < W? Here: Change depth of last sort run |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1266 bra gassetup_sort_gaslist3 ; Skip, tested depth > max. Depth from last run |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1267 |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1268 cpfslt logbook_temp1 ; logbook_temp1 < W? |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1269 bra gassetup_sort_gaslist3 ; Skip, tested depth < max. Depth from this run |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1270 |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1271 movwf logbook_temp1 ; copy new depth (current run) |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1272 movff logbook_temp2,logbook_temp3 ; Holds deepest Gas 0-4 of this run |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1273 gassetup_sort_gaslist3: |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1274 incf logbook_temp2,F ; Check next Gas |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1275 movlw d'5' |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1276 cpfseq logbook_temp2 ; All done? |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1277 bra gassetup_sort_gaslist2 ; No |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1278 gassetup_sort_gaslist4: |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1279 movff logbook_temp1,logbook_temp4 ; copy new depth (Store for next run) |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1280 |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1281 ; Debugger |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1282 ;call enable_rs232 |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1283 ; movff logbook_temp1,TXREG |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1284 ; call rs232_wait_tx ; wait for UART |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1285 ; movff logbook_temp2,TXREG |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1286 ; call rs232_wait_tx ; wait for UART |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1287 ; movff logbook_temp3,TXREG |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1288 ; call rs232_wait_tx ; wait for UART |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1289 ; movff logbook_temp4,TXREG |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1290 ; call rs232_wait_tx ; wait for UART |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1291 ; movff logbook_temp5,TXREG |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1292 ; call rs232_wait_tx ; wait for UART |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1293 ; WAITMS d'255' |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1294 return |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1295 |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1296 gassetup_sort_store: |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1297 lfsr FSR2,letter ; Point to Gas0 |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1298 movf logbook_temp3,W |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1299 mullw d'4' |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1300 movf PRODL,W ; x4 |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1301 addwf FSR2L,F |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1302 movlw d'0' |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1303 addwfc FSR2H,F ; Point to Gas #logbook_temp3 (0-4) |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1304 |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1305 btfsc menubit2 ; Change Start gas only 1x |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1306 bra gassetup_sort_store2 ; Skip |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1307 ; First Gas: 33 (1-5) |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1308 ; Was gas #logbook_temp3 first gas? |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1309 read_int_eeprom d'33' ; Get old first gas (1-5) |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1310 incf logbook_temp3,W ; Gas 1-5 -> WREG |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1311 cpfseq EEDATA ; Compare with EEDATA d'33' |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1312 bra gassetup_sort_store2 ; Was not first gas! |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1313 movff logbook_temp5,EEDATA ; Copy new first gas |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1314 write_int_eeprom d'33' ; Store |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1315 bsf menubit2 ; Done. Do change again. |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1316 |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1317 gassetup_sort_store2: |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1318 ;; Was Gas #logbook_temp3 active? |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1319 ;; Letter+26 holds active bits 25? |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1320 ; movff logbook_temp3,logbook_temp6 ; Counter 0-4 |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1321 ; incf logbook_temp6,F ; Counter 1-5 |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1322 ; movff letter+.25, logbook_temp2 ; No longer used |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1323 ; read_int_eeprom d'27' ; Active flag register |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1324 ;gassetup_sort_store3: |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1325 ; rrcf logbook_temp2,F ; Shift into Carry |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1326 ; decfsz logbook_temp6,F ; 1-5 x |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1327 ; bra gassetup_sort_store3 ; Loop |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1328 ;; Carry now holds active bit of gas #logbook_temp3 (0-4) |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1329 ; |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1330 ; movff logbook_temp3,logbook_temp6 ; Counter 0-4 |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1331 ; incf logbook_temp6,F ; Counter 1-5 |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1332 ; clrf logbook_temp2 |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1333 ;gassetup_sort_store4: |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1334 ; rlcf logbook_temp2,F ; Shift into logbook_temp2 |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1335 ; decfsz logbook_temp6,F ; 1-5 x |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1336 ; bra gassetup_sort_store4 ; Loop |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1337 ; movf logbook_temp2 |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1338 ; |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1339 |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1340 movf logbook_temp5,W |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1341 mullw d'4' |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1342 movff PRODL,EEADR ; Point to EEPROM of Gas #logbook_temp5 |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1343 movff POSTINC2,EEDATA ; O2 Default |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1344 call write_eeprom ; store in internal EEPROM |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1345 incf EEADR,F ; +1 |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1346 movff POSTINC2,EEDATA ; He Default |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1347 call write_eeprom ; store in internal EEPROM |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1348 incf EEADR,F ; +1 |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1349 movff POSTINC2,EEDATA ; O2 Current |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1350 call write_eeprom ; store in internal EEPROM |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1351 incf EEADR,F ; +1 |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1352 movff POSTINC2,EEDATA ; He Current |
3c38ba950dfb
Gas Setup now sorts Gases for new Deco code
heinrichsweikamp
parents:
35
diff
changeset
|
1353 call write_eeprom ; store in internal EEPROM |
0 | 1354 return |