changeset 119:f24137eb85de

Background debugger now shows STKPTR
author heinrichsweikamp
date Sun, 26 Dec 2010 18:34:28 +0100
parents a5eacfafd37f
children e0f29e20bd24
files code_part1/OSTC_code_asm_part1/customview.asm code_part1/OSTC_code_asm_part1/debugcodes.txt code_part1/OSTC_code_asm_part1/divemode_menu.asm code_part1/OSTC_code_asm_part1/pled_outputs.asm code_part1/OSTC_code_asm_part1/start.asm
diffstat 5 files changed, 20 insertions(+), 23 deletions(-) [+]
line wrap: on
line diff
--- a/code_part1/OSTC_code_asm_part1/customview.asm	Sun Dec 26 17:02:59 2010 +0100
+++ b/code_part1/OSTC_code_asm_part1/customview.asm	Sun Dec 26 18:34:28 2010 +0100
@@ -99,6 +99,7 @@
 	return
 
 customview_toggle:		; Yes, show next customview (and delete this flag)
+	ostc_debug	'X'		; Sends debug-information to screen if debugmode active
 	incf	menupos3,F			; Number of customview to show
 	movlw	d'4'				; Max number
 	cpfsgt	menupos3			; Max reached?
@@ -138,6 +139,7 @@
 
 customview_toggle_exit:
 	bcf		toggle_customview			; Clear flag
+	ostc_debug	'Y'		; Sends debug-information to screen if debugmode active
 	return
 
 
--- a/code_part1/OSTC_code_asm_part1/debugcodes.txt	Sun Dec 26 17:02:59 2010 +0100
+++ b/code_part1/OSTC_code_asm_part1/debugcodes.txt	Sun Dec 26 18:34:28 2010 +0100
@@ -50,4 +50,6 @@
 U - Average Depth Display updated
 V - Gauge mode Stopwatch updated
 W - CNS Surfacemode updated
+X - Customview toggle start
+Y - Customview toggle end
 
--- a/code_part1/OSTC_code_asm_part1/divemode_menu.asm	Sun Dec 26 17:02:59 2010 +0100
+++ b/code_part1/OSTC_code_asm_part1/divemode_menu.asm	Sun Dec 26 18:34:28 2010 +0100
@@ -160,7 +160,7 @@
 	bra		divemode_toggle_brightness	; Toggle OLED-Brightness
 	dcfsnz	menupos,F
 	bra		timeout_divemenu2			; Quit divemode menu
-	return
+	bra		timeout_divemenu2			; Quit divemode menu
 
 divemode_menu3:
 	movff	menupos3,temp1		; copy
@@ -175,7 +175,6 @@
 
 divemode_menu3_nothing:
 	bra		timeout_divemenu2			; Quit divemode menu
-	return
 
 set_marker:
 	movlw	d'6'				; Type of Alarm  (Manual Marker)
@@ -246,7 +245,7 @@
 
 divemode_menu_simulator2:
 	dcfsnz	menupos,F
-	bra		timeout_divemenu2			; quit underwater menu!
+	bra		timeout_divemenu2			; close underwater menu!
 	dcfsnz	menupos,F
 	bra		divemode_menu_simulator_p1	; Adjust +1m
 	dcfsnz	menupos,F
@@ -260,20 +259,20 @@
 divemode_menu_simulator_common:
 	call	PLED_divemode_simulator_mask		; Redraw Simualtor mask
 
-	; Check limits (140m and 0m)
-	movlw	LOW		d'15000'
+	; Check limits (130m and 0m)
+	movlw	LOW		d'14000'
 	movwf	sub_a+0
-	movlw	HIGH	d'15000'
+	movlw	HIGH	d'14000'
 	movwf	sub_a+1
 	movff	sim_pressure+0,sub_b+0
 	movff	sim_pressure+1,sub_b+1
 	call	sub16				; sub_c = sub_a - sub_b
 	btfss	neg_flag	
 	bra		divemode_menu_simulator_common2
