# HG changeset patch
# User heinrichsweikamp
# Date 1328208225 -3600
# Node ID c67bf1ca73ef1fe79864a88dd026d15f329ad1ec
# Parent  cdc1163a8e9e0ec6e4e883df199d1b5a36c74b7a# Parent  9e20de11fb78cfacc726b380b6e789d116be6ccf
Merge with 550

diff -r cdc1163a8e9e -r c67bf1ca73ef code_part1/OSTC_code_asm_part1/changelog.txt
--- a/code_part1/OSTC_code_asm_part1/changelog.txt	Thu Feb 02 16:05:09 2012 +0100
+++ b/code_part1/OSTC_code_asm_part1/changelog.txt	Thu Feb 02 19:43:45 2012 +0100
@@ -1,7 +1,10 @@
+New in 2.21 beta:
+BETA Version - Do NOT use for diving!
+BUGFIX: GF warning in logbook memory
+
 New in 2.20:
 Stable Release
 
-
 New in 2.10 beta:
 BETA Version - Do NOT use for diving!
 BUGFIX: Spurious logbook read issue
diff -r cdc1163a8e9e -r c67bf1ca73ef code_part1/OSTC_code_asm_part1/definitions.asm
--- a/code_part1/OSTC_code_asm_part1/definitions.asm	Thu Feb 02 16:05:09 2012 +0100
+++ b/code_part1/OSTC_code_asm_part1/definitions.asm	Thu Feb 02 19:43:45 2012 +0100
@@ -22,9 +22,9 @@
 ; ToDo:
 
 #DEFINE	softwareversion_x		d'2'		; Software version  XX.YY
-#DEFINE	softwareversion_y		d'20'		; Software version  XX.YY
+#DEFINE	softwareversion_y		d'21'		; Software version  XX.YY
 
-#DEFINE softwareversion_beta 	0 			; (and 0 for release) 
+#DEFINE softwareversion_beta 	1 			; (and 0 for release) 
 
 #DEFINE	max_custom_number		d'58'		; Number of last used custom function
 
diff -r cdc1163a8e9e -r c67bf1ca73ef code_part1/OSTC_code_asm_part1/divemode.asm
--- a/code_part1/OSTC_code_asm_part1/divemode.asm	Thu Feb 02 16:05:09 2012 +0100
+++ b/code_part1/OSTC_code_asm_part1/divemode.asm	Thu Feb 02 19:43:45 2012 +0100
@@ -249,23 +249,15 @@
 	return
 
 set_leds_divemode:
-	movff	char_O_gradient_factor,lo		; gradient factor absolute
-
-	GETCUSTOM8	d'14'		; threshold for LED warning
-	cpfslt	lo				; 
-	call	warn_gf1		; show warning, set flags
-
-	movff	char_I_deco_model,lo
-		decfsz	lo,W		; jump over return if char_I_deco_model == 1
-	return
-
+	movff	char_O_gradient_factor,lo			; gradient factor absolute (Non-GF model)
+	movff	char_I_deco_model,hi
+	decfsz	hi,F		; jump over next line if char_I_deco_model == 1
 	movff	char_O_relative_gradient_GF,lo		; gradient factor relative (GF model)
-
-	GETCUSTOM8	d'14'		; threshold for LED warning
-	cpfslt	lo				; 
-	call	warn_gf1		; show warning, set flags
-
-	return
+	
+	GETCUSTOM8	d'14'		; threshold for LED warning into WREG
+	cpfslt	lo				; Lower then actual warning?
+	rcall	warn_gf1		; No, show warning and set flags
+	return					; Yes, return
 
 warn_gf1:
 	movlw		d'2'			; Type of Alarm