Rev 364 | Rev 366 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 364 | Rev 365 | ||
---|---|---|---|
Line 256... | Line 256... | ||
256 | u8 rsp; |
256 | u8 rsp; |
257 | u16 a, crc16; |
257 | u16 a, crc16; |
258 | u32 timeout; |
258 | u32 timeout; |
259 | SD_Result_t result = SD_ERROR_UNKNOWN; |
259 | SD_Result_t result = SD_ERROR_UNKNOWN; |
Line -... | Line 260... | ||
- | 260 | ||
- | 261 | if(SDCardInfo.Valid == 1) |
|
260 | 262 | { |
|
261 | // send the command |
263 | // send the command |
262 | rsp = SDC_SendCMDR1(CmdNo, addr); |
264 | rsp = SDC_SendCMDR1(CmdNo, addr); |
263 | if (rsp != R1_NO_ERR) |
265 | if (rsp != R1_NO_ERR) |
264 | { |
266 | { |
Line 285... | Line 287... | ||
285 | crc16 = SSC_GetChar(); // highbyte first |
287 | crc16 = SSC_GetChar(); // highbyte first |
286 | crc16 = (crc16<<8)|SSC_GetChar(); // lowbyte last |
288 | crc16 = (crc16<<8)|SSC_GetChar(); // lowbyte last |
287 | /* if(crc16 != CRC16(Buffer, len)) result = SD_ERROR_CRC_DATA; |
289 | /* if(crc16 != CRC16(Buffer, len)) result = SD_ERROR_CRC_DATA; |
288 | else */ |
290 | else */ |
289 | result = SD_SUCCESS; |
291 | result = SD_SUCCESS; |
290 | 292 | } |
|
291 | end: |
293 | end: |
292 | if(result != SD_SUCCESS) |
294 | if(result != SD_SUCCESS) |
293 | { |
295 | { |
294 | sprintf(text,"Error %02X reading data from sd card (R1=%02X).\r\n", result, rsp); |
296 | sprintf(text,"Error %02X reading data from sd card (R1=%02X).\r\n", result, rsp); |
295 | UART1_PutString(text); |
297 | UART1_PutString(text); |