changeset 407:47b1135cbff3

BUGFIX: SetPoint recording for logbook BUGFIX: Divetime seconds synced with stopwatch start
author heinrichsweikamp
date Thu, 07 Jul 2011 20:17:01 +0200
parents 2534277be060
children 3e0192f6c241
files code_part1/OSTC_code_asm_part1/changelog.txt code_part1/OSTC_code_asm_part1/divemode.asm code_part1/OSTC_code_asm_part1/divemode_menu.asm
diffstat 3 files changed, 29 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/code_part1/OSTC_code_asm_part1/changelog.txt	Wed Jul 06 22:06:40 2011 +0200
+++ b/code_part1/OSTC_code_asm_part1/changelog.txt	Thu Jul 07 20:17:01 2011 +0200
@@ -1,3 +1,10 @@
+New in 1.93 beta:
+BETA Version - Do NOT use for diving!
+BUGFIX: blinking fixed setpoint if actual setpoint lower then physically possible
+BUGFIX: SetPoint recording for logbook
+BUGFIX: Divetime seconds synced with stopwatch start
+
+
 New in 1.92 beta:
 BETA Version - Do NOT use for diving!
 BUGFIX: warning color for ppO2>3,3bar and ppO2<6,55bar fixed
--- a/code_part1/OSTC_code_asm_part1/divemode.asm	Wed Jul 06 22:06:40 2011 +0200
+++ b/code_part1/OSTC_code_asm_part1/divemode.asm	Thu Jul 07 20:17:01 2011 +0200
@@ -50,6 +50,8 @@
 
 	btfsc	FLAG_const_ppO2_mode		; only in const_ppO2_mode
 	bsf		setpoint_changed			; Add a setpoint change to the first depth sample in CC mode
+	btfsc	FLAG_const_ppO2_mode		; only in const_ppO2_mode
+	bsf		event_occured				; set global event flag
 
 diveloop_loop:		; The diveloop starts here
 	btfss	onesecupdate					; tasks any new second
@@ -1422,8 +1424,11 @@
 end_dive_common:
 	bcf		simulatormode_active		; if we were in simulator mode
 
-	btfsc	restore_deco_data			; Restore decodata?
-	call	simulator_restore_tissue_data		; Yes!
+; In DEBUG compile, keep all simulated dives in logbook, Desat time, nofly, etc...
+    ifndef __DEBUG
+		btfsc	restore_deco_data			; Restore decodata?
+		call	simulator_restore_tissue_data		; Yes!
+	endif
 
 	goto	surfloop					; and return to surfaceloop
 
@@ -1553,7 +1558,7 @@
 	btfsc	high_altitude_mode		; In high altitude (Fly) mode?
 	bra		set_dive_modes3			; Yes
 
-	bcf		divemode2				; Stop time
+;	bcf		divemode2				; Stop time
 
 	GETCUSTOM8	.0					; loads dive_threshold in WREG
 	movwf	sub_a+0					; dive_treshold is in cm
@@ -1572,8 +1577,9 @@
 	return
 
 set_dive_modes2:
-	btfss	realdive					; dive longer then one minute?
-	bcf		divemode					; no -> this was no real dive
+	bcf		divemode2				; Stop time
+	btfss	realdive				; dive longer then one minute?
+	bcf		divemode				; no -> this was no real dive
 	return
 
 set_dive_modes3:
@@ -1715,17 +1721,9 @@
 	ostc_debug	'Q'		; Sends debug-information to screen if debugmode active
 	clrf	max_pressure+0				; clear some variables
 	clrf	max_pressure+1
-
 	clrf	avr_rel_pressure+0
 	clrf	avr_rel_pressure+1
 
-	clrf    EEADRH                      ; Make sure to select eeprom bank 0
-	call	PLED_brightness_low
-	read_int_eeprom	d'90'				; Brightness offset? (Dim>0, Normal = 0)
-	movlw	d'0'
-	cpfsgt	EEDATA
-	call	PLED_brightness_full
-
 	movlw	d'1'
 	movwf	apnoe_max_pressure+0
 	clrf	apnoe_max_pressure+1
@@ -1737,6 +1735,15 @@
 	clrf	divemins+1
 	clrf 	total_divetime_seconds+0
 	clrf 	total_divetime_seconds+1
+	bsf		divemode2					; displayed divetime is running (Divetime starts HERE)
+
+	clrf    EEADRH                      ; Make sure to select eeprom bank 0
+	call	PLED_brightness_low
+	read_int_eeprom	d'90'				; Brightness offset? (Dim>0, Normal = 0)
+	movlw	d'0'
+	cpfsgt	EEDATA
+	call	PLED_brightness_full
+
 	clrf	menupos3
 	bcf		menu3_active
 	clrf	divesecs
--- a/code_part1/OSTC_code_asm_part1/divemode_menu.asm	Wed Jul 06 22:06:40 2011 +0200
+++ b/code_part1/OSTC_code_asm_part1/divemode_menu.asm	Thu Jul 07 20:17:01 2011 +0200
@@ -627,6 +627,8 @@
 	movff	EEDATA, char_I_const_ppO2	; Use SetPoint
 	movff	EEDATA, ppO2_setpoint_store	; Store also in this byte...
 	bsf		setpoint_changed
+	bsf		event_occured				; set global event flag
+	bra		timeout_divemenu2			; quit menu!
 
 divemenu_set_gas1a:
 	bcf		display_set_setpoint		; Clear Display Flag