/* Checks for error conditions for R3 (OCR) response.  */
static SD_Error CmdResp3Error(void)
/* Checks for error conditions for R3 (OCR) response.  */
static SD_Error CmdResp3Error(void)
{
        SD_Error errorstatus = SD_OK;
        uint32_t status;
        status = SDIO ->STA;
        while (!(status & (SDIO_FLAG_CCRCFAIL | SDIO_FLAG_CMDREND | SDIO_FLAG_CTIMEOUT))) {
                status = SDIO ->STA;
        }
        if (status & SDIO_FLAG_CTIMEOUT) {
                errorstatus = SD_CMD_RSP_TIMEOUT;
                SDIO->ICR =  (SDIO_FLAG_CTIMEOUT);
                return (errorstatus);
        }
        SDIO->ICR =  (SDIO_STATIC_FLAGS );
        return (errorstatus);
}