changeset 306:ab1678d98e46

some changes for cf defaults
author heinrichsweikamp
date Sat, 30 Apr 2011 20:54:23 +0200
parents 77c70898c7aa
children 5bc3467fc421
files code_part1/OSTC_code_asm_part1/menu_reset.asm code_part1/OSTC_code_asm_part1/start.asm
diffstat 2 files changed, 18 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/code_part1/OSTC_code_asm_part1/menu_reset.asm	Sat Apr 30 14:18:30 2011 +0200
+++ b/code_part1/OSTC_code_asm_part1/menu_reset.asm	Sat Apr 30 20:54:23 2011 +0200
@@ -110,11 +110,11 @@
 
 	CF_DEFAULT    CF_INT8, 	    d'7',   d'3',   d'18'   ; minimum_velocity		    7min/min
 	CF_DEFAULT    CF_INT15,	    d'1160',d'950', 0    	; pressure_offset_divemode	1160mBar
-	CF_DEFAULT    CF_INT15,	    d'1100',d'1100', 0   	; max_surfpressure		    1100mBar
+	CF_DEFAULT    CF_INT15,	    d'1080',d'1080', 0   	; max_surfpressure		    1080mBar
 	CF_DEFAULT    CF_PERCENT,	d'20',  d'1',  d'99'   	; min_gradient_factor		20%
 	CF_DEFAULT    CF_PERCENT,	d'20',  d'1',  d'22'	; oxygen_threshold			22%
 
-	CF_DEFAULT    CF_SEC,	    d'30',  d'5',   d'30'   ; dive_menu_timeout		    30s
+	CF_DEFAULT    CF_SEC,	    d'45',  d'5',   d'60'   ; dive_menu_timeout		    45s
 	CF_DEFAULT    CF_PERCENT,   d'110', d'110', d'200' 	; saturation_multiplier		x1.10
 	CF_DEFAULT    CF_PERCENT,   d'90',  d'50',  d'90'   ; desaturation_multiplier	x0.90
 	CF_DEFAULT    CF_PERCENT,	d'60',  d'60',  d'100'	; nofly_time_ratio			60%
@@ -156,7 +156,7 @@
 	CF_DEFAULT    CF_BOOL,	    d'1',   0,      0       ; warn_ceiling_divemode		=1 Warn ceiling violation in divemode
 	CF_DEFAULT    CF_BOOL,      d'1',   0,      0 		; Show mix type is surfmode
 
-	CF_DEFAULT    CF_BOOL,	    d'0',   0,      0       ; blink_gas_divemode 		=1 blink better gas
+	CF_DEFAULT    CF_BOOL,	    d'1',   0,      0       ; blink_gas_divemode 		=1 blink better gas
 	CF_DEFAULT    CF_INT15,     d'13000', 0,   d'13000' ; color_warn_depth_mBar		Warn depths
 	CF_DEFAULT    CF_PERCENT,	d'101', d'50',  d'101'	; color_warn_cns_percent    Warn-%
 	CF_DEFAULT    CF_PERCENT,	d'101', d'50',  d'101'  ; color_warn_gf_percent		Warn-%
--- a/code_part1/OSTC_code_asm_part1/start.asm	Sat Apr 30 14:18:30 2011 +0200
+++ b/code_part1/OSTC_code_asm_part1/start.asm	Sat Apr 30 20:54:23 2011 +0200
@@ -28,9 +28,16 @@
 	clrf    temp10+1
 
 	call	init
+
+	read_int_eeprom	d'92'			; Read number of CF used in this firmware	
+	movlw	0xFF					; First start value
+	cpfseq	EEDATA					; Compare 
+	bra		start2					; Normal power-on/hard reset boot
+	bra		first_start				; Reset and jump to surfmode
+start2:
 	btfsc	divemode				; Reset from Divemode?
 	call	PLED_resetdebugger		; Yes! Something went wrong, show reset informations
-
+start3:
 	clrf	STKPTR					; Clear Stackpointer
 	lfsr	FSR0, 10Bh				; Clear rambank 1-9, do not delete RTC registers
 clear_rambank:
@@ -130,7 +137,7 @@
 	movwf	EEDATA		
 	call	write_eeprom			; write version y
 	clrf	EEADRH					; Reset EEADRH
-;	goto	reset_all_cf			; resets all custom functions bank0 and bank1 and jumps to "restart"
+	goto	reset_all_cf			; resets all custom functions bank0 and bank1 and jumps to "restart"
 ;	goto	reset_all_cf_bank1		; resets all custom functions bank1 and jumps to "restart"
 			
 restart:
@@ -350,6 +357,12 @@
 	return
 	bra		screen3_loop				; loop screen
 
+first_start:
+	movlw	max_custom_number		; Defined in definitions.asm
+	movwf	EEDATA
+	write_int_eeprom	d'92'		; Store number of CF used in this firmware
+	bra		start3					; continue with normal start
+
 init:						
 	movlw	b'01101100'		; 4MHz (x4 PLL)
 	movwf	OSCCON