keil_examples/USBHostLite/UsbHost/Fat/usbhost_fat.c
/*
**************************************************************************************************************
*                                               GET END CLUSTER
*
* Description: This function end cluster in the cluster chain of a cluster
*
* Arguments  : clus_no    Starting cluster of the cluster chain in which end cluster to be found
*
* Returns    : End cluster in the cluster chain
*
**************************************************************************************************************
*/
GET END CLUSTER
Description: This function end cluster in the cluster chain of a cluster

Arguments  : clus_no    Starting cluster of the cluster chain in which end cluster to be found

Returns    : End cluster in the cluster chain
GET END CLUSTER Description : This function end cluster in the cluster chain of a cluster Arguments : clus_no Starting cluster of the cluster chain in which end cluster to be found Returns : End cluster in the cluster chain
uint16_t  FAT_GetEndClus (uint16_t  clus_no)
{
    uint16_t  next_clus;
    next_clus = clus_no;
    while (next_clus) {
        next_clus = FAT_GetNextClus(clus_no);
        if (next_clus) {
            clus_no = next_clus;
        }
    }
    return (clus_no);
}
uint16_t FAT_GetEndClus ( uint16_t clus_no ) { uint16_t next_clus ; next_clus = clus_no ; while ( next_clus ) { next_clus = FAT_GetNextClus ( clus_no ) ; if ( next_clus ) { clus_no = next_clus ; } } return ( clus_no ) ; }
GET END CLUSTER
Description: This function end cluster in the cluster chain of a cluster
GET END CLUSTER Description : This function end cluster in the cluster chain of a cluster