changeset 730:ae641bcb0d02

store a bailout event in the logbook
author heinrichsweikamp
date Sun, 16 Jun 2013 16:09:02 +0200
parents 71e88ee8bbf2
children 87c74962b7e1
files code_part1/OSTC_code_asm_part1/definitions.asm code_part1/OSTC_code_asm_part1/divemode.asm code_part1/OSTC_code_asm_part1/divemode_menu.asm code_part1/OSTC_code_asm_part1/start.asm docu/ostc_interface_description.odt
diffstat 5 files changed, 22 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/code_part1/OSTC_code_asm_part1/definitions.asm	Sun Jun 16 15:50:37 2013 +0200
+++ b/code_part1/OSTC_code_asm_part1/definitions.asm	Sun Jun 16 16:09:02 2013 +0200
@@ -574,4 +574,5 @@
 #DEFINE	maxdepth_greater_100m	flag15,6	;=1: Max Depth greater>100m
 #DEFINE	show_cns_in_logbook		flag15,7	;=1: Show CNS value in logbook (>= V1.84)
 
+#DEFINE store_bailout_event     flag16,0    ;=1: Store the bailout event
 
--- a/code_part1/OSTC_code_asm_part1/divemode.asm	Sun Jun 16 15:50:37 2013 +0200
+++ b/code_part1/OSTC_code_asm_part1/divemode.asm	Sun Jun 16 16:09:02 2013 +0200
@@ -758,6 +758,12 @@
 	addwf	ProfileFlagByte,F	; add to ProfileFlagByte
 	bsf		EventByte,6			; Also set Flag in EventByte!
 check_event3:
+    btfss	store_bailout_event ; Check flag
+	bra		check_event4
+	movlw	d'2'				; Information length
+	addwf	ProfileFlagByte,F	; add to ProfileFlagByte
+	bsf		EventByte,7			; Also set Flag in EventByte!
+check_event4:
 	bsf		ProfileFlagByte,7	; Set EventByte Flag in ProfileFlagByte
 
 store_dive_data3:
@@ -841,6 +847,14 @@
 	bcf		setpoint_changed		; Clear this event
 
 store_dive_data5:
+    btfss	store_bailout_event     ; Check flag
+    bra		store_dive_data6
+    movff   char_I_O2_ratio,WREG
+    call	write_external_eeprom
+    movff   char_I_He_ratio,WREG
+    call	write_external_eeprom
+    bcf		store_bailout_event		; Clear this event
+store_dive_data6:
 	bcf		event_occured		; Clear the global event flag
 	return						; Done. (Sample with all informations written to EEPROM)
 	
@@ -2028,6 +2042,7 @@
 	clrf	AlarmType					; Clear all alarms
 	bcf		event_occured				; clear flag
 	bcf		setpoint_changed			; clear flag
+    bcf     store_bailout_event         ; clear flag
 	rcall	reset_average1				; Reset the resettable average depth
 	clrf	average_depth_hold_total+0
 	clrf	average_depth_hold_total+1
--- a/code_part1/OSTC_code_asm_part1/divemode_menu.asm	Sun Jun 16 15:50:37 2013 +0200
+++ b/code_part1/OSTC_code_asm_part1/divemode_menu.asm	Sun Jun 16 16:09:02 2013 +0200
@@ -619,7 +619,8 @@
     bsf     decoplan_invalid            ; The decoplan needs to updated
     clrf    WREG
     movff   WREG,char_O_deco_status     ; Restart decoplan computation mH
-    bsf		is_bailout					;=1: CC mode, but bailout active!		
+    bsf		is_bailout					;=1: CC mode, but bailout active!
+    bsf     store_bailout_event
 	clrf	lo							; clear Setpoint, DISP_const_ppO2_value now displayes "Bail"
 	movff	lo,char_I_const_ppO2
     movlw   6
@@ -745,7 +746,9 @@
 	bra		divemode_set_xgas			; Configure the extra gas
 
 divemenu_set_gas2b:
-	bsf		is_bailout					;=1: CC mode, but bailout active!		
+	bsf		is_bailout					;=1: CC mode, but bailout active!
+    bsf     store_bailout_event
+	bsf		event_occured				; set global event flag
 	clrf	lo							; clear Setpoint, DISP_const_ppO2_value now displayes "Bail"
 	movff	lo,char_I_const_ppO2		
 
--- a/code_part1/OSTC_code_asm_part1/start.asm	Sun Jun 16 15:50:37 2013 +0200
+++ b/code_part1/OSTC_code_asm_part1/start.asm	Sun Jun 16 16:09:02 2013 +0200
@@ -214,6 +214,7 @@
 	clrf	flag13
 	clrf	flag14
 	clrf	flag15
+    clrf	flag16
 
     ; Should we set win_flip_screen ?
 	bsf		flag1,0                 ; Precondition to yes
Binary file docu/ostc_interface_description.odt has changed