-	; Too deep, limit to 140m
-	movlw	LOW		d'15000'
+	; Too deep, limit to 130m
+	movlw	LOW		d'14000'
 	movwf	sim_pressure+0
-	movlw	HIGH	d'15000'
+	movlw	HIGH	d'14000'
 	movwf	sim_pressure+1
 	return
 
@@ -616,6 +615,7 @@
 
 ; Restore some outputs
 	clrf	temp8					; Page 0-1 of deco list
+	call	PLED_clear_divemode_menu; Clear dive mode menu
 
 	btfsc	FLAG_apnoe_mode				; Ignore in Apnoe mode
 	bra		timeout_divemenu2a			; skip!
@@ -632,7 +632,6 @@
 	bcf		menubit
 	bcf		premenu					; Yes, clear flags and menu, display dive time and mask again
 	call	PLED_active_gas_divemode; Display gas, if required
-	call	PLED_clear_divemode_menu; Clear dive mode menu
 	call	PLED_divemode_mask		; Display mask
 	call	PLED_divemins			; Display (new) divetime!
 	call	customview_mask			; Redraw current customview mask
--- a/code_part1/OSTC_code_asm_part1/pled_outputs.asm	Sun Dec 26 17:02:59 2010 +0100
+++ b/code_part1/OSTC_code_asm_part1/pled_outputs.asm	Sun Dec 26 18:34:28 2010 +0100
@@ -282,7 +282,6 @@
 
 
 PLED_resetdebugger:
-	bcf		LED_blue
 	call	PLED_boot				; PLED boot
 	call	PLED_ClearScreen		; clean up OLED
 	call	PLED_standard_color
@@ -299,6 +298,10 @@
 	WIN_INVERT	.0					; Init new Wordprocessor
 	call	PLED_standard_color
 	lfsr	FSR2,letter
+	movff	temp10,lo
+	output_8		
+	movlw	' '
+	movwf	POSTINC2
 	movf	debug_char+0,W
 	movwf 	POSTINC2
 	movf	debug_char+1,W
@@ -377,10 +380,10 @@
 	output_8		
 	call	word_processor
 
+	bcf		switch_left	
 PLED_resetdebugger_loop:
 	btfss	switch_left
 	bra		PLED_resetdebugger_loop		; Loop
-	bcf		LED_red
 	return
 
 PLED_divemode_mask:					; Displays mask in Dive-Mode
@@ -649,20 +652,11 @@
 
 
 PLED_diveclock:
-	call		PLED_divemask_color	; Set Color for Divemode mask
+	call	PLED_divemask_color	; Set Color for Divemode mask
 	DISPLAYTEXT		d'255'			; Clock
 	call	PLED_standard_color
 
 PLED_diveclock2:
-;	GETCUSTOM8	d'39'			; =1: Show clock in Divemode
-;	movwf	lo
-;	movlw	d'1'
-;	cpfseq	lo					; =1?
-;	return						; No, Done.
-
-;	btfsc	menubit	; is the Dive mode menu displayed?
-;	return			; Yes
-
 	WIN_TOP		.192
 	WIN_LEFT	.123
 	WIN_FONT 	FT_SMALL
@@ -2416,7 +2410,6 @@
 	WIN_FONT	FT_SMALL
 	call	PLED_standard_color
 
-
 	lfsr	FSR2,letter
 	movff	avr_rel_pressure+0,lo
 	movff	avr_rel_pressure+1,hi
--- a/code_part1/OSTC_code_asm_part1/start.asm	Sun Dec 26 17:02:59 2010 +0100
+++ b/code_part1/OSTC_code_asm_part1/start.asm	Sun Dec 26 18:34:28 2010 +0100
@@ -24,6 +24,7 @@
 
 start:
 	movlb	b'00000001'				; ram bank 1 selected
+	movff	STKPTR,temp10
 	call	init
 	btfsc	divemode				; Reset from Divemode?
 	call	PLED_resetdebugger		; Yes! Something went wrong, show reset informations