diff code_part1/OSTC_code_asm_part1/divemode.asm @ 550:9e20de11fb78

GF warning in logbook memory
author heinrichsweikamp
date Thu, 02 Feb 2012 19:42:56 +0100
parents 3091628b2742
children 80a1d2d5a9ee
line wrap: on
line diff
--- a/code_part1/OSTC_code_asm_part1/divemode.asm	Sat Jan 21 15:36:44 2012 +0100
+++ b/code_part1/OSTC_code_asm_part1/divemode.asm	Thu Feb 02 19:42:56 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