changeset 507:ed51a7a89d9a

minor cleanups for TESTING mode
author JeanDo
date Sun, 20 Nov 2011 22:52:09 +0100
parents ab819be6193f
children b595569e4bcc
files code_part1/OSTC_code_asm_part1/divemode.asm code_part1/OSTC_code_asm_part1/menu_reset.asm code_part1/OSTC_code_asm_part1/start.asm
diffstat 3 files changed, 27 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/code_part1/OSTC_code_asm_part1/divemode.asm	Sun Nov 20 17:00:49 2011 +0100
+++ b/code_part1/OSTC_code_asm_part1/divemode.asm	Sun Nov 20 22:52:09 2011 +0100
@@ -303,7 +303,7 @@
 	bra		reset_decompression_gases	; While in NDL, do not set deompression gas
 
 ; Copy all gases to char_I_deco_N2_ratio and char_I_deco_He_ratio
-divemode_check_decogases:					; CALLed from Simulator, too
+divemode_check_decogases:               ; CALLed from Simulator, too
 
 	clrf    EEADRH                      ; Make sure to select eeprom bank 0
 	
--- a/code_part1/OSTC_code_asm_part1/menu_reset.asm	Sun Nov 20 17:00:49 2011 +0100
+++ b/code_part1/OSTC_code_asm_part1/menu_reset.asm	Sun Nov 20 22:52:09 2011 +0100
@@ -310,7 +310,7 @@
 
 do_menu_reset_all2:
 	call	PLED_ClearScreen
-	DISPLAYTEXT	.25					; "Reset..."
+	DISPLAYTEXT	.25					    ; "Reset..."
 
 reset_start:
 ; reset deco data
@@ -325,6 +325,8 @@
 
 ; reset gases
 	rcall	reset_gases
+	rcall   reset_all_cf
+	goto	restart					; all reset, quit to surfmode
 
 reset_all_cf:
 	movlw	d'1'
@@ -416,7 +418,7 @@
 	clrf	EEADRH					; EEPROM BANK 0 !
 
 ;call	reset_external_eeprom	; delete profile memory
-	goto	restart					; all reset, quit to surfmode
+    return
 
 reset_gases:
 	clrf	EEADRH					; EEPROM BANK 0 !
--- a/code_part1/OSTC_code_asm_part1/start.asm	Sun Nov 20 17:00:49 2011 +0100
+++ b/code_part1/OSTC_code_asm_part1/start.asm	Sun Nov 20 22:52:09 2011 +0100
@@ -58,20 +58,23 @@
 	bsf		sleepmode				; Routine only works in sleepmode...
 	call	pressuretest_sleep_fast	; Gets pressure without averaging (faster!)
 	bcf		sleepmode				; Normal mode again
-    SAFE_2BYTE_COPY amb_pressure_avg, amb_pressure	; copy for compatibility
 
-    SAFE_2BYTE_COPY amb_pressure_avg, last_surfpressure
-	SAFE_2BYTE_COPY amb_pressure_avg, amb_pressure
+  Ifdef TESTING
+    movlw   LOW(.1000)
+    movwf   amb_pressure+0
+    movlw   HIGH(.1000)
+    movwf   amb_pressure+1
+  Else
+    SAFE_2BYTE_COPY amb_pressure_avg, amb_pressure	; copy for compatibility
+  Endif
+
+    movff   amb_pressure+0,last_surfpressure+0
+    movff   amb_pressure+1,last_surfpressure+1
 	movff	last_surfpressure+0,last_surfpressure_15min+0
 	movff	last_surfpressure+1,last_surfpressure_15min+1
 	movff	last_surfpressure+0,last_surfpressure_30min+0
 	movff	last_surfpressure+1,last_surfpressure_30min+1	; Rests all airpressure registers
 
-; Extra power-up reset (JeanDo)
-	ifdef	TESTING
-		call 	do_menu_reset_all2
-	endif
-
 ; reset deco data
 	ostc_debug	'0'		; Sends debug-information to screen if debugmode active
 
@@ -84,10 +87,17 @@
 	movff	WREG,char_I_saturation_multiplier
 	GETCUSTOM8	d'12'					    ; Desaturation multiplier %
 	movff	WREG,char_I_desaturation_multiplier
-    SAFE_2BYTE_COPY amb_pressure,int_I_pres_respiration ; copy for deco routine
-	movff	int_I_pres_respiration+0,int_I_pres_surface+0     ; copy for desat routine
+    movff   amb_pressure+0,int_I_pres_respiration+0         ; copy for deco routine
+    movff   amb_pressure+1,int_I_pres_respiration+1
+	movff	int_I_pres_respiration+0,int_I_pres_surface+0   ; copy for desat routine
 	movff	int_I_pres_respiration+1,int_I_pres_surface+1		
 
+; Extra power-up reset (JeanDo)
+	ifdef	TESTING
+        call	reset_gases
+		call 	reset_all_cf
+	endif
+
 	call	deco_clear_tissue			    ;
 	call	deco_calc_desaturation_time     ; calculate desaturation time
 	call	deco_clear_CNS_fraction			; clear CNS
@@ -195,6 +205,7 @@
 	bsf		high_altitude_mode		; No, Set Flag!
 	
 	; Should we disable sleep (hardware emulator)
+  Ifndef TESTING
 restart_loop:
 	btfss	0xF81,0,A
 	bra		restart_loop
@@ -203,6 +214,7 @@
 	movlw	0x80
 	cpfslt	0xFB3,A
 	bsf		nsm						; NO-SLEEP-MODE : for hardware debugging
+  Endif
 
 	call	gassetup_sort_gaslist       ; Sorts Gaslist according to change depth
 	WIN_TOP		.0