refractor msc host app examples

This commit is contained in:
hathach
2013-10-01 16:11:34 +07:00
parent 640b0ec546
commit 18b3179bc6
5 changed files with 105 additions and 40 deletions

View File

@@ -84,7 +84,8 @@ DRESULT disk_ioctl (BYTE pdrv, BYTE cmd, void* buff);
static inline bool disk_is_ready(BYTE pdrv);
static inline bool disk_is_ready(BYTE pdrv)
{
return (disk_status(pdrv) & (STA_NOINIT | STA_NODISK)) == 0;
return (pdrv < TUSB_CFG_HOST_DEVICE_MAX) &&
( (disk_status(pdrv) & (STA_NOINIT | STA_NODISK)) == 0 );
}

View File

@@ -9,6 +9,7 @@
#ifndef _FFCONF
#define _FFCONF 82786 /* Revision ID */
#include "tusb_config.h"
/*---------------------------------------------------------------------------/
/ Functions and Buffer Configurations
@@ -127,7 +128,7 @@
/ Physical Drive Configurations
/----------------------------------------------------------------------------*/
#define _VOLUMES 1
#define _VOLUMES TUSB_CFG_HOST_DEVICE_MAX
/* Number of volumes (logical drives) to be used. */