changeset 39:e4e91fe8b09d

remember last customview in dive and surface mode
author mh@mh-THINK.fritz.box
date Thu, 15 Aug 2013 13:55:55 +0200
parents 64976f1e0a1c
children 1e2d2b0bca5b
files src/customview.asm src/customview.inc src/divemode.asm src/ghostwriter.asm src/menu_tree.asm src/ostc3.inc src/sleepmode.asm src/surfmode.asm
diffstat 8 files changed, 16 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/customview.asm	Thu Aug 15 13:30:05 2013 +0200
+++ b/src/customview.asm	Thu Aug 15 13:55:55 2013 +0200
@@ -276,6 +276,7 @@
 	bra		customview_mask		            ; No, show
 customview_toggle_reset:					; Timeout occured
 	clrf	menupos3			            ; Reset to zero (Zero=no custom view)
+    global  customview_mask
 customview_mask:	
 	call	TFT_clear_customview_divemode	
 	WIN_SMALL	divemode_customview_column,divemode_customview_row
--- a/src/customview.inc	Thu Aug 15 13:30:05 2013 +0200
+++ b/src/customview.inc	Thu Aug 15 13:55:55 2013 +0200
@@ -17,9 +17,11 @@
     extern  customview_show_change_depth    ; Put " in lo m" or " in lo ft" into Postinc2
     extern  menuview_toggle
     extern  menuview_toggle_reset
+    extern  customview_mask
 
     ; Surface mode
     extern  surf_customview_toggle
+    extern  surf_customview_mask
 
 ;	extern	surf_customview_second
 ;	extern	surf_customview_minute
--- a/src/divemode.asm	Thu Aug 15 13:30:05 2013 +0200
+++ b/src/divemode.asm	Thu Aug 15 13:55:55 2013 +0200
@@ -36,6 +36,8 @@
 	call	TFT_ClearScreen			; clean up TFT
 	call	TFT_divemode_mask		; Display mask
 	call	TFT_temp_divemode		; Displays temperature
+    movff   customview_divemode,menupos3    ; Reload last customview
+    call    customview_mask         ; Redraw last custom view
 
 	btfsc	FLAG_apnoe_mode
 	bsf		realdive					; Set Realdive flag in Apnoe mode
@@ -1082,14 +1084,11 @@
 	clrf	apnoe_surface_mins			
 	clrf	apnoe_surface_secs		
 	clrf	apnoe_mins
-    movlw   .2
-    movwf	apnoe_secs
 	clrf	divemins+0
 	clrf	divemins+1
     bcf     no_more_divesecs                ; =1: Do no longer show seconds in divemode
 	bcf		divemode_menu_active
     clrf    menupos
-    clrf	menupos3                        ; Reset to zero (Zero=no custom view)
     clrf    menupos2                        ; Reset to zero (Zero=no premenu or simulator task)
 
     bcf     is_bailout                      ; =1: Bailout
@@ -1165,9 +1164,11 @@
 	call	disable_rs232				; Disable RS232
     btfsc   enable_screen_dumps         ; =1: Ignore vin_usb, wait for "l" command (Screen dump)
     call	enable_rs232				; Also sets to speed_normal ...
-    movlw   .2
+    ; Reset divetime seconds
+    movlw   .2                          ; Start at 2seconds
 	movwf   total_divetime_seconds+0
-	movwf   divesecs                    ; Start at 2seconds
+	movwf   divesecs
+    movwf	apnoe_secs
 	bsf		divemode2                   ; displayed divetime is running (Divetime starts HERE)
 
 	movff	int_O_CNS_fraction+0,CNS_start+0
--- a/src/ghostwriter.asm	Thu Aug 15 13:30:05 2013 +0200
+++ b/src/ghostwriter.asm	Thu Aug 15 13:55:55 2013 +0200
@@ -293,6 +293,8 @@
 	movff	ext_flash_address+1,ext_flash_log_pointer+1
 	movff	ext_flash_address+2,ext_flash_log_pointer+2	; Save end-of-profile pointer to store in header
 
+    movff   menupos3,customview_divemode            ; store last customview
+
 	btfss	realdive					; dive longer then one minute
 	goto	ghostwriter_end_dive_common				; No, discard everything
 
--- a/src/menu_tree.asm	Thu Aug 15 13:30:05 2013 +0200
+++ b/src/menu_tree.asm	Thu Aug 15 13:55:55 2013 +0200
@@ -28,6 +28,7 @@
 ; Main Menu
         global  do_main_menu
 do_main_menu:
+        movff   menupos3,customview_surfmode; save last customview
 		bcf		sleepmode				; for timeout
 		call    menu_processor_reset    ; restart from first icon.
 
--- a/src/ostc3.inc	Thu Aug 15 13:30:05 2013 +0200
+++ b/src/ostc3.inc	Thu Aug 15 13:55:55 2013 +0200
@@ -465,6 +465,8 @@
 sensor_setpoint     res 1       ; sensor ppo2 in 0.01bar for deco routine
 
 better_gas_number	res 1       ; number (1-5) of the "better gas" in divemode, =0: no better gas available
+customview_divemode res 1       ; keeps last custom view
+customview_surfmode res 1
 
 ;---------------------------- TMP DATA ---------------------------------------
 ; Space for various overlayed data from color, word, menu processors, etc.
--- a/src/sleepmode.asm	Thu Aug 15 13:30:05 2013 +0200
+++ b/src/sleepmode.asm	Thu Aug 15 13:55:55 2013 +0200
@@ -33,6 +33,7 @@
     call    mcp_sleep
 	bcf		LEDg
 	bcf		LEDr
+    movff   menupos3,customview_surfmode; save last customview
 	call	TFT_Display_FadeOut
 	call	TFT_DisplayOff			; display off
 	call	disable_rs232			; USB off
--- a/src/surfmode.asm	Thu Aug 15 13:30:05 2013 +0200
+++ b/src/surfmode.asm	Thu Aug 15 13:55:55 2013 +0200
@@ -133,7 +133,7 @@
 	call	TFT_update_surf_press		; display surface pressure
 	call	TFT_temp_surfmode			; Displays temperature
 	call	TFT_display_decotype_surface
-    extern  surf_customview_mask
+    movff   customview_surfmode,menupos3    ; Reload last customview
     call    surf_customview_mask        ; Update #menupos3 view
 
     WIN_TOP     .0