changeset 587:e81cf407261a

V2.97 SP1
author heinrichsweikamp
date Sat, 10 Mar 2018 15:34:47 +0100
parents 06642f6ffe59
children bf0c76e9b01b
files doc/changes-V2-97-SP1.txt src/hwos.inc src/p2_deco.c src/surfmode.asm src/text_english.inc src/text_french.inc src/text_german.inc src/text_italian.inc src/tft_outputs.asm
diffstat 9 files changed, 62 insertions(+), 34 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/doc/changes-V2-97-SP1.txt	Sat Mar 10 15:34:47 2018 +0100
@@ -0,0 +1,12 @@
+hwos V2.97 SP1
+--------------
+
+- Fix in der automatischen Deko-Gas-Auswahl falls zwei oder mehr Deko-Gase mit gleicher Wechseltiefe konfiguriuert sind.
+
+- Code Verbesserung in p2_deco zur Verringerung von Compiler-Abhängigkeiten.
+
+- Kompass-Peilung wird nur noch beim Aufruf des Menus gelöscht, nicht emhr wenn der OSTC über den sleepmode geht.
+
+- Gasmengen im Deko-Kalkulator werden jetzt als Liter statt Barliter bezeichnet.
+
+- Kennzeichung der Firmware als V2.97 SP1 (Service Pack 1)
--- a/src/hwos.inc	Thu Mar 01 11:12:47 2018 +0100
+++ b/src/hwos.inc	Sat Mar 10 15:34:47 2018 +0100
@@ -1,6 +1,6 @@
 ;=============================================================================
 ;
-;   File hwos.inc									REFACTORED VERSION V2.98
+;   File hwos.inc									REFACTORED VERSION V2.97 SP1
 ;
 ;   OSTC Platform definitions
 ;
@@ -23,7 +23,7 @@
 ; Firmware definition
 #DEFINE softwareversion_x		.2			; Software version  XX.YY
 #DEFINE softwareversion_y		.97			; Software version  XX.YY
-#DEFINE softwareversion_beta	.0			; (and 0 for release)
+#DEFINE softwareversion_beta	.2			; 0= release, 1=beta, 2=SP1, 3=SP2, ...
 
 ; Firmware version will appear in "Change Firmware" style
 #DEFINE firmware_expire_year	.19
@@ -418,7 +418,7 @@
 #DEFINE cc_active				flag11,6			; =1: Constant Current active (cR Hardware)
 #DEFINE cv_active				flag11,7			; =1: Constant Voltage active (cR Hardware)
 
-#DEFINE compass_bearing_set		flag12,0			; bearing set
+#DEFINE neg_flag_velocity		flag12,0			; neg_flag backup for velocity logic
 #DEFINE compass_bearing_eq		flag12,1			; bearing is in direction? do not show << or >> 
 #DEFINE compass_bearing_lft		flag12,2			; bearing is to the left/<< if set, otherwise to the right/>>
 #DEFINE compass_bearing_vis		flag12,3			; bearing is visible? (either ahead or behind/-180°)
@@ -427,7 +427,7 @@
 #DEFINE blinking_depth_prev		flag12,6			; set by the TFT_depth.   =1: prev display had warning color
 #DEFINE blinking_depth_toggle	flag12,7			; toggle to blink
 
-#DEFINE neg_flag_velocity		flag13,0			; neg_flag backup for velocity logic
+#DEFINE compass_bearing_set		flag13,0			; bearing set
 #DEFINE analog_sw1_pressed		flag13,1			; =1: Analog switch 1 pressed
 #DEFINE analog_sw2_pressed		flag13,2			; =1: Analog switch 2 pressed
 #DEFINE sp2_switched			flag13,3			; =1: This setpoint has been autoselected already
--- a/src/p2_deco.c	Thu Mar 01 11:12:47 2018 +0100
+++ b/src/p2_deco.c	Sat Mar 10 15:34:47 2018 +0100
@@ -1,5 +1,5 @@
 // ***************************************************************************
-// p2_deco.c                                         REFACTORED VERSION V2.98+
+// p2_deco.c                                         REFACTORED VERSION V2.97 SP1
 //
 //  Created on: 12.05.2009
 //  Author: heinrichs weikamp, contributions by Ralph Lembcke and others
@@ -1021,7 +1021,8 @@
 	// After the first deco stop, gas changes are only done at deco stops now!
 
 	// check if a stop is found and there is a better gas to switch to
