a time in clear_memory() for eeprom to writew

This commit is contained in:
King Kévin 2014-08-02 15:27:22 -07:00
parent 1f05f5a8b8
commit 2ef68f1a1c
1 changed files with 4 additions and 0 deletions

View File

@ -233,6 +233,7 @@ void save_code()
void clear_memory(void)
{
uint16_t address;
uint16_t wait;
/* go through memory */
for (address=0; address<0x7FFF; address++) {
if ((address%0x40)==0) { /* select page */
@ -253,6 +254,9 @@ void clear_memory(void)
send_byte(0x00); /* clear byte */
if ((address%0x40)==0x3f) { /* end of page */
send_stop(); /* finish transaction */
for (wait=0; wait<1024; wait++) { /* wait for eeprom to be writen */
wait;
}
}
}
}