comparison code_part1/OSTC_code_asm_part1/divemode_menu.asm @ 17:68825abc35f7

1.55beta rc1
author heinrichsweikamp
date Sun, 11 Apr 2010 20:16:47 +0200
parents 2b5c52ae3923
children 73014f788032
comparison
equal deleted inserted replaced
16:01510acaeb11 17:68825abc35f7
566 call PLED_divemenu_cursor ; update cursor 566 call PLED_divemenu_cursor ; update cursor
567 return 567 return
568 568
569 divemenu_set_gas: 569 divemenu_set_gas:
570 btfsc FLAG_const_ppO2_mode ; in ppO2 mode? 570 btfsc FLAG_const_ppO2_mode ; in ppO2 mode?
571 bra divemenu_set_setpoint ; Yes, display SetPoint/Sensor result list 571 bra divemenu_set_setpoint ; Yes, display SetPoint list
572 572
573 bsf display_set_gas ; set flag 573 bsf display_set_gas ; set flag
574 call PLED_clear_divemode_menu ; Clear Menu 574 call PLED_clear_divemode_menu ; Clear Menu
575 call PLED_gas_list ; Display all 5 gases 575 call PLED_gas_list ; Display all 5 gases
576 movlw d'1' 576 movlw d'1'
611 movff EEDATA, ppO2_setpoint_store ; Store also in this byte... 611 movff EEDATA, ppO2_setpoint_store ; Store also in this byte...
612 612
613 divemenu_set_gas1a: 613 divemenu_set_gas1a:
614 bcf display_set_setpoint ; Clear Display Flag 614 bcf display_set_setpoint ; Clear Display Flag
615 ; Now, Set correct Diluent (again) 615 ; Now, Set correct Diluent (again)
616 read_int_eeprom d'33' ; Read byte (stored in EEDATA) 616 ; read_int_eeprom d'33' ; Read byte (stored in EEDATA)
617 movff EEDATA,active_gas ; Read start gas (1-5) 617 ; movff EEDATA,active_gas ; Read start gas (1-5)
618 618 ;
619 decf active_gas,W ; Gas 0-4 619 ; decf active_gas,W ; Gas 0-4
620 mullw d'4' 620 ; mullw d'4'
621 movf PRODL,W 621 ; movf PRODL,W
622 addlw d'7' ; = address for He ratio 622 ; addlw d'7' ; = address for He ratio
623 movwf EEADR 623 ; movwf EEADR
624 call read_eeprom ; Read He ratio 624 ; call read_eeprom ; Read He ratio
625 movff EEDATA,char_I_He_ratio ; And copy into hold register 625 ; movff EEDATA,char_I_He_ratio ; And copy into hold register
626 decf active_gas,W ; Gas 0-4 626 ; decf active_gas,W ; Gas 0-4
627 mullw d'4' 627 ; mullw d'4'
628 movf PRODL,W 628 ; movf PRODL,W
629 addlw d'6' ; = address for O2 ratio 629 ; addlw d'6' ; = address for O2 ratio
630 movwf EEADR 630 ; movwf EEADR
631 call read_eeprom ; Read O2 ratio 631 ; call read_eeprom ; Read O2 ratio
632 movff EEDATA, char_I_O2_ratio ; O2 ratio 632 ; movff EEDATA, char_I_O2_ratio ; O2 ratio
633 movff char_I_He_ratio, wait_temp ; copy into bank1 register 633 ; movff char_I_He_ratio, wait_temp ; copy into bank1 register
634 bsf STATUS,C ; Borrow bit 634 ; bsf STATUS,C ; Borrow bit
635 movlw d'100' ; 100% 635 ; movlw d'100' ; 100%
636 subfwb wait_temp,W ; minus He 636 ; subfwb wait_temp,W ; minus He
637 bsf STATUS,C ; Borrow bit 637 ; bsf STATUS,C ; Borrow bit
638 subfwb EEDATA,F ; minus O2 638 ; subfwb EEDATA,F ; minus O2
639 movff EEDATA, char_I_N2_ratio ; = N2! 639 ; movff EEDATA, char_I_N2_ratio ; = N2!
640 640 ; call PLED_active_gas_clear ; Clear gas in case of AIR (Will be redrawn)
641 call PLED_active_gas_clear ; Clear gas in case of AIR (Will be redrawn)
642 641
643 bsf stored_gas_changed ; set event flag 642 bsf stored_gas_changed ; set event flag
644 bsf event_occured ; set global event flag 643 bsf event_occured ; set global event flag
645 bra timeout_divemenu2 ; quit menu! 644 bra timeout_divemenu2 ; quit menu!
646 645