se quito el led de debug de la bibilioteca
Fork of eeprom_1 by
Diff: eeprom_lib.cpp
- Revision:
- 6:7d676c26da40
- Parent:
- 5:266d466bd7b2
- Child:
- 7:cf6096a818b7
--- a/eeprom_lib.cpp Wed Jul 04 19:29:09 2018 +0000 +++ b/eeprom_lib.cpp Thu Oct 04 18:27:30 2018 +0000 @@ -211,6 +211,9 @@ * @param size number of bytes to write (uint32_t) * @return none */ +#include "main.h" +extern DigitalOut MasterLed; + void EEPROM::write(uint32_t address, int8_t data[], uint32_t length) { uint8_t page; @@ -220,7 +223,7 @@ uint8_t i,j,ind; uint8_t cmd[129]; int ack; - + // Check error if(_errnum) return; @@ -236,6 +239,8 @@ _errnum = EEPROM_OutOfRange; return; } + + // Compute blocs numbers blocs = length / _page_write; @@ -378,6 +383,7 @@ ack = _i2c.write((int)addr,(char *)cmd,remain + 1); if(ack != 0) { _errnum = EEPROM_I2cError; + MasterLed=1; //TODO: falla acá return; } @@ -459,7 +465,7 @@ ready(); } } - + MasterLed=0; } /** @@ -470,6 +476,7 @@ * @param data short to write (int16_t) * @return none */ + void EEPROM::write(uint32_t address, int16_t data) { int8_t cmd[2]; @@ -485,9 +492,7 @@ } memcpy(cmd,&data,2); - write(address,cmd,2); - } /**