Mercurial > public > mk2
comparison 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 |
comparison
equal
deleted
inserted
replaced
383:d7a70654d968 | 384:904863f96582 |
---|---|
449 bra reset_eeprom_value ; Second pair, cleared | 449 bra reset_eeprom_value ; Second pair, cleared |
450 | 450 |
451 ; Write the two bytes lo:hi into EEPROM | 451 ; Write the two bytes lo:hi into EEPROM |
452 reset_eeprom_value: | 452 reset_eeprom_value: |
453 incf EEADR,F | 453 incf EEADR,F |
454 movff lo, EEDATA ; Lowbyte Defaul value | 454 movff lo, EEDATA ; Lowbyte Default value |
455 call write_eeprom | 455 |
456 movlw d'127' ; Work-around to prevent writing at EEPROM 0x00 to 0x04 | |
457 cpfslt EEADR ; EEADR > 127? | |
458 call write_eeprom ; Yes, write! | |
456 | 459 |
457 incf EEADR,F | 460 incf EEADR,F |
458 movff hi, EEDATA ; Highbyte default value | 461 movff hi, EEDATA ; Highbyte default value |
459 goto write_eeprom | 462 |
463 movlw d'127' ; Work-around to prevent writing at EEPROM 0x00 to 0x04 | |
464 cpfslt EEADR ; EEADR > 127? | |
465 call write_eeprom ; Yes, write! | |
466 return | |
460 | 467 |
461 reset_external_eeprom: ; deletes complete external eeprom! | 468 reset_external_eeprom: ; deletes complete external eeprom! |
462 clrf eeprom_address+0 | 469 clrf eeprom_address+0 |
463 clrf eeprom_address+1 | 470 clrf eeprom_address+1 |
464 | 471 |