changeset 188:caf6153b26cb

new sensor raw data menu
author heinrichsweikamp
date Wed, 09 Feb 2011 17:16:07 +0100
parents 3b5f81c06db8
children b033b638c632
files code_part1/OSTC_code_asm_part1/definitions.asm code_part1/OSTC_code_asm_part1/english_text.asm code_part1/OSTC_code_asm_part1/menu.asm code_part1/OSTC_code_asm_part1/pled_outputs.asm
diffstat 4 files changed, 187 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/code_part1/OSTC_code_asm_part1/definitions.asm	Mon Feb 07 23:38:11 2011 +0100
+++ b/code_part1/OSTC_code_asm_part1/definitions.asm	Wed Feb 09 17:16:07 2011 +0100
@@ -31,8 +31,8 @@
 #DEFINE	max_custom_number		d'53'		; Number of last used custom function
 
 ; International extension. Selecting messages source:
-;#DEFINE     ENGLISH                         ; Use english_text.asm
-#DEFINE	FRENCH  						; Use french_text.asm
+#DEFINE     ENGLISH                         ; Use english_text.asm
+;#DEFINE	FRENCH  						; Use french_text.asm
 ;#DEFINE	GERMAN							; Use german_text.asm
 ;#DEFINE	SPANISH							; Use spanish_text.asm
 
--- a/code_part1/OSTC_code_asm_part1/english_text.asm	Mon Feb 07 23:38:11 2011 +0100
+++ b/code_part1/OSTC_code_asm_part1/english_text.asm	Wed Feb 09 17:16:07 2011 +0100
@@ -376,4 +376,7 @@
     TCODE    .20,   .125,    "+1 mbar"                   ;292 +1 mbar
     TCODE    .20,   .155,    "-1 mbar"                   ;293 -1 mbar
     TCODE    .85,   .185,    "Alt: "                     ;294 Alt: 
+;
+	TCODE    .20,   .125,    "Show raw data"             ;295 Show raw data
+	TCODE    .50,    .2,     "Raw Data:"                 ;296 Raw Data:
 ;=============================================================================
--- a/code_part1/OSTC_code_asm_part1/menu.asm	Mon Feb 07 23:38:11 2011 +0100
+++ b/code_part1/OSTC_code_asm_part1/menu.asm	Wed Feb 09 17:16:07 2011 +0100
@@ -359,7 +359,7 @@
 more_setup_menu_loop:
 	call	check_switches_menu
 
-	movlw	d'4'				; x-1 menu entries
+	movlw	d'5'				; x-1 menu entries
 	cpfseq	menupos
 	bra		more_setup_menu_loop2
 	movlw	d'6'
@@ -400,13 +400,66 @@
 	dcfsnz	menupos,F
 	bra		show_license
 	dcfsnz	menupos,F
-	bra		setup_menu						; spare
+	bra		show_rawdata
 	dcfsnz	menupos,F
 	bra		setup_menu						; spare
 	movlw	d'5'					; set cursor to "More again"
 	movwf	menupos
 	bra		setup_menu2						; exit...
 
+show_rawdata:						; Displays Sensor raw data
+	call	PLED_ClearScreen
+	call	PLED_topline_box
+	WIN_INVERT	.1	; Init new Wordprocessor
+	DISPLAYTEXTH	.296		; Raw Data:
+	WIN_INVERT	.0	; Init new Wordprocessor
+
+	call	PLED_static_raw_data
+
+	clrf	timeout_counter2
+	bcf		sleepmode
+	bcf		menubit2
+	bcf		menubit3
+	bsf		menubit
+	bcf		switch_left
+	bcf		switch_right
+show_rawdata_loop:
+	btfsc	switch_left					; Ack?
+	bsf		menubit2
+	btfsc	switch_right				; Ack?
+	bsf		menubit2
+
+	btfsc	menubit2
+	bra		show_rawdata_exit
+
+	btfss	menubit
+	goto	restart						; exit menu, restart and enter surfmode
+
+	btfsc	onesecupdate
+	call	timeout_surfmode
+
+	btfsc	onesecupdate
+	call	PLED_update_raw_data
+
+	btfsc	onesecupdate
+	call	set_dive_modes
+
+	bcf		onesecupdate				; End of one second tasks
+
+	btfsc	sleepmode
+	bra		show_rawdata_exit			; Exit
+
+	btfsc	divemode
+	goto	restart						; exit menu, restart and enter divemode
+
+	bra		show_rawdata_loop
+
+show_rawdata_exit:	
+	movlw	d'4'
+	movwf	menupos
+	bcf		switch_right
+	bra		more_setup_menu2			; return to "more menu" loop
+
 show_license:
 	call	startup_screen1				;1/2
 	call	startup_screen2				;1/2
