DSTATUS disk_initialize ( BYTE pdrv /* Physical drive nmuber to identify the drive */ ) { DSTATUS stat; int result; switch (pdrv) { case ATA : result = ATA_disk_initialize(); // translate the reslut code here return stat; case MMC : result = MMC_disk_initialize(); // translate the reslut code here return stat; case USB : result = USB_disk_initialize(); // translate the reslut code here return stat; } return STA_NOINIT; }
DSTATUS disk_initialize ( BYTE pdrv /* Physical drive nmuber (0..) */ ) { #ifndef CONFIG_ALLWINNER DSTATUS stat; int result; switch (pdrv) { case ATA : result = ATA_disk_initialize(); // translate the reslut code here return stat; case MMC : result = MMC_disk_initialize(); // translate the reslut code here return stat; case USB : result = USB_disk_initialize(); // translate the reslut code here return stat; } return STA_NOINIT; #else return 0; #endif }
DSTATUS disk_initialize ( BYTE drv /* Physical drive nmuber (0..) */ ) { DSTATUS stat = STA_NOINIT; int result; PRINT_Log("disk_initialize for disk %x \n\r",drv); switch (drv) { case ATA : //result = ATA_disk_initialize(); // translate the reslut code here return stat; case MMC : result = MMC_disk_initialize(0); // translate the reslut code here stat = RES_OK ; driveAttached = TRUE ; return stat; case USB : result = USB_disk_initialize(); // translate the reslut code here stat = RES_OK ; driveAttached = TRUE ; return stat; } PRINT_Log("disk_initialize return problem"); return STA_NOINIT; }
DSTATUS disk_initialize ( BYTE drv /* Physical drive nmuber (0..) */ ) { if (drv == RAM) return RAM_disk_initialize(); if (drv == MMC) return MMC_disk_initialize(); return STA_NOINIT; }
DSTATUS disk_initialize( BYTE pu /* Physical drive nmuber (0..) */ ) { int result; result = MMC_disk_initialize(); // sprintf(error_string, "\r\n disk_initialize error %i ", result); // if (result) SpiStringWrite(error_string); // translate the result code here return result; }
DSTATUS disk_initialize ( BYTE drv /* Physical drive nmuber (0..) */ ) { DSTATUS stat = 0; int result; result = MMC_disk_initialize(); // translate the reslut code here stat &= ~STA_NOINIT; // clear NOINIT bit return stat; }
static int mount_card() { DIR dir; XCHAR root[32]; sd_set_mode(SD_SLOW); sd_set_type(SD_NORMAL); f_mount(1, NULL); sd_set_type(SD_NORMAL); if(MMC_disk_initialize() == STA_NODISK) { sd_set_type(SD_NORMAL); f_mount(1, NULL); sd_set_type(SD_NORMAL); if(MMC_disk_initialize() == STA_NODISK) { return 0; } } sd_set_mode(SD_SLOW); if(f_mount(1,&fat_filesys)) return 0; f_chdrive(1); c2wstrcpy(root,"/"); sd_set_mode(SD_SLOW); if(f_opendir(&dir,root)) { sd_set_type(SD_FUNKY); if (MMC_disk_initialize() == STA_NODISK) return 0; } set_sdc_speed(); return 1; }
DSTATUS disk_initialize ( BYTE drv /* Physical drive nmuber (0..) */ ) { DSTATUS stat; unsigned char result; switch (drv) { #ifdef PAKAI_ATA case ATA : result = ATA_disk_initialize(); // translate the reslut code here return stat; #endif #ifdef PAKAI_MMC case MMC : result = MMC_disk_initialize(); // translate the reslut code here return stat; #endif #ifdef PAKAI_USB_STORAGE case USB : result = USB_disk_initialize(); // translate the reslut code here return stat; #endif case SDC : result = init_sdc(); // translate the reslut code here return stat; case ROM : return stat; } return STA_NOINIT; }
DSTATUS disk_initialize(BYTE drv /* Physical drive nmuber (0..) */ ) { DSTATUS stat; int result; (void) result; switch (drv) { case ATA: // result = ATA_disk_initialize(); stat = STA_NOINIT; // translate the result code here return stat; case MMC: stat = MMC_disk_initialize(); return stat; case USB: #if WITH_USB_MS /* USB host init and enumeration */ if ( usb_status & STA_NOINIT ) { Host_Init(); if ( Host_EnumDev() == OK ) { /* mass-storage init */ if ( MS_Init(&blkSize, &numBlks, inquiryResult) == OK ) { usb_status &= ~STA_NOINIT; } else { /* MS init fail */ } } else { /* host init and/or enum fail */ } } return usb_status; #else stat = STA_NOINIT; return stat; #endif } return STA_NOINIT; }
DSTATUS disk_initialize ( BYTE pdrv /* Physical drive nmuber to identify the drive(设备号) */ ) { DSTATUS stat = 0; int result; #if 0 switch (pdrv) { case ATA : result = ATA_disk_initialize(); // translate the reslut code here return stat; case MMC : result = MMC_disk_initialize(); // translate the reslut code here return stat; case USB : result = USB_disk_initialize(); // translate the reslut code here return stat; } #else result = (g_tFatDrvs[pdrv].DrvInitialize)(); if(0 == result) return stat; // 成功 #endif return STA_NOINIT; }