aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKing Kévin <kingkevin@cuvoodoo.info>2014-08-02 15:27:22 -0700
committerKing Kévin <kingkevin@cuvoodoo.info>2014-08-02 15:27:22 -0700
commit2ef68f1a1c43f9b1d0e851128ceaf1019bc6fe14 (patch)
tree57effdc53573389cea5f9ea581307e0a4376430e
parent1f05f5a8b8ab840c8ddd7de046ce9d3bd6b8bf26 (diff)
a time in clear_memory() for eeprom to writew
-rw-r--r--pic/MDR/MDR.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/pic/MDR/MDR.c b/pic/MDR/MDR.c
index d362e2c..3124ec9 100644
--- a/pic/MDR/MDR.c
+++ b/pic/MDR/MDR.c
@@ -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;
+ }
}
}
}