--- a/code_part1/OSTC_code_asm_part1/pled_outputs.asm	Mon Feb 07 23:38:11 2011 +0100
+++ b/code_part1/OSTC_code_asm_part1/pled_outputs.asm	Wed Feb 09 17:16:07 2011 +0100
@@ -733,6 +733,132 @@
 	STRCPY_PRINT "\xB7"
 	return
 
+PLED_static_raw_data:
+	WIN_FONT 	FT_SMALL
+	WIN_LEFT	.0
+	WIN_TOP		.27
+	STRCPY  "C1:"
+	movff	C1+0,lo
+	movff	C1+1,hi
+	output_16
+	call	word_processor
+	WIN_LEFT	.80
+	WIN_TOP		.27
+	STRCPY  "C2:"
+	movff	C2+0,lo
+	movff	C2+1,hi
+	output_16
+	call	word_processor
+
+	WIN_LEFT	.0
+	WIN_TOP		.52
+	STRCPY  "C3:"
+	movff	C3+0,lo
+	movff	C3+1,hi
+	output_16
+	call	word_processor
+	WIN_LEFT	.80
+	WIN_TOP		.52
+	STRCPY  "C4:"
+	movff	C4+0,lo
+	movff	C4+1,hi
+	output_16
+	call	word_processor
+
+	WIN_LEFT	.0
+	WIN_TOP		.77
+	STRCPY  "C5:"
+	movff	C5+0,lo
+	movff	C5+1,hi
+	output_16
+	call	word_processor
+	WIN_LEFT	.80
+	WIN_TOP		.77
+	STRCPY  "C6:"
+	movff	C6+0,lo
+	movff	C6+1,hi
+	output_16
+	call	word_processor
+	return
+
+PLED_update_raw_data:
+	WIN_LEFT	.0
+	WIN_TOP		.102
+	STRCPY  "D1:"
+	movff	D1+0,lo
+	movff	D1+1,hi
+	output_16
+	call	word_processor
+	WIN_LEFT	.80
+	WIN_TOP		.102
+	STRCPY  "D2:"
+	movff	D2+0,lo
+	movff	D2+1,hi
+	output_16
+	call	word_processor
+
+	WIN_LEFT	.0
+	WIN_TOP		.127
+	STRCPY  "OFF:"
+	movff	OFF+0,lo
+	movff	OFF+1,hi
+	output_16
+	call	word_processor
+	WIN_LEFT	.80
+	WIN_TOP		.127
+	STRCPY  "SENS:"
+	movff	SENS+0,lo
+	movff	SENS+1,hi
+	output_16
+	call	word_processor
+
+	WIN_LEFT	.0
+	WIN_TOP		.152
+	STRCPY  "xdT:"
+	movff	xdT+0,lo
+	movff	xdT+1,hi
+	output_16
+	call	word_processor
+	WIN_LEFT	.80
+	WIN_TOP		.152
+	STRCPY  "xdT2:"
+	movff	xdT2+0,lo
+	movff	xdT2+1,hi
+	output_16
+	call	word_processor
+
+	WIN_LEFT	.0
+	WIN_TOP		.177
+	STRCPY  "amb:"
+	movff	amb_pressure+0,lo
+	movff	amb_pressure+1,hi
+	output_16
+	call	word_processor
+	WIN_LEFT	.80
+	WIN_TOP		.177
+	STRCPY  "temp:"
+	movff	temperature+0,lo
+	movff	temperature+1,hi
+	output_16
+	call	word_processor
+
+	call	get_battery_voltage			; get battery voltage
+	WIN_LEFT	.0
+	WIN_TOP		.202
+	STRCPY  "AD0:"
+	movff	ADRESL,lo
+	movff	ADRESH,hi
+	output_16
+	call	word_processor
+	WIN_LEFT	.80
+	WIN_TOP		.202
+	STRCPY  "BATT:"
+	movff	batt_voltage+0,lo
+	movff	batt_voltage+1,hi
+	output_16
+	call	word_processor
+	return
+
 PLED_menu_mask:
 	call	PLED_topline_box
 	WIN_INVERT	.1	; Init new Wordprocessor
@@ -767,6 +893,7 @@
 	DISPLAYTEXTH	.257	; Date format:
 	DISPLAYTEXT		.129	; Debug: 
 	DISPLAYTEXT		.187	; Show License
+	DISPLAYTEXTH	.295	; Show raw data	
 	
 	DISPLAYTEXT .11			; Exit
 	return