(2)usb_prop.c文件修改
原文件
修改后文件
(3)memory.h文件修改
(4)mass_mal.h文件修改
(5)memory.c文件修改
(6)usb_bot.c文件修改
(7)mass_mal.c文件重寫
#include "platform_config.h"
#include "mass_mal.h"
#include "w25q128.h"
long long Mass_Memory_Size[ MAX_LUN+1 ] ;
u32 Mass_Block_Size[ MAX_LUN+1 ] ;
u32 Mass_Block_Count[ MAX_LUN+1 ] ;
uint16_t MAL_Init( uint8_t lun )
{
u16 Status=MAL_OK ;
switch( lun )
{
case 0: break;
case 1: break;
default:return MAL_FAIL ;
}
return Status ;
}
uint16_t MAL_Write(uint8_t lun, uint64_t Memory_Offset, uint32_t *Writebuff, uint16_t Transfer_Length)
{
u8 STA ;
switch( lun )
{
//磁盤0為 SPI FLASH盤
case 0:
STA = 0 ;
W25QXX_Write( ( u8* )Writebuff, Memory_Offset, Transfer_Length ) ;
break ;
//磁盤1為SD卡
case 1:
STA = SD_WriteDisk( ( u8* )Writebuff, Memory_Offset>>9, Transfer_Length>>9 ) ;
break ;
default:
return MAL_FAIL ;
}
if( STA!=0 )
return MAL_FAIL ;
return MAL_OK ;
}
uint16_t MAL_Read( uint8_t lun, uint64_t Memory_Offset, uint32_t *Readbuff, uint16_t Transfer_Length )
{
u8 STA ;
switch( lun )
{
//磁盤0為 SPI FLASH盤
case 0 :
STA = 0 ;
W25QXX_Read( ( u8* )Readbuff, Memory_Offset, Transfer_Length ) ;
break;
//磁盤1為SD卡
case 1 :
STA = SD_ReadDisk( ( u8* )Readbuff, Memory_Offset>>9, Transfer_Length>>9 ) ;
break;
default:return MAL_FAIL ;
}
if( STA!=0 )
return MAL_FAIL ;
return MAL_OK ;
}
uint16_t MAL_GetStatus( uint8_t lun )
{
switch( lun )
{
case 0:return MAL_OK;
case 1:return MAL_OK;
default:return MAL_FAIL;
}
}
-
usb
+關(guān)注
關(guān)注
60文章
7900瀏覽量
264014 -
PC
+關(guān)注
關(guān)注
9文章
2066瀏覽量
154033 -
總線
+關(guān)注
關(guān)注
10文章
2868瀏覽量
87994
發(fā)布評論請先 登錄
相關(guān)推薦
評論