changeset 626:bab5a9fc1b10

restore last used customview in dive- and surface-mode
author heinrichsweikamp
date Sat, 11 Aug 2012 15:30:30 +0200
parents 7743cf997648
children 8d2dc109ecfc
files code_part1/OSTC_code_asm_part1/customview.asm code_part1/OSTC_code_asm_part1/divemode.asm code_part1/OSTC_code_asm_part1/sleepmode.asm code_part1/OSTC_code_asm_part1/surfmode.asm docu/ostc_interface_description.odt
diffstat 5 files changed, 21 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/code_part1/OSTC_code_asm_part1/customview.asm	Thu Aug 09 09:15:26 2012 +0200
+++ b/code_part1/OSTC_code_asm_part1/customview.asm	Sat Aug 11 15:30:30 2012 +0200
@@ -190,10 +190,11 @@
 	bcf		menu3_active	            ;=1: menu entry three in divemode menu is active		
 	ostc_debug	'X'		; Sends debug-information to screen if debugmode active
 	
+	incf	menupos3,F			            ; Number of customview to show
+customview_toggle2:
 	btfsc	FLAG_apnoe_mode					; In Apnoe mode?
 	bra		customview_toggle_exit			; Yes, ignore custom view in divemode completely
 
-	incf	menupos3,F			            ; Number of customview to show
 	movlw	d'10'							; Max number
 	cpfsgt	menupos3			            ; Max reached?
 	bra		customview_mask		            ; No, show
@@ -349,6 +350,7 @@
 
 surfcustomview_toggle:
 	incf	menupos3,F			; Number of customview to show
+surfcustomview_toggle2:
 	movlw	d'4'				; Max number
 	cpfsgt	menupos3			; Max reached?
 	bra		surfcustomview_mask	; No, show
--- a/code_part1/OSTC_code_asm_part1/divemode.asm	Thu Aug 09 09:15:26 2012 +0200
+++ b/code_part1/OSTC_code_asm_part1/divemode.asm	Sat Aug 11 15:30:30 2012 +0200
@@ -37,6 +37,11 @@
 	call	PLED_active_gas_divemode	; Display gas, if required
 	call	PLED_temp_divemode			; Displays temperature
 
+; Reload last customview
+	read_int_eeprom	d'94'				; Read last selected customview dive mode into EEDATA
+	movff	EEDATA,menupos3				; Copy to menupos3
+	call	customview_toggle2			; Show customview 
+
 	btfsc	FLAG_apnoe_mode
 	bsf		realdive					; Set Realdive flag in Apnoe mode
 
@@ -1499,6 +1504,10 @@
 	movff	temp2,EEDATA
 	write_int_eeprom	d'3'			; write byte stored in EEDATA
 
+; Save dive mode custom view
+	movff	menupos3,EEDATA				; Copy to EEDATA
+	write_int_eeprom	d'94'			; Write last selected customview dive mode into EEPROM
+
 	GETCUSTOM15	.28							; Logbook Offset -> lo, hi
 	tstfsz		lo							; lo=0?
 	bra		change_logbook_offset1		; No, adjust offset	
@@ -1890,7 +1899,6 @@
 	call	PLED_brightness_full
 
 	bcf		timeout_display
-	clrf	menupos3
 	bcf		menu3_active
 	clrf	divesecs
 	clrf	samplesecs
--- a/code_part1/OSTC_code_asm_part1/sleepmode.asm	Thu Aug 09 09:15:26 2012 +0200
+++ b/code_part1/OSTC_code_asm_part1/sleepmode.asm	Sat Aug 11 15:30:30 2012 +0200
@@ -35,6 +35,11 @@
 sleeploop2:
 	call	PLED_DisplayOff			; display off
 	call	disable_rs232			; disable UART module
+
+; Save surface mode custom view
+	movff	menupos3,EEDATA			; Copy to EEDATA
+	write_int_eeprom	d'93'		; Write last selected customview surface mode into EEPROM
+
 	clrf	divemins+0
 	clrf	divemins+1
 	bcf		TRISB,6
--- a/code_part1/OSTC_code_asm_part1/surfmode.asm	Thu Aug 09 09:15:26 2012 +0200
+++ b/code_part1/OSTC_code_asm_part1/surfmode.asm	Sat Aug 11 15:30:30 2012 +0200
@@ -42,7 +42,10 @@
 	movff	last_surfpressure_30min+0,int_I_pres_surface+0			; copy surface air pressure to deco routine
 	movff	last_surfpressure_30min+1,int_I_pres_surface+1			; 30min old values 
 
-	clrf	menupos3					; Reset Custom views (Default: No custom view)
+; Reload last customview
+	read_int_eeprom	d'93'				; Read last selected customview surface mode into EEDATA
+	movff	EEDATA,menupos3				; Copy to menupos3
+	call	surfcustomview_toggle2		; Show customview 
 
 	btfsc	gauge_mode					; Ignore in gauge mode
 	bra		surfloop1
Binary file docu/ostc_interface_description.odt has changed