enhacne msc demo, update IAR project file

This commit is contained in:
hathach
2013-10-02 13:32:39 +07:00
parent 5c8389b9ae
commit 1263dbb122
10 changed files with 62 additions and 24 deletions
+13 -2
View File
@@ -48,7 +48,7 @@
// MACRO CONSTANT TYPEDEF
//--------------------------------------------------------------------+
// TODO change it to portable init
volatile DSTATUS disk_state[TUSB_CFG_HOST_DEVICE_MAX] = { [0 ... TUSB_CFG_HOST_DEVICE_MAX-1] = STA_NOINIT };
static DSTATUS disk_state[TUSB_CFG_HOST_DEVICE_MAX];
//--------------------------------------------------------------------+
// INTERNAL OBJECT & FUNCTION DECLARATION
@@ -71,12 +71,23 @@ static DRESULT wait_for_io_complete(uint8_t usb_addr)
}
void diskio_init(void)
{
memset(disk_state, STA_NOINIT, TUSB_CFG_HOST_DEVICE_MAX);
}
//pdrv Specifies the physical drive number.
DSTATUS disk_initialize ( BYTE pdrv )
{
disk_state[pdrv] &= (~STA_NOINIT); // clear NOINIT bit
return disk_state[pdrv];
}
void disk_deinitialize ( BYTE pdrv )
{
disk_state[pdrv] |= STA_NOINIT; // set NOINIT bit
}
DSTATUS disk_status (BYTE pdrv)
{
return disk_state[pdrv];
@@ -134,7 +145,7 @@ DRESULT disk_ioctl (BYTE pdrv, BYTE cmd, void* buff)
static inline uint8_t month2number(char* p_ch) ATTR_PURE ATTR_ALWAYS_INLINE;
static inline uint8_t month2number(char* p_ch)
{
uint8_t const * const month_str[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
char const * const month_str[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
for(uint8_t i=0; i<12; i++)
{
+2 -3
View File
@@ -18,8 +18,6 @@ extern "C" {
/* Status of Disk Functions */
typedef BYTE DSTATUS;
extern volatile DSTATUS disk_state[TUSB_CFG_HOST_DEVICE_MAX];
/* Results of Disk Functions */
typedef enum {
RES_OK = 0, /* 0: Successful */
@@ -74,7 +72,8 @@ typedef enum {
/*---------------------------------------*/
/* Prototypes for disk control functions */
void diskio_init(void);
void disk_deinitialize ( BYTE pdrv );
DSTATUS disk_initialize (BYTE pdrv);
DSTATUS disk_status (BYTE pdrv);
DRESULT disk_read (BYTE pdrv, BYTE*buff, DWORD sector, BYTE count);
+4 -1
View File
@@ -2762,7 +2762,10 @@ FRESULT f_chdrive (
return FR_OK;
}
BYTE f_get_current_drive(void)
{
return CurrVol;
}
FRESULT f_chdir (
const TCHAR *path /* Pointer to the directory path */
+1
View File
@@ -222,6 +222,7 @@ FRESULT f_chmod (const TCHAR* path, BYTE value, BYTE mask); /* Change attribut
FRESULT f_utime (const TCHAR* path, const FILINFO* fno); /* Change times-tamp of the file/dir */
FRESULT f_rename (const TCHAR* path_old, const TCHAR* path_new); /* Rename/Move a file or directory */
FRESULT f_chdrive (BYTE drv); /* Change current drive */
BYTE f_get_current_drive(void);
FRESULT f_chdir (const TCHAR* path); /* Change current directory */
FRESULT f_getcwd (TCHAR* buff, UINT len); /* Get current directory */
FRESULT f_getlabel (const TCHAR* path, TCHAR* label, DWORD* sn); /* Get volume label */
-4
View File
@@ -17,10 +17,6 @@ typedef int INT;
typedef unsigned int UINT;
/* These types must be 8-bit integer */
#ifndef LPC_TYPES_H // avoid typedef redefinition in lpc_types.h
typedef char CHAR;
#endif
typedef unsigned char UCHAR;
typedef unsigned char BYTE;