Mercurial > public > mk2
comparison code_part1/OSTC_code_asm_part1/menu_ppO2.asm @ 652:86b49e47b2f5
allow Diluents with >50% He
author | heinrichsweikamp |
---|---|
date | Thu, 11 Oct 2012 20:58:48 +0200 |
parents | e6ac142e82b0 |
children | 8c01edcf57fc |
comparison
equal
deleted
inserted
replaced
651:b93a2bb750cc | 652:86b49e47b2f5 |
---|---|
519 movwf menupos | 519 movwf menupos |
520 bra menu_diluentgas1 ; return | 520 bra menu_diluentgas1 ; return |
521 | 521 |
522 adjust_he_diluent: | 522 adjust_he_diluent: |
523 incf divemins+0,W | 523 incf divemins+0,W |
524 movwf EEADR ; read current value | 524 movwf EEADR ; read current value (He) |
525 call read_eeprom ; Low-value | 525 call read_eeprom ; Low-value |
526 movff EEDATA,lo | 526 movff EEDATA,lo |
527 | 527 |
528 btfsc first_FA ; Minus? | 528 btfsc first_FA ; Minus? |
529 bra adjust_he_1_diluent ; yes, minus! | 529 bra adjust_he_1_diluent ; yes, minus! |
530 | 530 |
531 incf lo,F | 531 incf lo,F |
532 movlw d'92' ; He limited to (useless) 90% | 532 movlw d'99' ; He limited to (useless) 99% |
533 cpfseq lo | 533 cpfseq lo |
534 bra adjust_he_2_diluent | 534 bra adjust_he_2_diluent |
535 clrf lo | 535 clrf lo |
536 bra adjust_he_2_diluent | 536 bra adjust_he_2_diluent |
537 | 537 |
538 adjust_he_1_diluent: | 538 adjust_he_1_diluent: |
539 decf lo,F ; decrease He | 539 decf lo,F ; decrease He |
540 movlw d'255' | 540 movlw d'255' |
541 cpfseq lo | 541 cpfseq lo |
542 bra adjust_he_2_diluent | 542 bra adjust_he_2_diluent |
543 clrf lo | 543 clrf lo ; limit to zero |
544 | 544 |
545 adjust_he_2_diluent: ; test if O2+He>100... | 545 adjust_he_2_diluent: ; test if O2+He>100... |
546 incf divemins+0,W | 546 movff divemins+0,EEADR; read current O2 value |
547 movwf EEADR | 547 call read_eeprom ; Low-value |
548 call read_eeprom ; read He value | 548 movf EEDATA,W |
549 movf EEDATA,W ; He value | 549 addwf lo,W ; add He value |
550 addwf lo,W ; add O2 value | |
551 movwf hi ; store in temp | 550 movwf hi ; store in temp |
552 movlw d'101' | 551 movlw d'101' |
553 cpfseq hi ; O2 and He > 100? | 552 cpfseq hi ; O2 and He > 100? |
554 bra adjust_he_3_diluent ; No! | 553 bra adjust_he_3_diluent ; No! |
555 ; clrf lo ; Yes, clear He to zero | 554 ; clrf lo ; Yes, clear He to zero |
556 decf lo,F ; reduce He again = unchanged after operation | 555 decf lo,F ; reduce He again = unchanged after operation |
557 | 556 |
558 adjust_he_3_diluent: | 557 adjust_he_3_diluent: |
559 incf divemins+0,W ; save current value | 558 incf divemins+0,W ; save current value |
560 movwf EEADR | 559 movwf EEADR |
561 movff lo,EEDATA | 560 movff lo,EEDATA |
562 call write_eeprom ; Low-value | 561 call write_eeprom ; Low-value |
563 | 562 |
564 movlw d'2' | 563 movlw d'2' |
565 movwf menupos | 564 movwf menupos |
566 bra menu_diluentgas1 ; | 565 bra menu_diluentgas1; |
567 | 566 |
568 restore_gas_diluent: | 567 restore_gas_diluent: |
569 movff divemins+0,EEADR ; save Default value (O2) | 568 movff divemins+0,EEADR ; save Default value (O2) |
570 movlw .21 ; Always Air | 569 movlw .21 ; Always Air |
571 movwf EEDATA | 570 movwf EEDATA |