unsigned char CH376ReadBlock( unsigned char * buf )
{
unsigned char s, l;
xWriteCH376Cmd( CMD01_RD_USB_DATA0 );//0x27
s = l = xReadCH376Data( ); /* 后续数据长度 */
if ( l )
{
do
{
*buf = xReadCH376Data( );
buf ++;
} while ( -- l );
}
xEndCH376Cmd( );
return( s );
}
CH376ReadBlock(GlobalBuf);/* 从内存缓冲区读取FAT_DIR_INFO数据块,返回长度总是sizeof(FAT_DIR_INFO) */
CH376EndDirInfo( ); /* 获取完FAT_DIR_INFO结构 */
if ( ( GlobalBuf[11] & ATTR_LONG_NAME_MASK ) != ATTR_LONG_NAME || GlobalBuf[13] != GlobalBuf[32] ) /* 类型错误或者校验和错误 */
{
s = ERR_LONG_NAME_ERR;
//break; /* 没有直接返回是因为如果是打开了根目录那么必须要关闭后才能返回 */
}
PIC24EP256GU814 十六位单片机SPI方式调用CH376ReadBlock(GlobalBuf) 返回GlobalBuf[11] = 0x35,GlobalBuf[13] = 0x00,GlobalBuf[32] = 0x2c,类型错误或者校验和错误