pic32/libraries/SD/utility/SdFile.cpp
//------------------------------------------------------------------------------
// Add a cluster to a directory file and zero the cluster.
// return with first block of cluster in the cache
Add a cluster to a directory file and zero the cluster.
return with first block of cluster in the cache
Add a cluster to a directory file and zero the cluster . return with first block of cluster in the cache
uint8_t SdFile::addDirCluster(void) {
  if (!addCluster()) return false;
  uint32_t block = vol_->clusterStartBlock(curCluster_);
  for (uint8_t i = vol_->blocksPerCluster_; i != 0; i--) {
    if (!SdVolume::cacheZeroBlock(block + i - 1)) return false;
  }
  fileSize_ += 512UL << vol_->clusterSizeShift_;
  return true;
}
uint8_t SdFile :: addDirCluster ( void ) { if ( ! addCluster ( ) ) return false ; uint32_t block = vol_ -> clusterStartBlock ( curCluster_ ) ; for ( uint8_t i = vol_ -> blocksPerCluster_ ; i != 0 ; i -- ) { if ( ! SdVolume :: cacheZeroBlock ( block + i - 1 ) ) return false ; } fileSize_ += 512UL << vol_ -> clusterSizeShift_ ; return true ; }
Add a cluster to a directory file and zero the cluster.
Add a cluster to a directory file and zero the cluster .
// zero data in cluster insure first cluster is in cache // Increase directory file size by cluster size