MCPcopy Create free account
hub / github.com/RobTillaart/Arduino / readBlock

Method readBlock

libraries/I2C_EEPROM/I2C_eeprom.cpp:139–154  ·  view source on GitHub ↗

returns bytes read.

Source from the content-addressed store, hash-verified

137
138// returns bytes read.
139uint16_t I2C_eeprom::readBlock(const uint16_t memoryAddress, uint8_t * buffer, const uint16_t length)
140{
141 uint16_t addr = memoryAddress;
142 uint16_t len = length;
143 uint16_t rv = 0;
144 while (len > 0)
145 {
146 uint8_t cnt = I2C_BUFFERSIZE;
147 if (cnt > len) cnt = len;
148 rv += _ReadBlock(addr, buffer, cnt);
149 addr += cnt;
150 buffer += cnt;
151 len -= cnt;
152 }
153 return rv;
154}
155
156
157/////////////////////////////////////////////////////////////

Callers 2

readMethod · 0.45
initializeMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected