keil_examples/USBHostLite/UsbHost/Fat/usbhost_fat.c
/*
**************************************************************************************************************
*                                       CHECK TYPE OF THE ENTRY
*
* Description: This function checks the type of file entry.
*
* Arguments  : ent           Pointer to the buffer containing the entry
*
* Returns    : LAST_ENTRY    if the entry is last entry
*              FREE_ENTRY    if the entry is free entry
*              LFN_ENTRY     if the entry is long file name entry
*              SFN_ENTRY     if the entry is short file name entry
*
**************************************************************************************************************
*/
CHECK TYPE OF THE ENTRY
Description: This function checks the type of file entry.

Arguments  : ent           Pointer to the buffer containing the entry

Returns    : LAST_ENTRY    if the entry is last entry
FREE_ENTRY    if the entry is free entry
LFN_ENTRY     if the entry is long file name entry
SFN_ENTRY     if the entry is short file name entry
CHECK TYPE OF THE ENTRY Description : This function checks the type of file entry . Arguments : ent Pointer to the buffer containing the entry Returns : LAST_ENTRY if the entry is last entry FREE_ENTRY if the entry is free entry LFN_ENTRY if the entry is long file name entry SFN_ENTRY if the entry is short file name entry
uint32_t  FAT_ChkEntType (volatile  uint8_t  *ent)
{
    if (ent[0] == 0x00) {                              
        return (LAST_ENTRY);
    }
    if (ent[0] == 0xE5) {                              
        return (FREE_ENTRY);
    }
    if (0x0F == ent[11]) {                             
        return (LFN_ENTRY);
    } else {
        return (SFN_ENTRY);                            
    }
}
uint32_t FAT_ChkEntType ( volatile uint8_t * ent ) { if ( ent [ 0 ] == 0x00 ) { return ( LAST_ENTRY ) ; } if ( ent [ 0 ] == 0xE5 ) { return ( FREE_ENTRY ) ; } if ( 0x0F == ent [ 11 ] ) { return ( LFN_ENTRY ) ; } else { return ( SFN_ENTRY ) ; } }
CHECK TYPE OF THE ENTRY
Description: This function checks the type of file entry.
CHECK TYPE OF THE ENTRY Description : This function checks the type of file entry .
/* First byte is 0 means it is the last entry        */ /* First byte is 0xE5 means it is the free entry     */ /* If 11th byte of an entry is 0x0F, it is LFN       */ /* Else it is the SFN                                */