comparison code_part1/OSTC_code_asm_part1/divemode.asm @ 374:6ee9c849ad92 64kByte Logbook

GF profile. GF and Decotype in Logbok
author Heinrichsweikamp
date Sun, 12 Jun 2011 08:52:41 +0200
parents 8781d1cf96d8
children 84a1762de6ab
comparison
equal deleted inserted replaced
373:8781d1cf96d8 374:6ee9c849ad92
610 decfsz divisor_deco,W ; Check divisor 610 decfsz divisor_deco,W ; Check divisor
611 bra check_extended2 611 bra check_extended2
612 movlw d'2' ; Information length 612 movlw d'2' ; Information length
613 addwf ProfileFlagByte,F ; add to ProfileFlagByte 613 addwf ProfileFlagByte,F ; add to ProfileFlagByte
614 check_extended2: 614 check_extended2:
615 decfsz divisor_tank,W ; Check divisor 615 decfsz divisor_gf,W ; Check divisor
616 bra check_extended3 616 bra check_extended3
617 movlw d'2' ; Information length 617 movlw d'1' ; Information length
618 addwf ProfileFlagByte,F ; add to ProfileFlagByte 618 addwf ProfileFlagByte,F ; add to ProfileFlagByte
619 check_extended3: 619 check_extended3:
620 decfsz divisor_ppo2,W ; Check divisor 620 decfsz divisor_ppo2,W ; Check divisor
621 bra check_extended4 621 bra check_extended4
622 movlw d'3' ; Information length 622 movlw d'3' ; Information length
704 store_extended1: 704 store_extended1:
705 decfsz divisor_deco,F ; Check divisor 705 decfsz divisor_deco,F ; Check divisor
706 bra store_extended2 706 bra store_extended2
707 rcall store_dive_decodata 707 rcall store_dive_decodata
708 store_extended2: 708 store_extended2:
709 decfsz divisor_tank,F ; Check divisor 709 decfsz divisor_gf,F ; Check divisor
710 bra store_extended3 710 bra store_extended3
711 rcall store_dive_tankdata 711 rcall store_dive_gf
712 store_extended3: 712 store_extended3:
713 decfsz divisor_ppo2,F ; Check divisor 713 decfsz divisor_ppo2,F ; Check divisor
714 bra store_extended4 714 bra store_extended4
715 rcall store_dive_ppo2 715 rcall store_dive_ppo2
716 store_extended4: 716 store_extended4:
726 ; The next block is required to take care of "store never" 726 ; The next block is required to take care of "store never"
727 btfsc divisor_temperature,7 ; Test highest Bit (Register must have been zero before the "decfsz" command!) 727 btfsc divisor_temperature,7 ; Test highest Bit (Register must have been zero before the "decfsz" command!)
728 clrf divisor_temperature ; And clear register again, so it will never reach zero... 728 clrf divisor_temperature ; And clear register again, so it will never reach zero...
729 btfsc divisor_deco,7 ; Test highest Bit (Register must have been zero before the "decfsz" command!) 729 btfsc divisor_deco,7 ; Test highest Bit (Register must have been zero before the "decfsz" command!)
730 clrf divisor_deco ; And clear register again, so it will never reach zero... 730 clrf divisor_deco ; And clear register again, so it will never reach zero...
731 btfsc divisor_tank,7 ; Test highest Bit (Register must have been zero before the "decfsz" command!) 731 btfsc divisor_gf,7 ; Test highest Bit (Register must have been zero before the "decfsz" command!)
732 clrf divisor_tank ; And clear register again, so it will never reach zero... 732 clrf divisor_gf ; And clear register again, so it will never reach zero...
733 btfsc divisor_ppo2,7 ; Test highest Bit (Register must have been zero before the "decfsz" command!) 733 btfsc divisor_ppo2,7 ; Test highest Bit (Register must have been zero before the "decfsz" command!)
734 clrf divisor_ppo2 ; And clear register again, so it will never reach zero... 734 clrf divisor_ppo2 ; And clear register again, so it will never reach zero...
735 btfsc divisor_deco_debug,7 ; Test highest Bit (Register must have been zero before the "decfsz" command!) 735 btfsc divisor_deco_debug,7 ; Test highest Bit (Register must have been zero before the "decfsz" command!)
736 clrf divisor_deco_debug ; And clear register again, so it will never reach zero... 736 clrf divisor_deco_debug ; And clear register again, so it will never reach zero...
737 btfsc divisor_cns,7 ; Test highest Bit (Register must have been zero before the "decfsz" command!) 737 btfsc divisor_cns,7 ; Test highest Bit (Register must have been zero before the "decfsz" command!)
791 call write_external_eeprom 791 call write_external_eeprom
792 GETCUSTOM8 d'24' 792 GETCUSTOM8 d'24'
793 movwf divisor_ppo2 ; Reload divisor from CF 793 movwf divisor_ppo2 ; Reload divisor from CF
794 return 794 return
795 795
796 store_dive_tankdata: 796 store_dive_gf:
797 movlw d'0' ; Dummy Tank1 797 movff char_O_relative_gradient_GF,WREG; gradient factor relative (GF model)
798 call write_external_eeprom 798 movff char_I_deco_model,lo
799 movlw d'0' ; Dummy Tank2 799 decfsz lo,F ; jump over next line if char_I_deco_model == 1
800 movff char_O_gradient_factor,WREG ; gradient factor absolute (Non-GF model)
800 call write_external_eeprom 801 call write_external_eeprom
801 GETCUSTOM8 d'23' 802 GETCUSTOM8 d'23'
802 movwf divisor_tank ; Reload divisor from CF 803 movwf divisor_gf ; Reload divisor from CF
803 return 804 return
804 805
805 store_dive_decodata: 806 store_dive_decodata:
806 movf decodata+0,W ; =0:no stop dive, if in deco mode: ceiling in m 807 movf decodata+0,W ; =0:no stop dive, if in deco mode: ceiling in m
807 call write_external_eeprom 808 call write_external_eeprom
1343 movff total_divetime_seconds+0,WREG ; Total dive time (Regardless of CF01) 1344 movff total_divetime_seconds+0,WREG ; Total dive time (Regardless of CF01)
1344 call write_external_eeprom 1345 call write_external_eeprom
1345 movff total_divetime_seconds+1,WREG ; Total dive time (Regardless of CF01) 1346 movff total_divetime_seconds+1,WREG ; Total dive time (Regardless of CF01)
1346 call write_external_eeprom 1347 call write_external_eeprom
1347 1348
1348 GETCUSTOM8 d'32' ; GF_lo 1349
1349 call write_external_eeprom 1350
1350 GETCUSTOM8 d'33' ; GF_hi 1351 GETCUSTOM8 d'32' ; GF_lo -> WREG
1351 call write_external_eeprom 1352 movff char_I_deco_model,lo
1353 decfsz lo,F ; jump over next line if char_I_deco_model == 1
1354 movlw d'90' ; overwrite for non-gf modes
1355 call write_external_eeprom ; write WREG into external memory
1356 GETCUSTOM8 d'33' ; GF_hi -> WREG
1357 movff char_I_deco_model,lo
1358 decfsz lo,F ; jump over next line if char_I_deco_model == 1
1359 movlw d'90' ; overwrite for non-gf modes
1360 call write_external_eeprom ; write WREG into external memory
1352 read_int_eeprom d'34' ; Read deco modell 1361 read_int_eeprom d'34' ; Read deco modell
1353 movf EEDATA,W 1362 movf EEDATA,W
1354 call write_external_eeprom 1363 call write_external_eeprom ; write WREG into external memory
1355 1364
1356 clrf WREG 1365 clrf WREG
1357 call write_external_eeprom ; Spare3 1366 call write_external_eeprom ; Spare3
1358 clrf WREG 1367 clrf WREG
1359 call write_external_eeprom ; Spare2 1368 call write_external_eeprom ; Spare2
1772 GETCUSTOM8 d'21' 1781 GETCUSTOM8 d'21'
1773 movwf divisor_temperature ; load divisors for profile storage 1782 movwf divisor_temperature ; load divisors for profile storage
1774 GETCUSTOM8 d'22' 1783 GETCUSTOM8 d'22'
1775 movwf divisor_deco 1784 movwf divisor_deco
1776 GETCUSTOM8 d'23' 1785 GETCUSTOM8 d'23'
1777 movwf divisor_tank 1786 movwf divisor_gf
1778 GETCUSTOM8 d'24' 1787 GETCUSTOM8 d'24'
1779 movwf divisor_ppo2 1788 movwf divisor_ppo2
1780 GETCUSTOM8 d'25' 1789 GETCUSTOM8 d'25'
1781 movwf divisor_deco_debug 1790 movwf divisor_deco_debug
1782 GETCUSTOM8 d'26' 1791 GETCUSTOM8 d'26'