One byte read 2 times in EEPROM when it could be read only one time

This commit is contained in:
bsongis
2011-11-26 13:02:56 +00:00
parent 5e633363a9
commit 2ec3769bb5
+3 -2
View File
@@ -357,7 +357,8 @@ void RlcFile::nextWriteStep()
} }
if (m_ofs >= (BS-1)) { if (m_ofs >= (BS-1)) {
m_ofs = 0; m_ofs = 0;
if (!EeFsGetLink(m_currBlk)) { uint8_t nextBlk = EeFsGetLink(m_currBlk);
if (!nextBlk) {
if (!eeFs.freeList) { if (!eeFs.freeList) {
s_write_err = ERR_FULL; s_write_err = ERR_FULL;
break; break;
@@ -366,7 +367,7 @@ void RlcFile::nextWriteStep()
EeFsSetLink(m_currBlk, eeFs.freeList); EeFsSetLink(m_currBlk, eeFs.freeList);
return; return;
} }
m_currBlk = EeFsGetLink(m_currBlk); m_currBlk = nextBlk;
} }
switch (m_write_step & 0x0f) { switch (m_write_step & 0x0f) {
case WRITE_NEXT_LINK_1: case WRITE_NEXT_LINK_1: