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

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

Returns    : None
GET EXTENSION OF A FILE Description : This function reads the extension of a file Arguments : ent_buf buffer which contains the 32 byte entry of a file ext_ptr buffer to store the extension of a file Returns : None
void  FAT_GetSfnExt (volatile  uint8_t  *entry,
                               uint8_t  *ext_ptr)
{
    uint32_t  cnt;
    cnt = 0;
    while (cnt < 8) {                  
        entry++;
        cnt++;
    }
    cnt = 0;
    while (cnt < 3) {                  
        *ext_ptr = *entry;
        ext_ptr++;
        entry++;
        cnt++;
    }
    *ext_ptr = 0;
    ext_ptr--;
    while (*ext_ptr == ' ') {          
        *ext_ptr = 0;
        ext_ptr--;
    }
}
void FAT_GetSfnExt ( volatile uint8_t * entry , uint8_t * ext_ptr ) { uint32_t cnt ; cnt = 0 ; while ( cnt < 8 ) { entry ++ ; cnt ++ ; } cnt = 0 ; while ( cnt < 3 ) { * ext_ptr = * entry ; ext_ptr ++ ; entry ++ ; cnt ++ ; } * ext_ptr = 0 ; ext_ptr -- ; while ( * ext_ptr == ' ' ) { * ext_ptr = 0 ; ext_ptr -- ; } }
GET EXTENSION OF A FILE
Description: This function reads the extension of a file
GET EXTENSION OF A FILE Description : This function reads the extension of a file
/* Goto the beginning of the file extension                          */ /* Get 3 charecters from there                                       */ /* If any spaces exist after the file extension, replace them with 0 */