mirror of https://github.com/marqs85/ossc.git
ulibSD/sd_io.c: Fix line endings to be consistently CRLF.
This commit is contained in:
parent
598705c7fa
commit
af1f8a20d4
|
@ -32,7 +32,7 @@ DWORD __SD_Sectors (SD_DEV *dev)
|
||||||
return (((DWORD)(ftell(dev->fp)))/((DWORD)512)-1);
|
return (((DWORD)(ftell(dev->fp)))/((DWORD)512)-1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else // For use with uControllers
|
#else // For use with uControllers
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
Private Methods Prototypes - Direct work with SD card
|
Private Methods Prototypes - Direct work with SD card
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
@ -201,7 +201,7 @@ DWORD __SD_Sectors (SD_DEV *dev)
|
||||||
BYTE READ_BL_LEN = 0;
|
BYTE READ_BL_LEN = 0;
|
||||||
int timer_set;
|
int timer_set;
|
||||||
|
|
||||||
if(__SD_Send_Cmd(CMD9, 0)==0)
|
if(__SD_Send_Cmd(CMD9, 0)==0)
|
||||||
{
|
{
|
||||||
// Wait for response
|
// Wait for response
|
||||||
timer_set = SPI_Timer_On(5); // Wait for data packet (timeout of 5ms)
|
timer_set = SPI_Timer_On(5); // Wait for data packet (timeout of 5ms)
|
||||||
|
@ -262,7 +262,7 @@ DWORD __SD_Sectors (SD_DEV *dev)
|
||||||
SDRESULTS SD_Init(SD_DEV *dev)
|
SDRESULTS SD_Init(SD_DEV *dev)
|
||||||
{
|
{
|
||||||
BYTE initdata[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
|
BYTE initdata[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
|
||||||
#if defined(_M_IX86) // x86
|
#if defined(_M_IX86) // x86
|
||||||
dev->fp = fopen(dev->fn, "r+");
|
dev->fp = fopen(dev->fn, "r+");
|
||||||
if (dev->fp == NULL)
|
if (dev->fp == NULL)
|
||||||
return (SD_ERROR);
|
return (SD_ERROR);
|
||||||
|
@ -400,7 +400,7 @@ SDRESULTS SD_Read(SD_DEV *dev, void *dat, DWORD sector, WORD ofs, WORD cnt)
|
||||||
} while((tkn==0xFF)&&(SPI_Timer_Status()==TRUE));
|
} while((tkn==0xFF)&&(SPI_Timer_Status()==TRUE));
|
||||||
SPI_Timer_Off();
|
SPI_Timer_Off();
|
||||||
// Token of single block?
|
// Token of single block?
|
||||||
if(tkn==0xFE) {
|
if(tkn==0xFE) {
|
||||||
// Size block (512 bytes) + CRC (2 bytes) - offset - bytes to count
|
// Size block (512 bytes) + CRC (2 bytes) - offset - bytes to count
|
||||||
remaining = SD_BLK_SIZE + 2 - ofs - cnt;
|
remaining = SD_BLK_SIZE + 2 - ofs - cnt;
|
||||||
// Skip offset
|
// Skip offset
|
||||||
|
|
Loading…
Reference in New Issue