diff code_part1/OSTC_code_asm_part1/divemode_menu.asm @ 277:46d1012d096a

Quick-access to menupos3 in divemode - ToDo: EAD and END in CCR mode
author heinrichsweikamp
date Mon, 18 Apr 2011 10:23:22 +0200
parents a728b4a1b660
children ce6f861d4e3e
line wrap: on
line diff
--- a/code_part1/OSTC_code_asm_part1/divemode_menu.asm	Mon Apr 18 01:19:06 2011 +0200
+++ b/code_part1/OSTC_code_asm_part1/divemode_menu.asm	Mon Apr 18 10:23:22 2011 +0200
@@ -34,6 +34,12 @@
 	bcf		switch_right
 	
 	bcf		select_bailoutgas		; Clear Flag for Bailout list
+
+	btfsc	premenu					; Pre-Menu? already shown?
+	bra		test_switches_divemode0	; Yes, check if we should jump to menu Entry3
+
+test_switches_divemode_a:
+
 	bsf		premenu					; Set Flag for premenu
 	bcf		menubit
 	clrf	timeout_counter3		; timeout_divemenu
@@ -41,12 +47,19 @@
 	btfsc	FLAG_apnoe_mode			; In Apnoe mode?
 	bra		test_switches_divemode1	; Yes!
 
-test_switches_divemode0:	
 	WIN_INVERT		.1
 	DISPLAYTEXT	.4			;Menu?
 	WIN_INVERT		.0
 	return
 
+test_switches_divemode0:
+	btfss	menu3_active				; Something to do at Menupos=3?
+	bra		test_switches_divemode_a	; No
+; Yes! So show menu and jump to this position
+	movlw	d'3'
+	movwf	menupos
+	bra		test_switches_divemode2b	; Show menu with cursor at menupos=3
+
 test_switches_divemode1:
 	DISPLAYTEXT	.141			;Quit?
 	return
@@ -76,13 +89,14 @@
 	return
 
 test_switches_divemode2a:
+	movlw	d'1'
+	movwf	menupos					; reset cursor in divemode menu
+test_switches_divemode2b:
 	bsf		menubit					; Enter Divemode-Menu!
 	bcf		premenu					; clear premenu flag
 	call	PLED_clear_divemode_menu		; Clear dive mode menu area
 	call	PLED_divemode_menu_mask_first	; Write Divemode menu1 mask
 	bcf		display_set_simulator			; Clear Simulator-Menu flag
-	movlw	d'1'
-	movwf	menupos					; reset cursor in divemode menu
 	call	PLED_divemenu_cursor	; show cursor
 	bcf		switch_right
 	bcf		switch_left				; Left button pressed!