diff code_part1/OSTC_code_asm_part1/divemode.asm @ 98:6f8e3a08011e

1.73beta rc1 (Added new customview for divemode)
author heinrichsweikamp
date Sun, 12 Dec 2010 15:01:05 +0100
parents 3e351e25f5d1
children 966ebf905514
line wrap: on
line diff
--- a/code_part1/OSTC_code_asm_part1/divemode.asm	Sun Dec 12 01:13:48 2010 +0100
+++ b/code_part1/OSTC_code_asm_part1/divemode.asm	Sun Dec 12 15:01:05 2010 +0100
@@ -48,9 +48,6 @@
 	btfss	onesecupdate					; tasks any new second
 	bra		diveloop_loop2
 
-	btfss	premenu							; Is the divemode menu active?
-	call	PLED_diveclock					; No, show clock (If clock should be displayed)
-
 	btfsc	gauge_mode						; Only in gauge mode
 	bra		diveloop_loop1a					; One Second Tasks in Gauge mode
 	btfsc	FLAG_apnoe_mode					; Only in apnoe mode
@@ -69,9 +66,6 @@
 	call	PLED_divemins					; display (new) divetime!
 	call	timeout_divemode				; dive finished? This routine sets the required flags
 
-	btfsc	stopwatch_active				;  =1: Show Average Depth instead of Temperature
-	call	PLED_stopwatch_show			; Show stopwatch only in Average mode
-
 	btfsc	twosecupdate					; two seconds after the last call
 	bra		diveloop_loop1a2					; Common Tasks
 
@@ -110,9 +104,7 @@
 	call	set_leds_divemode				; Sets warnings, if required. Also Sets buzzer
 	btfsc	enter_error_sleep				; Enter Fatal Error Routine?
 	call	fatal_error_sleep				; Yes (In Sleepmode_vxx.asm!)
-
-	btfsc	stopwatch_active				;  =1: Show Average Depth instead of Temperature
-	call	PLED_stopwatch_show				; Show stopwatch only in Average mode
+	call	customview_second				; Do every-second tasks for the custom view area
 
 	bcf		onesecupdate					; one seconds update done
 
@@ -138,7 +130,6 @@
 diveloop_loop2a:
 	bcf		update_divetime				; clear flag
 
-
 diveloop_loop3:
 	btfss	menubit							; Divemode menu active?
 	call	test_switches_divemode			; No, Check switches normal
@@ -159,6 +150,9 @@
 	btfsc	store_sample					; store new sample?
 	call	store_dive_data					; Store profile data
 
+	btfsc	toggle_customview				; Next view?
+	call	customview_toggle				; Yes, show next customview (and delete this flag)
+
 	btfsc	menubit							; Sleep only with inactive menu...
 	bra		diveloop_loop4
 
@@ -237,16 +231,12 @@
 	return
 
 set_leds_divemode:
-	bcf		LED_red							; LEDy OFF
 	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
 
-	btfsc	ppO2_warn_value	; warn because of too high ppO2?
-	bsf		LED_red			; Yes
-
 	movff	char_I_deco_model,lo
 		decfsz	lo,W		; jump over return if char_I_deco_model == 1
 	return
@@ -257,13 +247,9 @@
 	cpfslt	lo				; 
 	call	warn_gf1		; show warning, set flags
 
-	btfsc	ppO2_warn_value	; warn because of too high ppO2?
-	bsf		LED_red			; Yes
-
 	return
 
 warn_gf1:
-	bsf			LED_red			; LED Yellow on
 	movlw		d'2'			; Type of Alarm
 	movwf		AlarmType		; Copy to Alarm Register
 	bsf			event_occured	; Set Event Flag
@@ -512,8 +498,6 @@
 	bcf		store_sample				; update only any CF20 seconds
 	bsf		update_divetime				; update divemins every CF20 seconds
 
-	bcf		LED_red						; LEDr off (Marker)
-
 	btfsc	simulatormode_active		; Are we in simulator mode?
 	return								; Yes, discard everything
 
@@ -1401,6 +1385,7 @@
 	call	set_powersafe				; red LED blinking if battery is low
 	call	PLED_max_pressure			; No, use normal max. depth
 	call	check_temp_extrema			; check for new temperature extremas
+	call	customview_minute			; Do every-minute tasks for the custom view area
 	bcf		oneminupdate
 	return
 
@@ -1553,6 +1538,8 @@
 	clrf	apnoe_secs
 	clrf	divemins+0
 	clrf	divemins+1
+	clrf	menupos3
+	bcf		menu3_active
 	clrf	divesecs
 	clrf	samplesecs
 	clrf	apnoe_timeout_counter		; timeout in minutes
@@ -1668,4 +1655,4 @@
 	movff	EEDATA, char_I_N2_ratio		; = N2!
 
 	bcf		multi_gf_display			; Do not display the multi-gf table screen
-	return
\ No newline at end of file
+	return