|
|
@@ -83,6 +83,7 @@ void eeprom_init(void)
|
|
|
board->check_threshold = check_threshold;
|
|
|
board->read_eeprom_page = eeprom_auto_page_read;
|
|
|
board->write_eeprom_page = eeprom_auto_page_write;
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -137,6 +138,7 @@ static void iic_stop_signal(void)
|
|
|
IIC_SDA_CLR;
|
|
|
DelayNus(4);
|
|
|
IIC_SCL_SET;
|
|
|
+ DelayNus(4);
|
|
|
IIC_SDA_SET;
|
|
|
DelayNus(4);
|
|
|
}
|
|
|
@@ -446,9 +448,9 @@ static uint8_t eeprom_page_read(uint16_t addr,uint8_t *data,uint16_t lenth)
|
|
|
}
|
|
|
|
|
|
iic_stop_signal();
|
|
|
-
|
|
|
return 0;
|
|
|
failed:
|
|
|
+ iic_stop_signal();
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
@@ -486,6 +488,7 @@ static uint8_t eeprom_write_page(uint16_t addr,uint8_t *data,uint16_t chuank)
|
|
|
|
|
|
return 0;
|
|
|
failed:
|
|
|
+ iic_stop_signal();
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
@@ -536,4 +539,5 @@ static void eeprom_auto_page_read(uint16_t addr,uint8_t *data,uint16_t lenth)
|
|
|
p += chunk;
|
|
|
remaining -= chunk;
|
|
|
}
|
|
|
-}
|
|
|
+}
|
|
|
+
|