-	if( need_stop && gas_find_better() )
+	if( need_stop )
+	if( gas_find_better() )
 	{
 		// set the new calculation ratios for N2, He and O2
 		gas_set_ratios();
@@ -1165,7 +1166,7 @@
 		// Is the change depth of the gas shallower or equal to the change depth
 		// of the best gas found so far, or is it the first better gas found?
 		// If yes, we have a better gas
-		if( char_I_deco_gas_change[j] <= switch_depth )
+		if( char_I_deco_gas_change[j] < switch_depth )
 		{
 			switch_gas   = j+1;							// remember this gas (1..5)
 			switch_depth = char_I_deco_gas_change[j];	// remember its change depth
@@ -1971,8 +1972,8 @@
 		{
 			//---- no stop required --------------------------------------
 
-			// ascend by float_ascent_speed for 1 minute
-			sim_pres_respiration -= float_ascent_speed * METER_TO_BAR;
+			// convert next depth (without stop requirement) to absolute pressure
+			sim_pres_respiration = sim_depth_limit * METER_TO_BAR + pres_surface;
 
 			// finish deco calculation if surface is reached
 			if( sim_pres_respiration <= pres_surface )
@@ -2058,8 +2059,8 @@
 
 		// Check if there is a better gas to switch to, but only in alternative plan mode
 		// or if override is set. If yes, introduce a stop for the gas change.
-		if(    ((char_O_deco_status & DECO_PLAN_ALTERNATE) || (char_O_main_status & DECO_GASCHANGE_OVRD))
-			&& gas_find_better() )
+		if( (char_O_deco_status & DECO_PLAN_ALTERNATE) || (char_O_main_status & DECO_GASCHANGE_OVRD) )
+		if( gas_find_better() )
 		{
 			// depth in meters we came from
 			overlay unsigned char old_depth_limit = (unsigned char)((old_deco - pres_surface) * BAR_TO_METER);			
--- a/src/surfmode.asm	Thu Mar 01 11:12:47 2018 +0100
+++ b/src/surfmode.asm	Sat Mar 10 15:34:47 2018 +0100
@@ -1,6 +1,6 @@
 ;=============================================================================
 ;
-;   File surfmode.asm								REFACTORED VERSION	V2.98
+;   File surfmode.asm								REFACTORED VERSION	V2.97 SP1
 ;
 ;   Surfacemode
 ;
@@ -408,6 +408,7 @@
 
 test_switches_surfmode3a:
 	bcf		switch_left
+	bcf		compass_bearing_set			; clear bearing on entering menu
 	bsf		menubit						; Enter Menu!
 	return
 
--- a/src/text_english.inc	Thu Mar 01 11:12:47 2018 +0100
+++ b/src/text_english.inc	Sat Mar 10 15:34:47 2018 +0100
@@ -150,7 +150,7 @@
 	TCODE	tCalcAscGas,	 "Calc.Gas (B/O):"	;								## NEW bailout gas needs
 	TCODE	tTankSizes,		 "Tank Sizes"		;								## NEW bailout gas needs
 	TCODE   tLiter,			 " l"				;								## NEW bailout gas needs 
-	TCODE	tBarLiter,		"Bar Liter"
+	TCODE	tBarLiter,		"Liter"
 	TCODE	tTankFillPress,	 "Tank Press Budget";
 	TCODE	tGas1,			 "Gas 1:"			;								## NEW bailout gas needs
 	TCODE	tGas2,			 "Gas 2:"			;								## NEW bailout gas needs
--- a/src/text_french.inc	Thu Mar 01 11:12:47 2018 +0100
+++ b/src/text_french.inc	Sat Mar 10 15:34:47 2018 +0100
@@ -150,7 +150,7 @@
 	TCODE	tCalcAscGas,	 "Calc.Gaz (B/O):"	;								## NEW bailout gas needs
 	TCODE	tTankSizes,		 "Volumes Blocs"	; Tank Sizes					## NEW bailout gas needs
 	TCODE   tLiter,			 " l"				;								## NEW bailout gas needs 
-	TCODE	tBarLiter,		"Bar Litre"
+	TCODE	tBarLiter,		"Litre"
 	TCODE	tTankFillPress,	 "Pressions Blocs"	; Tank Press Budget				## NEW bailout gas needs
 	TCODE	tGas1,			 "Gaz 1:"			;								## NEW bailout gas needs
 	TCODE	tGas2,			 "Gaz 2:"			;								## NEW bailout gas needs
--- a/src/text_german.inc	Thu Mar 01 11:12:47 2018 +0100
+++ b/src/text_german.inc	Sat Mar 10 15:34:47 2018 +0100
@@ -150,7 +150,7 @@
 	TCODE	tCalcAscGas,	 	"Gasmenge(B/O):"
 	TCODE	tTankSizes,		 	"Tank Größen"
 	TCODE   tLiter,			 	" l"
-	TCODE	tBarLiter,			"Barliter"
+	TCODE	tBarLiter,			"Liter"
 	TCODE	tTankFillPress,	 	"Tank Nutzmenge"
 	TCODE	tGas1,			 	"Gas 1:"
 	TCODE	tGas2,				"Gas 2:"
--- a/src/text_italian.inc	Thu Mar 01 11:12:47 2018 +0100
+++ b/src/text_italian.inc	Sat Mar 10 15:34:47 2018 +0100
@@ -150,7 +150,7 @@
 	TCODE	tCalcAscGas,	 "Calc.Gas (B/O):"	;								## NEW bailout gas needs
 	TCODE	tTankSizes,		 "Capac. Bombola"		;								## NEW bailout gas needs
 	TCODE   tLiter,			 " l"				;								## NEW bailout gas needs 
-	TCODE	tBarLiter,		"Bar Litri"
+	TCODE	tBarLiter,		"Litri"
 	TCODE	tTankFillPress,	 "Press. Bombola";								## NEW bailout gas needs
 	TCODE	tGas1,			 "Gas 1:"			;								## NEW bailout gas needs
 	TCODE	tGas2,			 "Gas 2:"			;								## NEW bailout gas needs
--- a/src/tft_outputs.asm	Thu Mar 01 11:12:47 2018 +0100
+++ b/src/tft_outputs.asm	Sat Mar 10 15:34:47 2018 +0100
@@ -1,6 +1,6 @@
 ;=============================================================================
 ;
-;   File tft_outputs.asm							REFACTORED VERSION	V2.98
+;   File tft_outputs.asm							REFACTORED VERSION	V2.97 SP1
 ;
 ;   Startup subroutines
 ;
@@ -3027,7 +3027,7 @@
 ; Writes ostc #Serial and Firmware version in splash screen
 
 	global	TFT_serial
-TFT_serial:		
+TFT_serial:
 	WIN_TINY	.5,.225
 	STRCPY	"OSTC"					; Won't translate that...
 
@@ -3041,7 +3041,7 @@
 	cpfseq	hardware_flag
 	bra		TFT_serial3
 	STRCAT	" cR #"
-	bra	 TFT_serial_common
+	bra		TFT_serial_common
 TFT_serial3:
 	movlw	0x11
 	cpfseq	hardware_flag
@@ -3065,22 +3065,36 @@
 		movlw	color_grey				; Write header in blue when
 		call	TFT_set_color			; compiled in DEBUG mode...
 		STRCAT_PRINT "DEBUG"
-	else
-		STRCAT_PRINT ""
-		bcf		win_invert				; Reset invert flag
 		call	TFT_standard_color
-
-		movlw	softwareversion_beta	; =1: Beta, =0: Release
-		decfsz	WREG,F
-		return							; Release version -> Return
-
-		call	TFT_warnings_color
-		WIN_LEFT .160-4*9/2				; Right pad.
-		STRCPY_TEXT_PRINT tBeta
+		bcf		win_invert
+		return
+	else
+		movlw	softwareversion_beta	; =1: Beta, =0: Release, >= 2: Service Pack
+		tstfsz	WREG					; release?
+		bra		TFT_serial_6			; NO
+		bra		TFT_serial_8			; YES
+TFT_serial_6:
+		decfsz	WREG,F					; Beta?
+		bra		TFT_serial_7			; NO
+		STRCAT_PRINT ""					; YES
+		call	TFT_warnings_color		;
+		WIN_LEFT .160-4*9/2				; Right pad
+		STRCPY_TEXT tBeta
+		bra		TFT_serial_8
+TFT_serial_7:
+		STRCAT	" SP"
+		movlw	softwareversion_beta	; STRCAT destroyed WREG
+		decf	WREG,W
+		movwf	lo
+		bsf		leftbind
+		output_8
+		bcf		leftbind
+TFT_serial_8:
+		STRCAT_PRINT ""
+		call	TFT_standard_color
+		bcf		win_invert
+		return
 	endif
-	call	TFT_standard_color
-	bcf		win_invert
-	return
 
 
 ;=============================================================================
@@ -3125,7 +3139,7 @@
 
 	; Show in "change firmware" style
 	movlw	color_yellow
-	bcf	win_invert
+	bcf		win_invert
 	goto	TFT_set_color	; and return...
 
 ;-----------------------------------------------------------------------------