keil_examples/USBHostLite/UsbHost/Fat/usbhost_fat.c
/*
**************************************************************************************************************
*                                       GET SHORT FILE NAME AND EXTENSION OF A FILE
*
* Description: This function reads the short file name and extension corresponding to a file
*
* Arguments  : ent_buf    buffer which contains the 32 byte entry of a file
*              name       buffer to store the file name and extension of a file
*
* Returns    : None
*
**************************************************************************************************************
*/


Arguments  : ent_buf    buffer which contains the 32 byte entry of a file
name       buffer to store the file name and extension of a file

Returns    : None
Arguments : ent_buf buffer which contains the 32 byte entry of a file name buffer to store the file name and extension of a file Returns : None
void  FAT_GetSFN (volatile  uint8_t  *entry,
                            uint8_t  *name)
{
    uint8_t   ext[4];                          
    uint8_t  *ext_ptr;
    ext_ptr = ext;
    FAT_GetSfnName(entry, name);                  
    FAT_GetSfnExt(entry, ext_ptr);                
    while (*name) {                               
        name++;
    }
    if (*ext_ptr) {                               
        *name = '.';
        name++;
    }
    while (*ext_ptr) {                            
        *name = *ext_ptr;
        name++;
        ext_ptr++;
    }
    *name = '\0';
}
void FAT_GetSFN ( volatile uint8_t * entry , uint8_t * name ) { uint8_t ext [ 4 ] ; uint8_t * ext_ptr ; ext_ptr = ext ; FAT_GetSfnName ( entry , name ) ; FAT_GetSfnExt ( entry , ext_ptr ) ; while ( * name ) { name ++ ; } if ( * ext_ptr ) { * name = ' ' ; name ++ ; } while ( * ext_ptr ) { * name = * ext_ptr ; name ++ ; ext_ptr ++ ; } * name = ' \0 ' ; }
GET SHORT FILE NAME AND EXTENSION OF A FILE
Description: This function reads the short file name and extension corresponding to a file
GET SHORT FILE NAME AND EXTENSION OF A FILE Description : This function reads the short file name and extension corresponding to a file
/* Buffer to store the extension of a file                */ /* Get file name into "name" buffer                       */ /* Get extension into "ext" buffer                        */ /* Goto the end of the filename                           */ /* If the extension exists, put a '.' charecter           */ /* Append the extension to the file name                  */