changeset 67:7815bf21d353

second debug mode page
author heinrichsweikamp
date Sat, 11 Jan 2014 22:36:17 +0100
parents 00636132cca6
children 53b64c5472e1
files src/testmode.asm src/tft_outputs.asm src/tft_outputs.inc
diffstat 3 files changed, 253 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/testmode.asm	Sat Jan 11 18:03:04 2014 +0100
+++ b/src/testmode.asm	Sat Jan 11 22:36:17 2014 +0100
@@ -24,6 +24,7 @@
 #include    "surfmode.inc"
 #include    "math.inc"
 #include    "eeprom_rs232.inc"
+#include	"ms5541.inc"
 
     extern  compass
     extern  compass_filter
@@ -37,7 +38,7 @@
 ;=============================================================================
 ; Boot tasks for all modes
 	global	testloop
-testloop:
+testloop:   ; Page1
     call	speed_normal
     bcf     no_sensor_int           ; Sensor ISR
 
@@ -101,15 +102,66 @@
 ; Mode tasks
     extern  surfloop
     btfsc   switch_left
-   	goto	surfloop    				; Exit
+   	bra     testloop2    				; Page 2
 
     btfsc   switch_right
    	goto	compass_calibration_loop
 
     btfsc	sleepmode					; Sleepmode active?
+	bra     testloop2    				; Page 2
+
+	bra		testloop_loop				; loop testmode
+
+testloop2:  ; Page2
+    call	speed_normal
+	bsf		no_sensor_int			; disable sensor interrupt
+	call	get_calibration_data	; Get calibration data from pressure sensor
+	banksel common                  ; get_calibration_data uses isr_backup
+	bcf		no_sensor_int		    ; normal sensor interrupt mode
+
+    clrf	CCP1CON					; stop PWM
+	bcf		PORTC,2					; Pull PWM output to GND
+	call	TFT_boot                ; Initialize TFT (includes clear screen)
+	WIN_TOP		.0
+	WIN_LEFT	.0
+	WIN_FONT 	FT_SMALL
+	WIN_INVERT	.0					    ; Init new Wordprocessor
+	call    TFT_standard_color
+    call    TFT_Display_FadeIn
+
+ 	clrf	timeout_counter2
+	clrf 	timeout_counter3
+	bcf		premenu						; clear premenu flag
+	bcf		menubit						; clear menu flag
+
+	bcf		switch_left
+	bcf		switch_right
+
+testloop2_loop:
+    btfss	onesecupdate				; do every second tasks?
+	bra		testloop2_loop2				; no, loop
+
+; One Second tasks
+    call    TFT_update_raw_data2
+	movlw	.240
+    call	timeout_testmode			; check timeout
+
+	bcf		onesecupdate				; every second tasks done
+
+testloop2_loop2:
+; Tasks approx. every 50ms for all modes
+    bcf     LEDg
+    btfsc   vusb_in
+    bsf     LEDg
+
+; Mode tasks
+    btfsc   switch_left
+   	goto	surfloop    				; Exit
+
+    btfsc	sleepmode					; Sleepmode active?
 	goto	sleeploop					; Yes, switch into sleepmode!
 
-	bra		testloop_loop				; loop testmode
+	bra		testloop2_loop				; loop testmode
 
 
     global  compass_calibration_loop
--- a/src/tft_outputs.asm	Sat Jan 11 18:03:04 2014 +0100
+++ b/src/tft_outputs.asm	Sat Jan 11 22:36:17 2014 +0100
@@ -1323,6 +1323,203 @@
     bcf     leftbind
     return
 
