Compilation fix. Massstorage won't use disk cache anymore

This commit is contained in:
Bertrand Songis
2016-07-31 08:10:46 +02:00
parent 67ebadc9e0
commit 4b2315f56b
9 changed files with 60 additions and 66 deletions
+25 -16
View File
@@ -100,24 +100,33 @@ void delay_ms(uint32_t ms);
void getCPUUniqueID(char * s);
// SD driver
#define BLOCK_SIZE 512 /* Block Size in Bytes */
#if !defined(SIMU) || defined(SIMU_DISKIO)
uint32_t sdIsHC(void);
uint32_t sdGetSpeed(void);
#define SD_IS_HC() (sdIsHC())
#define SD_GET_SPEED() (sdGetSpeed())
#define SD_GET_FREE_BLOCKNR() (sdGetFreeSectors())
#define SD_CARD_PRESENT() (~SD_PRESENT_GPIO->IDR & SD_PRESENT_GPIO_PIN)
void sdInit(void);
void sdDone(void);
#define sdPoll10ms()
#define sdMountPoll()
uint32_t sdMounted(void);
uint32_t sdIsHC(void);
uint32_t sdGetSpeed(void);
#define SD_IS_HC() (sdIsHC())
#define SD_GET_SPEED() (sdGetSpeed())
#define SD_GET_FREE_BLOCKNR() (sdGetFreeSectors())
#define SD_CARD_PRESENT() (~SD_PRESENT_GPIO->IDR & SD_PRESENT_GPIO_PIN)
void sdInit(void);
void sdDone(void);
#define sdPoll10ms()
#define sdMountPoll()
uint32_t sdMounted(void);
#else
#define SD_IS_HC() (0)
#define SD_GET_SPEED() (0)
#define sdInit()
#define sdDone()
#define SD_CARD_PRESENT() true
#define SD_IS_HC() (0)
#define SD_GET_SPEED() (0)
#define sdInit()
#define sdDone()
#define SD_CARD_PRESENT() true
#endif
#if defined(DISK_CACHE)
#include "diskio.h"
DRESULT __disk_read(BYTE drv, BYTE * buff, DWORD sector, UINT count);
DRESULT __disk_write(BYTE drv, const BYTE * buff, DWORD sector, UINT count);
#else
#define __disk_read disk_read
#define __disk_write disk_write
#endif
// Flash Write driver
+6 -14
View File
@@ -110,15 +110,10 @@ uint32_t sdReadRetries = 0;
/*-----------------------------------------------------------------------*/
/* Read Sector(s) */
#if !defined(DISK_CACHE)
#define __disk_read disk_read
#define __disk_write disk_write
#endif
DRESULT __disk_read (
DRESULT __disk_read(
BYTE drv, /* Physical drive nmuber (0..) */
BYTE *buff, /* Data buffer to store read data */
DWORD sector, /* Sector address (LBA) */
BYTE * buff, /* Data buffer to store read data */
DWORD sector, /* Sector address (LBA) */
UINT count /* Number of sectors to read (1..255) */
)
{
@@ -194,10 +189,10 @@ DRESULT __disk_read (
/* Write Sector(s) */
#if _READONLY == 0
DRESULT __disk_write (
DRESULT __disk_write(
BYTE drv, /* Physical drive nmuber (0..) */
const BYTE *buff, /* Data to be written */
DWORD sector, /* Sector address (LBA) */
const BYTE *buff, /* Data to be written */
DWORD sector, /* Sector address (LBA) */
UINT count /* Number of sectors to write (1..255) */
)
{
@@ -250,9 +245,6 @@ DRESULT __disk_write (
}
#endif /* _READONLY */
/*-----------------------------------------------------------------------*/
/* Miscellaneous Functions */
-2
View File
@@ -24,8 +24,6 @@
#include "board.h"
#define BLOCK_SIZE 512 /* Block Size in Bytes */
#ifdef __cplusplus
extern "C" {
#endif