Mercurial > public > mk2
comparison code_part1/OSTC_code_asm_part1/divemode_menu.asm @ 643:3b50c9949b84
gas6 setup simplified
author | heinrichsweikamp |
---|---|
date | Wed, 03 Oct 2012 12:40:00 +0200 |
parents | e755ed869a3b |
children | e6ac142e82b0 |
comparison
equal
deleted
inserted
replaced
642:2cecac640202 | 643:3b50c9949b84 |
---|---|
518 | 518 |
519 divemenu_set_xgas2_o2minus: | 519 divemenu_set_xgas2_o2minus: |
520 read_int_eeprom d'24' ; O2 value | 520 read_int_eeprom d'24' ; O2 value |
521 movff EEDATA,lo | 521 movff EEDATA,lo |
522 decf lo,F ; decrease O2 | 522 decf lo,F ; decrease O2 |
523 movlw d'3' ; Limit-1 | 523 movlw d'0' |
524 cpfseq lo | 524 cpfseq lo |
525 bra divemenu_set_xgas2_o2minus2 | 525 bra divemenu_set_xgas2_o2minus2 |
526 incf lo,F ; limit to min=9 | 526 read_int_eeprom d'25' ; Read He ratio |
527 movf EEDATA,W ; into WREG | |
528 sublw .100 ; 100% total... | |
529 movwf lo ; Set to Max. value | |
527 divemenu_set_xgas2_o2minus2: | 530 divemenu_set_xgas2_o2minus2: |
528 movff lo, EEDATA | 531 movff lo, EEDATA |
529 write_int_eeprom d'24' ; O2 Value | 532 write_int_eeprom d'24' ; O2 Value |
530 | 533 |
531 call PLED_divemode_set_xgas ; Redraw menu | 534 call PLED_divemode_set_xgas ; Redraw menu |
545 divemenu_set_xgas2_o2plus2: ; test if O2+He>100... | 548 divemenu_set_xgas2_o2plus2: ; test if O2+He>100... |
546 read_int_eeprom d'25' ; He value | 549 read_int_eeprom d'25' ; He value |
547 movf EEDATA,W | 550 movf EEDATA,W |
548 addwf lo,W ; add O2 value | 551 addwf lo,W ; add O2 value |
549 movwf hi ; store in temp | 552 movwf hi ; store in temp |
550 movlw d'101' | 553 movlw d'100' |
551 cpfseq hi ; O2 and He > 100? | 554 cpfsgt hi ; O2 and He > 100? |
552 bra divemenu_set_xgas2_o2plus3 ; No! | 555 bra divemenu_set_xgas2_o2plus3 ; No! |
553 decf lo,F ; reduce O2 again = unchanged after operation | 556 decf lo,F ; reduce O2 again = unchanged after operation |
554 divemenu_set_xgas2_o2plus3: ; save current value | 557 divemenu_set_xgas2_o2plus3: ; save current value |
555 movff lo, EEDATA | 558 movff lo, EEDATA |
556 write_int_eeprom d'24' ; O2 Value | 559 write_int_eeprom d'24' ; O2 Value |