+	global	TFT_update_raw_data2
+TFT_update_raw_data2:
+    call	TFT_standard_color
+	WIN_TINY	.0,.0
+	STRCPY  "pres:"
+    SAFE_2BYTE_COPY amb_pressure, lo
+    movlw   .5  ;>1280mbar
+    cpfslt  hi
+    call	TFT_warnings_color
+	bsf		leftbind
+	output_16
+	STRCAT_PRINT "mbar "
+	WIN_TINY	.80,.0
+	STRCPY  "temp:"
+    SAFE_2BYTE_COPY temperature, lo
+	call	TFT_convert_signed_16bit	; converts lo:hi into signed-short and adds '-' to POSTINC2 if required
+	movlw	d'3'
+	movwf	ignore_digits
+	output_16dp	d'2'					; temperature
+	STRCAT_PRINT "°C "
+
+    call	TFT_standard_color
+	WIN_TINY	.0,.18
+	STRCPY  "D1:"
+	movff	D1+0,lo
+	movff	D1+1,hi
+	output_16
+	STRCAT_PRINT ""
+	WIN_TINY	.80,.18
+	STRCPY  "D2:"
+	movff	D2+0,lo
+	movff	D2+1,hi
+	output_16
+	STRCAT_PRINT ""
+
+    ; C1-C6
+	WIN_TINY	.0,.36
+	STRCPY  "C1:"
+	movff	C1+0,lo
+	movff	C1+1,hi
+	output_16
+	STRCAT_PRINT ""
+	WIN_TINY	.80,.36
+	STRCPY  "C2:"
+	movff	C2+0,lo
+	movff	C2+1,hi
+    output_16
+    STRCAT_PRINT ""
+
+	WIN_TINY	.0,.54
+	STRCPY  "C3:"
+	movff	C3+0,lo
+	movff	C3+1,hi
+	output_16
+	STRCAT_PRINT ""
+	WIN_TINY	.80,.54
+	STRCPY  "C4:"
+	movff	C4+0,lo
+	movff	C4+1,hi
+	output_16
+	STRCAT_PRINT ""
+
+	WIN_TINY	.0,.72
+	STRCPY  "C5:"
+	movff	C5+0,lo
+	movff	C5+1,hi
+	output_16
+	STRCAT_PRINT ""
+	WIN_TINY	.80,.72
+	STRCPY  "C6:"
+	movff	C6+0,lo
+	movff	C6+1,hi
+	output_16
+	STRCAT_PRINT ""
+
+;	WIN_TINY	.0,.90
+;	STRCPY  "Sens1.:"
+;    movff	o2_mv_sensor1+0,lo
+;    movff	o2_mv_sensor1+1,hi
+;    output_16dp d'4'
+;	STRCAT_PRINT "mV   "
+;	WIN_TINY	.80,.90
+;	STRCPY  "Sens2:"
+;	movff	o2_mv_sensor2+0,lo
+;	movff	o2_mv_sensor2+1,hi
+;	output_16dp d'4'
+;	STRCAT_PRINT "mV   "
+;
+;	WIN_TINY	.0,.108
+;	STRCPY  "Sens3.:"
+;    movff	o2_mv_sensor3+0,lo
+;    movff	o2_mv_sensor3+1,hi
+;    output_16dp d'4'
+;	STRCAT_PRINT "mV   "
+;	WIN_TINY	.80,.108            ; Space
+;
+;    WIN_TINY	.0,.128
+;    STRCPY  "ccDX:"
+;    movff	compass_DX_f+0,lo           ; Display calibrated data
+;    movff   compass_CX_f+0,WREG         ; by substracting compass_CX_f
+;    subwf   lo,F                        ; lo := lo - W
+;    movff	compass_DX_f+1,hi
+;    movff   compass_CX_f+1,WREG
+;    subwfb  hi,F
+;    call    TFT_convert_signed_16bit	; converts lo:hi into signed-short and adds '-' to POSTINC2 if required
+;    output_16
+;    STRCAT_PRINT "    "
+;    WIN_TINY	.80,.128
+;    STRCPY  "ccDY:"
+;    movff	compass_DY_f+0,lo
+;    movff   compass_CY_f+0,WREG
+;    subwf   lo,F
+;    movff	compass_DY_f+1,hi
+;    movff   compass_CY_f+1,WREG
+;    subwfb  hi,F
+;    call    TFT_convert_signed_16bit	; converts lo:hi into signed-short and adds '-' to POSTINC2 if required
+;    output_16
+;    STRCAT_PRINT "    "
+;    WIN_TINY	.0,.146
+;    STRCPY  "ccDZ:"
+;    movff	compass_DZ_f+0,lo
+;    movff   compass_CZ_f+0,WREG
+;    subwf   lo,F
+;    movff	compass_DZ_f+1,hi
+;    movff   compass_CZ_f+1,WREG
+;    subwfb  hi,F
+;    call    TFT_convert_signed_16bit	; converts lo:hi into signed-short and adds '-' to POSTINC2 if required
+;    output_16
+;	STRCAT_PRINT "    "
+;	WIN_TINY	.80,.146                ; Space
+;
+;	WIN_TINY	.0,.164
+;	STRCPY  "AcDX:"
+;    movff	accel_DX_f+0,lo
+;    movff	accel_DX_f+1,hi
+;    call    TFT_convert_signed_16bit	; converts lo:hi into signed-short and adds '-' to POSTINC2 if required
+;    output_16
+;	STRCAT_PRINT "mg   "
+;	WIN_TINY	.80,.164
+;	STRCPY  "AcDY:"
+;    movff	accel_DY_f+0,lo
+;    movff	accel_DY_f+1,hi
+;    call    TFT_convert_signed_16bit	; converts lo:hi into signed-short and adds '-' to POSTINC2 if required
+;    output_16
+;	STRCAT_PRINT "mg   "
+;	WIN_TINY	.0,.182
+;	STRCPY  "AcDZ:"
+;    movff	accel_DZ_f+0,lo
+;    movff	accel_DZ_f+1,hi
+;    call    TFT_convert_signed_16bit	; converts lo:hi into signed-short and adds '-' to POSTINC2 if required
+;    output_16
+;	STRCAT_PRINT "mg   "
+;
+;	WIN_TINY	.80,.182
+;    STRCPY  "Head:"
+;    movff	compass_heading+0,lo
+;    movff	compass_heading+1,hi
+;
+;    WIN_TINY	.0,.200
+;    STRCPY  "calX:"
+;    movff   compass_CX_f+0,lo
+;    movff   compass_CX_f+1,hi
+;    call    TFT_convert_signed_16bit	; converts lo:hi into signed-short and adds '-' to POSTINC2 if required
+;    output_16
+;    STRCAT  ", "
+;    movff   compass_CY_f+0,lo
+;    movff   compass_CY_f+1,hi
+;    call    TFT_convert_signed_16bit	; converts lo:hi into signed-short and adds '-' to POSTINC2 if required
+;    output_16
+;    STRCAT  ", "
+;    movff   compass_CZ_f+0,lo
+;    movff   compass_CZ_f+1,hi
+;    call    TFT_convert_signed_16bit	; converts lo:hi into signed-short and adds '-' to POSTINC2 if required
+;    output_16
+;    STRCAT_PRINT  "     "
+;
+;    WIN_TINY    .0,.218
+;    STRCPY  "Roll:"
+;    movff   compass_roll+0,lo
+;    movff   compass_roll+1,hi
+;    call    TFT_convert_signed_16bit
+;    output_16
+;    STRCAT_PRINT "   "
+;
+;    WIN_TINY    .80, .218
+;    STRCPY  "Pitch:"
+;    movff   compass_pitch+0,lo
+;    movff   compass_pitch+1,hi
+;    call    TFT_convert_signed_16bit
+;    output_16
+;    STRCAT_PRINT  "     "
+
+    call    TFT_serial
+    bcf     leftbind
+    return
+
+
     global  TFT_surface_decosettings    ; Show all deco settings
 TFT_surface_decosettings:
    ; Deco Mode
--- a/src/tft_outputs.inc	Sat Jan 11 18:03:04 2014 +0100
+++ b/src/tft_outputs.inc	Sat Jan 11 22:36:17 2014 +0100
@@ -46,6 +46,7 @@
 
 ; Debug and useless stuff
 	extern	TFT_update_raw_data
+    extern	TFT_update_raw_data2
     extern  TFT_compass_fast
 
 ; Dive mode