system/drivers/fatfs/cluster.c
/*
 * ClearCluster();
 *
 * Attempts to clear a cluster, returns 0 on success.
 */


Attempts to clear a cluster, returns 0 on success.
Attempts to clear a cluster returns 0 on success .
int ClearCluster(uint32_t cluster) {
  uint32_t sector;
  int c;
  uint8_t clear_sector[512];
  memset(clear_sector, 0, 512);
  sector = ClusterToSector(cluster);
  for (c = 0; c < fsb.bpb.sectors_per_cluster; c++) {
    if (writeSector(clear_sector, sector + c, 0, 512) != 0)
      return -1;
  }
  return 0;
}
int ClearCluster ( uint32_t cluster ) { uint32_t sector ; int c ; uint8_t clear_sector [ 512 ] ; memset ( clear_sector , 0 , 512 ) ; sector = ClusterToSector ( cluster ) ; for ( c = 0 ; c < fsb . bpb . sectors_per_cluster ; c ++ ) { if ( writeSector ( clear_sector , sector + c , 0 , 512 ) != 0 ) return -1 ; } return 0 ; }
ClearCluster();
ClearCluster () ;