MCPcopy Create free account
hub / github.com/MarlinFirmware/Marlin / readDirCache

Method readDirCache

Marlin/src/sd/SdBaseFile.cpp:1564–1580  ·  view source on GitHub ↗

Read next directory entry into the cache Assumes file is correctly positioned

Source from the content-addressed store, hash-verified

1562// Read next directory entry into the cache
1563// Assumes file is correctly positioned
1564dir_t* SdBaseFile::readDirCache() {
1565 uint8_t i;
1566 // error if not directory
1567 if (!isDir()) return 0;
1568
1569 // index of entry in cache
1570 i = (curPosition_ >> 5) & 0xF;
1571
1572 // use read to locate and cache block
1573 if (read() < 0) return 0;
1574
1575 // advance to next entry
1576 curPosition_ += 31;
1577
1578 // return pointer to entry
1579 return vol_->cache()->dir + i;
1580}
1581
1582/**
1583 * Remove a file.

Callers 2

openMethod · 0.80
openNextMethod · 0.80

Calls 1

cacheMethod · 0.80

Tested by

no test coverage detected