/*********************************************************************
*
*       FS_X_AddDevices
*
*  Function description
*    This function is called by the FS during FS_Init().
*    It is supposed to add all devices, using primarily FS_AddDevice().
*
*  Note
*    (1) Other API functions
*        Other API functions may NOT be called, since this function is called
*        during initialization. The devices are not yet ready at this point.
*/
void FS_X_AddDevices(void)
{
    #if(CY_PSOC5)
        FS_AssignMemory(&_aMemBlock[0u], sizeof(_aMemBlock));
    #else
        FS_AssignMemory(&_aMemBlock[1u], sizeof(_aMemBlock));
    #endif/* (CY_PSOC5) */

    #if (emFile_1_NUMBER_SD_CARDS == 4u)
        FS_AddDevice(&FS_MMC_SPI_Driver);
        FS_AddDevice(&FS_MMC_SPI_Driver);
        FS_AddDevice(&FS_MMC_SPI_Driver);
        FS_AddDevice(&FS_MMC_SPI_Driver);
    #elif (emFile_1_NUMBER_SD_CARDS == 3u)
        FS_AddDevice(&FS_MMC_SPI_Driver);
        FS_AddDevice(&FS_MMC_SPI_Driver);
        FS_AddDevice(&FS_MMC_SPI_Driver);
    #elif (emFile_1_NUMBER_SD_CARDS == 2u)
        FS_AddDevice(&FS_MMC_SPI_Driver);
        FS_AddDevice(&FS_MMC_SPI_Driver);
    #else
        FS_AddDevice(&FS_MMC_SPI_Driver);
    #endif /* (emFile_1_NUMBER_SD_CARDS == 4u) */
}
示例#2
0
/*********************************************************************
*
*       FS_X_AddDevices
*
*  Function description
*    This function is called by the FS during FS_Init().
*    It is supposed to add all devices, using primarily FS_AddDevice().
*
*  Note
*    (1) Other API functions
*        Other API functions may NOT be called, since this function is called
*        during initialization. The devices are not yet ready at this point.
*/
void FS_X_AddDevices(void) {
  void  * pRamDisk;

  FS_AssignMemory(&_aMemBlock[0], sizeof(_aMemBlock));
  //
  // Allocate memory for the RAM disk
  //
  pRamDisk = FS_Alloc(RAMDISK_NUM_SECTORS * RAMDISK_BYTES_PER_SECTOR);
  //
  // Add driver
  //
  FS_AddDevice(&FS_RAMDISK_Driver);
  //
  // Configure driver
  //
  FS_RAMDISK_Configure(0, pRamDisk, RAMDISK_BYTES_PER_SECTOR, RAMDISK_NUM_SECTORS);
}