diff src/tft_outputs.asm @ 104:223579e905c3

Show a Safety Stop if enabled (Menu "Deco Parameters")
author heinrichsweikamp
date Tue, 03 Jun 2014 12:25:47 +0200
parents 37275e0fa7f5
children 0aaa4877ba25
line wrap: on
line diff
--- a/src/tft_outputs.asm	Mon Jun 02 12:54:12 2014 +0200
+++ b/src/tft_outputs.asm	Tue Jun 03 12:25:47 2014 +0200
@@ -489,6 +489,7 @@
 	WIN_BOX_BLACK   velocity_text_row, velocity_text_row+.22, velocity_text_column, (velocity_text_column+.7*.8)-1	; top, bottom, left, right
 	return
 
+    global  TFT_clear_decoarea
 TFT_clear_decoarea:
     WIN_BOX_BLACK   decostop_1st_stop_row, .239, decostop_1st_stop_column ,.159	; top, bottom, left, right
 	return
@@ -572,6 +573,7 @@
     call    TFT_divemask_color
 	STRCPY_TEXT_PRINT  tTTS             ; TTS
 	call	TFT_standard_color
+    bcf		show_safety_stop            ; Clear safety stop flag
     return
 
 TFT_display_deko_output_depth:		; Outputs depth (stored in lo) to POSTINC2 with "m" or w/o (For ft)
@@ -749,6 +751,40 @@
 ;	bra		TFT_display_ndl_mask2	; Clear gradient factor
 ;
 
+    global  TFT_show_safety_stop
+TFT_show_safety_stop:
+	tstfsz	safety_stop_countdown			; Countdown at zero?
+	bra		TFT_show_safety_stop2			; No, show stop
+
+	bcf		show_safety_stop				; Clear flag
+
+	btfsc	safety_stop_active				; Displayed?
+    rcall	TFT_clear_decoarea				; Yes, Clear stop
+	bcf		safety_stop_active				; Clear flag
+	rcall   TFT_display_ndl_mask			; Show NDL again
+    bra     TFT_display_ndl                 ; (And return)
+
+TFT_show_safety_stop2:
+    bsf     safety_stop_active				; Set flag
+	rcall    TFT_attention_color            ; show in yellow
+    WIN_MEDIUM	safetystop_column,safetystop_row
+	lfsr	FSR2,buffer
+	decf	safety_stop_countdown,F			; Reduce countdown
+	movff	safety_stop_countdown,lo
+	clrf	hi
+	call	convert_time					; converts hi:lo in seconds to mins (hi) and seconds (lo)
+	movf	hi,W
+	movff	lo,hi
+	movwf	lo								; exchange lo and hi
+	output_99
+	PUTC    ':'
+	movff	hi,lo
+	output_99x
+	STRCAT_PRINT ""
+	WIN_FONT 	FT_SMALL
+	rcall	TFT_standard_color
+	return
+
     global  TFT_mask_avr_stopwatch             ; Show mask for average depth and stopwatch
 TFT_mask_avr_stopwatch:
     ; The mask