# HG changeset patch
# User heinrichsweikamp
# Date 1310494917 -7200
# Node ID e6e1b89b7c3edf189d48e2cf2ef82609ad935664
# Parent  c6f9eb123b85ae5a08d8610ffacc3e38fd627b3d
BUGFIX: CNS was not cleared with a "Reset Deco"

diff -r c6f9eb123b85 -r e6e1b89b7c3e code_part1/OSTC_code_asm_part1/menu_reset.asm
--- a/code_part1/OSTC_code_asm_part1/menu_reset.asm	Mon Jul 11 16:04:35 2011 +0200
+++ b/code_part1/OSTC_code_asm_part1/menu_reset.asm	Tue Jul 12 20:21:57 2011 +0200
@@ -290,9 +290,14 @@
 ; reset deco data
 	call	PLED_ClearScreen
 	DISPLAYTEXT	.25					; "Reset..."
+
     SAFE_2BYTE_COPY amb_pressure,int_I_pres_respiration	; copy surface air pressure to deco routine
-	call	deco_clear_tissue
-	movlb	b'00000001'				; RAM Bank1 selected
+	call		deco_clear_tissue			; Reset Decodata
+	movlb		b'00000001'						; select ram bank 1
+	call		deco_calc_desaturation_time	; calculate desaturation time
+	movlb		b'00000001'						; select ram bank 1
+	call		deco_clear_CNS_fraction			; clear CNS
+	movlb		b'00000001'						; select ram bank 1
 	goto	restart					; done. quit to surfmode
 
 do_menu_reset_all:
@@ -309,8 +314,12 @@
 reset_start:
 ; reset deco data
     SAFE_2BYTE_COPY amb_pressure,int_I_pres_respiration	; copy surface air pressure to deco routine
-	call	deco_clear_tissue
-	movlb	b'00000001'				; RAM Bank1 selected
+	call		deco_clear_tissue			; Reset Decodata
+	movlb		b'00000001'						; select ram bank 1
+	call		deco_calc_desaturation_time	; calculate desaturation time
+	movlb		b'00000001'						; select ram bank 1
+	call		deco_clear_CNS_fraction			; clear CNS
+	movlb		b'00000001'						; select ram bank 1
 
 ; reset gases
 	clrf	EEADRH					; EEPROM BANK 0 !
diff -r c6f9eb123b85 -r e6e1b89b7c3e code_part1/OSTC_code_asm_part1/oled_samsung.asm
--- a/code_part1/OSTC_code_asm_part1/oled_samsung.asm	Mon Jul 11 16:04:35 2011 +0200
+++ b/code_part1/OSTC_code_asm_part1/oled_samsung.asm	Tue Jul 12 20:21:57 2011 +0200
@@ -617,6 +617,9 @@
 
 	bsf		oled_hv
 	WAITMS	d'32'
+	bsf		oled_hv
+	WAITMS	d'32'
+	bsf		oled_hv
 
 	movlw	0x05
 	rcall	PLED_CmdWrite
diff -r c6f9eb123b85 -r e6e1b89b7c3e code_part1/OSTC_code_asm_part1/start.asm
--- a/code_part1/OSTC_code_asm_part1/start.asm	Mon Jul 11 16:04:35 2011 +0200
+++ b/code_part1/OSTC_code_asm_part1/start.asm	Tue Jul 12 20:21:57 2011 +0200
@@ -221,7 +221,7 @@
 	bra		restart_1				; No new CF, continue with boot
 restart_01:
 ; Save new number of current CF count
-	call	PLED_boot                   ; PLED boot (Incl. Clear Screen!)
+	call	PLED_boot               ; PLED boot (Incl. Clear Screen!)
 	rcall	display_new_cf_installed; Show warning
 	movlw	max_custom_number		; Defined in definitions.asm
 	movwf	EEDATA