diff code_part1/OSTC_code_asm_part1/menu_reset.asm @ 384:904863f96582 64kByte Logbook

Work-Around for "Reset all" overwriting 0x00 to 0x04 in EEPROM Bank1
author heinrichsweikamp
date Sat, 18 Jun 2011 11:26:22 +0200
parents 6ee9c849ad92
children 8e272339fb68
line wrap: on
line diff
--- a/code_part1/OSTC_code_asm_part1/menu_reset.asm	Fri Jun 17 00:13:36 2011 +0200
+++ b/code_part1/OSTC_code_asm_part1/menu_reset.asm	Sat Jun 18 11:26:22 2011 +0200
@@ -451,12 +451,19 @@
 ; Write the two bytes lo:hi into EEPROM
 reset_eeprom_value:
 	incf	EEADR,F
-	movff	lo, EEDATA				; Lowbyte Defaul value
-	call	write_eeprom
+	movff	lo, EEDATA				; Lowbyte Default value
+
+	movlw	d'127'					; Work-around to prevent writing at EEPROM 0x00 to 0x04 
+	cpfslt	EEADR					; EEADR > 127?
+	call	write_eeprom			; Yes, write!
 
 	incf	EEADR,F
 	movff	hi, EEDATA				; Highbyte default value
-	goto    write_eeprom
+
+	movlw	d'127'					; Work-around to prevent writing at EEPROM 0x00 to 0x04 
+	cpfslt	EEADR					; EEADR > 127?
+	call    write_eeprom			; Yes, write!
+	return
 
 reset_external_eeprom:				; deletes complete external eeprom!
 	clrf	eeprom_address+0