Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
RobTillaart committed Jan 15, 2024
1 parent 241e7d0 commit 183affd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions FRAM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,8 @@ uint32_t FRAM32::clear(uint8_t value)
void FRAM32::_writeBlock(uint32_t memAddr, uint8_t * obj, uint8_t size)
{
uint8_t _addr = _address;
if (memAddr & 0x00010000) _addr += 0x01;
if (memAddr & 0xFFFE0000) return; // ignore invalid memory addresses
if ((memAddr & 0x00010000) == 0x00010000) _addr += 0x01;

_wire->beginTransmission(_addr);
_wire->write((uint8_t) (memAddr >> 8));
Expand All @@ -621,7 +622,8 @@ void FRAM32::_writeBlock(uint32_t memAddr, uint8_t * obj, uint8_t size)
void FRAM32::_readBlock(uint32_t memAddr, uint8_t * obj, uint8_t size)
{
uint8_t _addr = _address;
if (memAddr & 0x00010000) _addr += 0x01;
if (memAddr & 0xFFFE0000) return; // ignore invalid memory addresses
if ((memAddr & 0x00010000) == 0x00010000) _addr += 0x01;

_wire->beginTransmission(_addr);
_wire->write((uint8_t) (memAddr >> 8));
Expand Down

0 comments on commit 183affd

Please sign in to comment.