diff code_part1/OSTC_code_asm_part1/pled_outputs.asm @ 572:80a1d2d5a9ee

timeout display when deco stops are violated
author heinrichsweikamp
date Fri, 20 Apr 2012 21:32:03 +0200
parents 7f5419d4157d
children 101fec6a6137
line wrap: on
line diff
--- a/code_part1/OSTC_code_asm_part1/pled_outputs.asm	Sat Apr 14 12:25:30 2012 +0200
+++ b/code_part1/OSTC_code_asm_part1/pled_outputs.asm	Fri Apr 20 21:32:03 2012 +0200
@@ -569,14 +569,30 @@
 
 ;=============================================================================
 
+PLED_divemode_timeout2:
+	WIN_TOP		.54
+	WIN_LEFT	.112
+	WIN_FONT 	FT_SMALL
+	WIN_INVERT	.1
+	call    PLED_warnings_color
+	STRCPY  0x94					; "End of dive" icon
+	movff	timeout_counter, lo
+	movff	timeout_counter2, hi
+	call	convert_time				; converts hi:lo in minutes to hours (hi) and minutes (lo)
+	movf	hi,W
+	movff	lo,hi
+	movwf	lo							; exchange lo and hi
+	output_99x
+	PUTC    ':'
+	movff	hi,lo
+	output_99x
+	STRCAT_PRINT " "
+	bsf		timeout_display				; Set Flag
+	call	PLED_standard_color
+	WIN_INVERT	.0
+	return
+
 PLED_divemode_timeout:
-	btfsc	menubit						; Divemode menu active?
-	return								; Yes, return
-	btfsc	FLAG_apnoe_mode				; In Apnoe mode?
-	return								; Yes, return
-	btfsc	gauge_mode					; In Gauge mode?
-	return								; Yes, return
-
 	WIN_TOP		.54
 	WIN_LEFT	.112
 	WIN_FONT 	FT_SMALL
@@ -586,7 +602,7 @@
 	movff	lo,sub_a+0
 	movff	hi,sub_a+1
 	movff	timeout_counter, sub_b+0
-	movff	timeout_counter2, sub_b+1
+	movff	timeout_counter2, sub_b+1	; Divemode timeout
 	call	sub16						;  sub_c = sub_a - sub_b
 	movff	sub_c+0,lo
 	movff	sub_c+1,hi
@@ -603,6 +619,9 @@
 	return
 
 PLED_divemode_timeout_clear:
+	btfsc		dekostop_active				; Is a deco stop displayed?
+	call		PLED_display_deko_mask		; Yes, redraw mask
+
 	WIN_TOP		.54
 	WIN_LEFT	.112
 	movlw		d'6'