fatfs/src/ff.c
static DWORD clst2sect (	/* !=0:Sector number, 0:Failed (invalid cluster#) */
	FATFS* fs,		/* Filesystem object */
	DWORD clst		/* Cluster# to be converted */
)
{
	clst -= 2;		/* Cluster number is origin from 2 */
	if (clst >= fs->n_fatent - 2) return 0;		/* Is it invalid cluster number? */
	return fs->database + fs->csize * clst;		/* Start sector number of the cluster */
}
/*-----------------------------------------------------------------------*/
/* Get physical sector number from cluster number                        */
/*-----------------------------------------------------------------------*/
Get physical sector number from cluster number
Get physical sector number from cluster number
static DWORD clst2sect (	
	FATFS* fs,		
	DWORD clst		
)
{
	clst -= 2;		
	if (clst >= fs->n_fatent - 2) return 0;		
	return fs->database + fs->csize * clst;		
}
static DWORD clst2sect ( FATFS * fs , DWORD clst ) { clst -= 2 ; if ( clst >= fs -> n_fatent - 2 ) return 0 ; return fs -> database + fs -> csize * clst ; }
Get physical sector number from cluster number
Get physical sector number from cluster number
/* !=0:Sector number, 0:Failed (invalid cluster#) */ /* Filesystem object */ /* Cluster# to be converted */ /* Cluster number is origin from 2 */ /* Is it invalid cluster number? */ /* Start sector number of the cluster */