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