Mercurial > public > mk2
comparison code_part1/OSTC_code_asm_part1/divemode.asm @ 367:584741726190 64kByte Logbook
CNS Profile added
author | Heinrichsweikamp |
---|---|
date | Thu, 09 Jun 2011 19:41:48 +0200 |
parents | 88660a400338 |
children | 8781d1cf96d8 |
comparison
equal
deleted
inserted
replaced
366:ca3d15e6240e | 367:584741726190 |
---|---|
625 decfsz divisor_deco_debug,W; Check divisor | 625 decfsz divisor_deco_debug,W; Check divisor |
626 bra check_extended5 | 626 bra check_extended5 |
627 movlw d'9' ; Information length | 627 movlw d'9' ; Information length |
628 addwf ProfileFlagByte,F ; add to ProfileFlagByte | 628 addwf ProfileFlagByte,F ; add to ProfileFlagByte |
629 check_extended5: | 629 check_extended5: |
630 decfsz divisor_nuy2,W ; Check divisor | 630 decfsz divisor_cns,W ; Check divisor |
631 bra check_extended6 | 631 bra check_extended6 |
632 movlw d'0' ; Information length | 632 movlw d'1' ; Information length |
633 addwf ProfileFlagByte,F ; add to ProfileFlagByte | 633 addwf ProfileFlagByte,F ; add to ProfileFlagByte |
634 check_extended6: | 634 check_extended6: |
635 | 635 |
636 ; Second, check global event flag | 636 ; Second, check global event flag |
637 btfss event_occured ; Check global event flag | 637 btfss event_occured ; Check global event flag |
716 store_extended4: | 716 store_extended4: |
717 decfsz divisor_deco_debug,F; Check divisor | 717 decfsz divisor_deco_debug,F; Check divisor |
718 bra store_extended5 | 718 bra store_extended5 |
719 rcall store_dive_decodebug | 719 rcall store_dive_decodebug |
720 store_extended5: | 720 store_extended5: |
721 decfsz divisor_nuy2,F ; Check divisor | 721 decfsz divisor_cns,F ; Check divisor |
722 bra store_extended6 | 722 bra store_extended6 |
723 rcall store_dive_nuy2 | 723 rcall store_dive_cns |
724 store_extended6: | 724 store_extended6: |
725 | 725 |
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... |
732 clrf divisor_tank ; And clear register again, so it will never reach zero... | 732 clrf divisor_tank ; 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_nuy2,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!) |
738 clrf divisor_nuy2 ; And clear register again, so it will never reach zero... | 738 clrf divisor_cns ; And clear register again, so it will never reach zero... |
739 | 739 |
740 ostc_debug 'D' ; Sends debug-information to screen if debugmode active | 740 ostc_debug 'D' ; Sends debug-information to screen if debugmode active |
741 | 741 |
742 ; SetPoint change appended to information due to compatibility reasons | 742 ; SetPoint change appended to information due to compatibility reasons |
743 btfss setpoint_changed ; Check flag | 743 btfss setpoint_changed ; Check flag |
748 | 748 |
749 store_dive_data5: | 749 store_dive_data5: |
750 bcf event_occured ; Clear the global event flag | 750 bcf event_occured ; Clear the global event flag |
751 return ; Done. (Sample with all informations written to EEPROM) | 751 return ; Done. (Sample with all informations written to EEPROM) |
752 | 752 |
753 store_dive_nuy2: | 753 store_dive_cns: |
754 movff char_O_CNS_fraction,WREG | |
755 call write_external_eeprom ; Store in EEPROM | |
754 GETCUSTOM8 d'26' | 756 GETCUSTOM8 d'26' |
755 movwf divisor_nuy2 ; Reload divisor from CF | 757 movwf divisor_cns ; Reload divisor from CF |
756 return | 758 return |
757 | 759 |
758 store_dive_decodebug: | 760 store_dive_decodebug: |
759 ; Dump 9 bytes, int_O_DBS_bitfield .. char_O_NDL_at_20mtr | 761 ; Dump 9 bytes, int_O_DBS_bitfield .. char_O_NDL_at_20mtr |
760 lfsr FSR2, int_O_DBS_bitfield | 762 lfsr FSR2, int_O_DBS_bitfield |
1317 swapf temp1,F ; swap nibbels 0-3 with 4-7 | 1319 swapf temp1,F ; swap nibbels 0-3 with 4-7 |
1318 GETCUSTOM8 d'25' ; Divisor Decodebug | 1320 GETCUSTOM8 d'25' ; Divisor Decodebug |
1319 addwf temp1,W ; copy to bits 0-3, result in WREG | 1321 addwf temp1,W ; copy to bits 0-3, result in WREG |
1320 call write_external_eeprom | 1322 call write_external_eeprom |
1321 | 1323 |
1322 movlw d'0' ; information size nuy2 | 1324 movlw d'1' ; information size cns |
1323 movwf temp1 ; copy to bits 0-3 | 1325 movwf temp1 ; copy to bits 0-3 |
1324 swapf temp1,F ; swap nibbels 0-3 with 4-7 | 1326 swapf temp1,F ; swap nibbels 0-3 with 4-7 |
1325 GETCUSTOM8 d'26' ; Divisor nuy2 | 1327 GETCUSTOM8 d'26' ; Divisor cns |
1326 addwf temp1,W ; copy to bits 0-3, result in WREG | 1328 addwf temp1,W ; copy to bits 0-3, result in WREG |
1327 call write_external_eeprom | 1329 call write_external_eeprom |
1328 | 1330 |
1329 read_int_eeprom d'26' ; Read Salinity from EEPROM | 1331 read_int_eeprom d'26' ; Read Salinity from EEPROM |
1330 movf EEDATA,W | 1332 movf EEDATA,W |
1774 GETCUSTOM8 d'24' | 1776 GETCUSTOM8 d'24' |
1775 movwf divisor_ppo2 | 1777 movwf divisor_ppo2 |
1776 GETCUSTOM8 d'25' | 1778 GETCUSTOM8 d'25' |
1777 movwf divisor_deco_debug | 1779 movwf divisor_deco_debug |
1778 GETCUSTOM8 d'26' | 1780 GETCUSTOM8 d'26' |
1779 movwf divisor_nuy2 | 1781 movwf divisor_cns |
1780 | 1782 |
1781 btfss FLAG_apnoe_mode ; In Apnoe mode? | 1783 btfss FLAG_apnoe_mode ; In Apnoe mode? |
1782 bra divemode1 | 1784 bra divemode1 |
1783 ; Overwrite some parameters in Apnoe mode.... | 1785 ; Overwrite some parameters in Apnoe mode.... |
1784 movlw d'1' | 1786 movlw d'1' |