fatfs/src/ff.c
static void put_lfn (
	const WCHAR* lfn,	/* Pointer to the LFN */
	BYTE* dir,			/* Pointer to the LFN entry to be created */
	BYTE ord,			/* LFN order (1-20) */
	BYTE sum			/* Checksum of the corresponding SFN */
)
{
	UINT i, s;
	WCHAR wc;


	dir[LDIR_Chksum] = sum;			/* Set checksum */
	dir[LDIR_Attr] = AM_LFN;		/* Set attribute. LFN entry */
	dir[LDIR_Type] = 0;
	st_word(dir + LDIR_FstClusLO, 0);

	i = (ord - 1) * 13;				/* Get offset in the LFN working buffer */
	s = wc = 0;
	do {
		if (wc != 0xFFFF) wc = lfn[i++];	/* Get an effective character */
		st_word(dir + LfnOfs[s], wc);		/* Put it */
		if (wc == 0) wc = 0xFFFF;		/* Padding characters for left locations */
	} while (++s < 13);
	if (wc == 0xFFFF || !lfn[i]) ord |= LLEF;	/* Last LFN part is the start of LFN sequence */
	dir[LDIR_Ord] = ord;			/* Set the LFN order */
}
/*-----------------------------------------*/
/* FAT-LFN: Create an entry of LFN entries */
/*-----------------------------------------*/
FAT-LFN: Create an entry of LFN entries
FAT - LFN : Create an entry of LFN entries
static void put_lfn (
	const WCHAR* lfn,	
	BYTE* dir,			
	BYTE ord,			
	BYTE sum			
)
{
	UINT i, s;
	WCHAR wc;
	dir[LDIR_Chksum] = sum;			
	dir[LDIR_Attr] = AM_LFN;		
	dir[LDIR_Type] = 0;
	st_word(dir + LDIR_FstClusLO, 0);
	i = (ord - 1) * 13;				
	s = wc = 0;
	do {
		if (wc != 0xFFFF) wc = lfn[i++];	
		st_word(dir + LfnOfs[s], wc);		
		if (wc == 0) wc = 0xFFFF;		
	} while (++s < 13);
	if (wc == 0xFFFF || !lfn[i]) ord |= LLEF;	
	dir[LDIR_Ord] = ord;			
}
static void put_lfn ( const WCHAR * lfn , BYTE * dir , BYTE ord , BYTE sum ) { UINT i , s ; WCHAR wc ; dir [ LDIR_Chksum ] = sum ; dir [ LDIR_Attr ] = AM_LFN ; dir [ LDIR_Type ] = 0 ; st_word ( dir + LDIR_FstClusLO , 0 ) ; i = ( ord - 1 ) * 13 ; s = wc = 0 ; do { if ( wc != 0xFFFF ) wc = lfn [ i ++ ] ; st_word ( dir + LfnOfs [ s ] , wc ) ; if ( wc == 0 ) wc = 0xFFFF ; } while ( ++ s < 13 ) ; if ( wc == 0xFFFF || ! lfn [ i ] ) ord |= LLEF ; dir [ LDIR_Ord ] = ord ; }
FAT-LFN: Create an entry of LFN entries
FAT - LFN : Create an entry of LFN entries
/* Pointer to the LFN */ /* Pointer to the LFN entry to be created */ /* LFN order (1-20) */ /* Checksum of the corresponding SFN */ /* Set checksum */ /* Set attribute. LFN entry */ /* Get offset in the LFN working buffer */ /* Get an effective character */ /* Put it */ /* Padding characters for left locations */ /* Last LFN part is the start of LFN sequence */ /* Set the LFN order */