comparison code_part1/OSTC_code_asm_part1/divemode.asm @ 730:ae641bcb0d02

store a bailout event in the logbook
author heinrichsweikamp
date Sun, 16 Jun 2013 16:09:02 +0200
parents c6d57bed1ba0
children 920afa50bb0b
comparison
equal deleted inserted replaced
729:71e88ee8bbf2 730:ae641bcb0d02
756 bra check_event3 756 bra check_event3
757 movlw d'1' ; Information length 757 movlw d'1' ; Information length
758 addwf ProfileFlagByte,F ; add to ProfileFlagByte 758 addwf ProfileFlagByte,F ; add to ProfileFlagByte
759 bsf EventByte,6 ; Also set Flag in EventByte! 759 bsf EventByte,6 ; Also set Flag in EventByte!
760 check_event3: 760 check_event3:
761 btfss store_bailout_event ; Check flag
762 bra check_event4
763 movlw d'2' ; Information length
764 addwf ProfileFlagByte,F ; add to ProfileFlagByte
765 bsf EventByte,7 ; Also set Flag in EventByte!
766 check_event4:
761 bsf ProfileFlagByte,7 ; Set EventByte Flag in ProfileFlagByte 767 bsf ProfileFlagByte,7 ; Set EventByte Flag in ProfileFlagByte
762 768
763 store_dive_data3: 769 store_dive_data3:
764 movf ProfileFlagByte,W ; finally, write ProfileFlagByte! 770 movf ProfileFlagByte,W ; finally, write ProfileFlagByte!
765 call write_external_eeprom 771 call write_external_eeprom
839 movff ppO2_setpoint_store,WREG ; SetPoint in cbar 845 movff ppO2_setpoint_store,WREG ; SetPoint in cbar
840 call write_external_eeprom 846 call write_external_eeprom
841 bcf setpoint_changed ; Clear this event 847 bcf setpoint_changed ; Clear this event
842 848
843 store_dive_data5: 849 store_dive_data5:
850 btfss store_bailout_event ; Check flag
851 bra store_dive_data6
852 movff char_I_O2_ratio,WREG
853 call write_external_eeprom
854 movff char_I_He_ratio,WREG
855 call write_external_eeprom
856 bcf store_bailout_event ; Clear this event
857 store_dive_data6:
844 bcf event_occured ; Clear the global event flag 858 bcf event_occured ; Clear the global event flag
845 return ; Done. (Sample with all informations written to EEPROM) 859 return ; Done. (Sample with all informations written to EEPROM)
846 860
847 store_dive_cns: 861 store_dive_cns:
848 movff char_O_CNS_fraction,WREG 862 movff char_O_CNS_fraction,WREG
2026 clrf timeout_counter ; takes care of the timeout (Low byte) 2040 clrf timeout_counter ; takes care of the timeout (Low byte)
2027 clrf timeout_counter2 ; takes care of the timeout (High byte) 2041 clrf timeout_counter2 ; takes care of the timeout (High byte)
2028 clrf AlarmType ; Clear all alarms 2042 clrf AlarmType ; Clear all alarms
2029 bcf event_occured ; clear flag 2043 bcf event_occured ; clear flag
2030 bcf setpoint_changed ; clear flag 2044 bcf setpoint_changed ; clear flag
2045 bcf store_bailout_event ; clear flag
2031 rcall reset_average1 ; Reset the resettable average depth 2046 rcall reset_average1 ; Reset the resettable average depth
2032 clrf average_depth_hold_total+0 2047 clrf average_depth_hold_total+0
2033 clrf average_depth_hold_total+1 2048 clrf average_depth_hold_total+1
2034 clrf average_depth_hold_total+2 2049 clrf average_depth_hold_total+2
2035 clrf average_depth_hold_total+3 ; Clear Non-Resettable Average 2050 clrf average_depth_hold_total+3 ; Clear Non-Resettable Average