diff code_part1/OSTC_code_asm_part1/menu_reset.asm @ 464:6ad9af3a5771 2.01stable

Fix reset gas from 2.0stable
author heinrichsweikamp
date Sun, 02 Oct 2011 17:52:16 +0200
parents 770456638c66
children 7779bfa89171
line wrap: on
line diff
--- a/code_part1/OSTC_code_asm_part1/menu_reset.asm	Sun Sep 25 10:30:53 2011 +0200
+++ b/code_part1/OSTC_code_asm_part1/menu_reset.asm	Sun Oct 02 17:52:16 2011 +0200
@@ -324,23 +324,7 @@
 	bcf			nofly_active                	; Clear flag
 
 ; reset gases
-	clrf	EEADRH					; EEPROM BANK 0 !
-
-	movlw	d'3'					; address of first gas-1
-	movwf	EEADR
-	clrf	hi						; He part (default for all gases: 0%)
-	movlw	d'21'					; O2 part (21%)
-	rcall	reset_gas               ; saves default and current value for gas #1
-	movlw	d'21'					; O2 part (21%)
-	rcall	reset_gas               ; saves default and current value for gas #2
-	movlw	d'21'					; O2 part (21%)
-	rcall	reset_gas               ; saves default and current value for gas #3
-	movlw	d'21'					; O2 part (21%)
-	rcall	reset_gas               ; saves default and current value for gas #4
-	movlw	d'21'					; O2 part (21%)
-	rcall	reset_gas               ; saves default and current value for gas #5
-	movlw	d'21'					; O2 part (21%)
-	rcall	reset_gas               ; saves default and current value for gas #6
+	rcall	reset_gases
 
 reset_all_cf:
 	movlw	d'1'
@@ -434,14 +418,44 @@
 ;call	reset_external_eeprom	; delete profile memory
 	goto	restart					; all reset, quit to surfmode
 
+reset_gases:
+	clrf	EEADRH					; EEPROM BANK 0 !
+
+	movlw	d'3'					; address of first gas-1
+	movwf	EEADR
+	clrf	hi						; He part (default for all gases: 0%)
+	movlw	d'21'					; O2 part (21%)
+	rcall	reset_gas               ; saves current value for gas #1
+	movlw	d'21'					; O2 part (21%)
+	rcall	reset_gas               ; saves default value for gas #1
+	movlw	d'21'					; O2 part (21%)
+	rcall	reset_gas               ; saves current value for gas #2
+	movlw	d'21'					; O2 part (21%)
+	rcall	reset_gas               ; saves default value for gas #2
+	movlw	d'21'					; O2 part (21%)
+	rcall	reset_gas               ; saves current value for gas #3
+	movlw	d'21'					; O2 part (21%)
+	rcall	reset_gas               ; saves default value for gas #3
+	movlw	d'21'					; O2 part (21%)
+	rcall	reset_gas               ; saves current value for gas #4
+	movlw	d'21'					; O2 part (21%)
+	rcall	reset_gas               ; saves default value for gas #4
+	movlw	d'21'					; O2 part (21%)
+	rcall	reset_gas               ; saves current value for gas #5
+	movlw	d'21'					; O2 part (21%)
+	rcall	reset_gas               ; saves default value for gas #5
+	movlw	d'21'					; O2 part (21%)
+	rcall	reset_gas               ; saves current value for gas #6
+	return
+
 ; Write WREG:lo twice, w/o any type clearing, pre-incrementing EEADR
 reset_gas:
     movwf   lo
 	incf	EEADR,F
-	movff	lo, EEDATA				; Lowbyte Default value
+	movff	lo, EEDATA				; O2 Default value
 	call	write_eeprom
 	incf	EEADR,F
-	movff	hi, EEDATA				; Highbyte default value
+	movff	hi, EEDATA				; He default value
 	call    write_eeprom
 	return