comparison code_part1/OSTC_code_asm_part1/divemode.asm @ 274:a728b4a1b660

Setpoint changes stored in profile, EAD and END displayed in divemode (Customview 7)
author heinrichsweikamp
date Sun, 17 Apr 2011 17:57:44 +0200
parents 27c9bb14b008
children f8f865c70a0d
comparison
equal deleted inserted replaced
273:35bbab4d3c6f 274:a728b4a1b660
633 bra check_event2 633 bra check_event2
634 movlw d'1' ; Information length 634 movlw d'1' ; Information length
635 addwf ProfileFlagByte,F ; add to ProfileFlagByte 635 addwf ProfileFlagByte,F ; add to ProfileFlagByte
636 bsf EventByte,5 ; Also set Flag in EventByte! 636 bsf EventByte,5 ; Also set Flag in EventByte!
637 check_event2: 637 check_event2:
638 btfss setpoint_changed ; Check flag
639 bra check_event3
640 movlw d'1' ; Information length
641 addwf ProfileFlagByte,F ; add to ProfileFlagByte
642 bsf EventByte,6 ; Also set Flag in EventByte!
643 check_event3:
638 bsf ProfileFlagByte,7 ; Set EventByte Flag in ProfileFlagByte 644 bsf ProfileFlagByte,7 ; Set EventByte Flag in ProfileFlagByte
639 645
640 store_dive_data3: 646 store_dive_data3:
641 movf ProfileFlagByte,W ; finally, write ProfileFlagByte! 647 movf ProfileFlagByte,W ; finally, write ProfileFlagByte!
642 call write_external_eeprom 648 call write_external_eeprom
646 652
647 ; Store the EventByte + additional bytes now 653 ; Store the EventByte + additional bytes now
648 movf EventByte,W 654 movf EventByte,W
649 call write_external_eeprom 655 call write_external_eeprom
650 656
651 btfss manual_gas_changed ; Check flag 657 btfss manual_gas_changed ; Check flag
652 bra store_dive_data3a 658 bra store_dive_data3a
653 read_int_eeprom d'24' ; % O2 Gas6 659 read_int_eeprom d'24' ; % O2 Gas6
654 movf EEDATA,W 660 movf EEDATA,W
655 call write_external_eeprom 661 call write_external_eeprom
656 read_int_eeprom d'25' ; % He Gas6 662 read_int_eeprom d'25' ; % He Gas6
657 movf EEDATA,W 663 movf EEDATA,W
658 call write_external_eeprom 664 call write_external_eeprom
665 bcf manual_gas_changed ; Clear this event
659 666
660 store_dive_data3a: 667 store_dive_data3a:
661 btfss stored_gas_changed ; Check flag 668 btfss stored_gas_changed ; Check flag
662 bra store_dive_data3b 669 bra store_dive_data3b
663 movf active_gas,W ; Store active gas 670 movf active_gas,W ; Store active gas
664 call write_external_eeprom 671 call write_external_eeprom
665 672 bcf stored_gas_changed ; Clear this event
666 store_dive_data3b: 673 store_dive_data3b:
667 674
668 store_dive_data4: 675 store_dive_data4:
669 bcf event_occured ; Clear the global event flag
670 bcf manual_gas_changed ; Clear all events
671 bcf stored_gas_changed ; Clear all events
672 676
673 ; Store extended informations 677 ; Store extended informations
674 decfsz divisor_temperature,F ; Check divisor 678 decfsz divisor_temperature,F ; Check divisor
675 bra store_extended1 679 bra store_extended1
676 rcall store_dive_temperature 680 rcall store_dive_temperature
709 clrf divisor_deco_debug ; And clear register again, so it will never reach zero... 713 clrf divisor_deco_debug ; And clear register again, so it will never reach zero...
710 btfsc divisor_nuy2,7 ; Test highest Bit (Register must have been zero before the "decfsz" command!) 714 btfsc divisor_nuy2,7 ; Test highest Bit (Register must have been zero before the "decfsz" command!)
711 clrf divisor_nuy2 ; And clear register again, so it will never reach zero... 715 clrf divisor_nuy2 ; And clear register again, so it will never reach zero...
712 716
713 ostc_debug 'D' ; Sends debug-information to screen if debugmode active 717 ostc_debug 'D' ; Sends debug-information to screen if debugmode active
714 return ; Done. 718
719 ; SetPoint change appended to information due to compatibility reasons
720 btfss setpoint_changed ; Check flag
721 bra store_dive_data5
722 movff char_I_const_ppO2,WREG ; SetPoint in cBar
723 call write_external_eeprom
724 bcf setpoint_changed ; Clear this event
725
726 store_dive_data5:
727 bcf event_occured ; Clear the global event flag
728 return ; Done. (Sample with all informations written to EEPROM)
715 729
716 store_dive_nuy2: 730 store_dive_nuy2:
717 GETCUSTOM8 d'26' 731 GETCUSTOM8 d'26'
718 movwf divisor_nuy2 ; Reload divisor from CF 732 movwf divisor_nuy2 ; Reload divisor from CF
719 return 733 return
1663 clrf apnoe_timeout_counter ; timeout in minutes 1677 clrf apnoe_timeout_counter ; timeout in minutes
1664 clrf timeout_counter ; takes care of the timeout 1678 clrf timeout_counter ; takes care of the timeout
1665 clrf timeout_counter2 ; Here: counts to six, then store deco data and temperature 1679 clrf timeout_counter2 ; Here: counts to six, then store deco data and temperature
1666 clrf AlarmType ; Clear all alarms 1680 clrf AlarmType ; Clear all alarms
1667 bcf event_occured ; clear flag 1681 bcf event_occured ; clear flag
1682 bcf setpoint_changed ; clear flag
1668 rcall reset_average1 ; Reset the resettable average depth 1683 rcall reset_average1 ; Reset the resettable average depth
1669 clrf average_depth_hold_total+0 1684 clrf average_depth_hold_total+0
1670 clrf average_depth_hold_total+1 1685 clrf average_depth_hold_total+1
1671 clrf average_depth_hold_total+2 1686 clrf average_depth_hold_total+2
1672 clrf average_depth_hold_total+3 ; Clear Non-Resettable Average 1687 clrf average_depth_hold_total+3 ; Clear Non-Resettable Average