diff code_part1/OSTC_code_asm_part1/customview.asm @ 150:fc699a7460e6

Fix desat graph: + clean right part, to allow decreasing animation. + In divemode, show every 10 seconds.
author JeanDo
date Mon, 10 Jan 2011 02:57:59 +0100
parents e6aa4a74c3c2
children a728b4a1b660
line wrap: on
line diff
--- a/code_part1/OSTC_code_asm_part1/customview.asm	Sun Jan 09 17:25:51 2011 +0100
+++ b/code_part1/OSTC_code_asm_part1/customview.asm	Mon Jan 10 02:57:59 2011 +0100
@@ -90,6 +90,14 @@
 	return
 
 customview_1sec_graphs:                 ; Do nothing extra
+    decfsz  apnoe_mins                  ; 10 sec passed ?
+    return                              ; No: skip.
+    movlw   .10                         ; Yes: reset counter.
+    movwf   apnoe_mins
+
+	call	deco_calc_desaturation_time	; calculate desaturation time
+	movlb	b'00000001'						; select ram bank 1
+	call	PLED_tissue_saturation_graph
 	return
 
 ;=============================================================================
@@ -120,15 +128,10 @@
 	call	PLED_show_leading_tissue_2  ; Update the leading tissue
 	return
 
-customview_minute_graphs:
-	call	deco_calc_desaturation_time	; calculate desaturation time
-	movlb	b'00000001'						; select ram bank 1
-	call	PLED_tissue_saturation_graph
-	return
-
 customview_minute_marker:               ; Do nothing extra
 customview_minute_stopwatch:            ; Do nothing extra
 customview_minute_average:				; Do nothing extra
+customview_minute_graphs:
 	return
 
 ;=============================================================================
@@ -181,13 +184,13 @@
 	decfsz		WREG,F					; WREG=1?	
 	bra			customview_toggle		; No, use next Customview
 
-    call    PLED_standard_color
-	DISPLAYTEXT		d'151'				; Set Marker?
-	bra		customview_toggle_exit	
+    call        PLED_standard_color
+	DISPLAYTEXT d'151'				    ; Set Marker?
+	bra		    customview_toggle_exit	
 
 customview_init_clock:					; Init Clock
-	call	PLED_diveclock
-	bra		customview_toggle_exit	
+	call	    PLED_diveclock
+	bra		    customview_toggle_exit	
 
 customview_init_lead_tissue:			; Show leading tissue
 	GETCUSTOM8	d'53'					; Show Lead Tissue? (=1 in WREG)
@@ -197,8 +200,8 @@
 	btfsc		no_deco_customviews		; no-deco-mode-flag = 1
 	bra			customview_toggle		; Yes, use next Customview!
 
-	call	PLED_show_leading_tissue
-	bra		customview_toggle_exit	
+	call	    PLED_show_leading_tissue
+	bra		    customview_toggle_exit	
 
 customview_init_graphs:					; Show tissue graph
  	GETCUSTOM8	d'52'					; Show Tissue Graph? (=1 in WREG)
@@ -208,10 +211,15 @@
 	btfsc		no_deco_customviews		; no-deco-mode-flag = 1
 	bra			customview_toggle		; Yes, use next Customview!
 
-	call	deco_calc_desaturation_time	; calculate desaturation time
-	movlb	b'00000001'						; select ram bank 1
-	call    PLED_tissue_saturation_graph
-	bra     customview_toggle_exit	
+    movlw       .1                      ; Draw next second.
+    movwf       apnoe_mins              ; 10sec counter.   
+
+	call	    deco_calc_desaturation_time	; calculate desaturation time
+	movlb	    b'00000001'             ; select ram bank 1
+	call	    PLED_tissue_saturation_graph
+
+	bra         customview_toggle_exit
+
 customview_toggle_exit:
 	bcf		toggle_customview			; Clear flag
 	ostc_debug	'Y'		                ; Sends debug-information to screen in debugmode
@@ -322,7 +330,9 @@
 	return
 
 surfcustomview_minute_graphs:
-	call	PLED_tissue_saturation_graph		; Draw/Update the graphs
+	call	deco_calc_desaturation_time         ; calculate desaturation time
+	movlb	b'00000001'                         ; select ram bank 1
+	call	PLED_tissue_saturation_graph        ; Draw/Update the graphs
 	return
 
 surfcustomview_minute_interval: