Serial.print("yieldCalls "); | Serial.print("yieldCalls "); | ||||
Serial.println(yieldCalls); | Serial.println(yieldCalls); | ||||
Serial.print("yieldMaxUsec "); | Serial.print("yieldMaxUsec "); | ||||
Serial.println(yieldMaxUsec); | |||||
Serial.println(yieldMaxUsec); | |||||
Serial.print("kHzSdClk "); | |||||
Serial.println(sd.card()->kHzSdClk()); | |||||
Serial.println("Done"); | Serial.println("Done"); | ||||
} | } | ||||
uint32_t errorData(); | uint32_t errorData(); | ||||
/** \return error line for last error. Tmp function for debug. */ | /** \return error line for last error. Tmp function for debug. */ | ||||
uint32_t errorLine(); | uint32_t errorLine(); | ||||
/** \return the SD clock frequency in kHz. */ | |||||
uint32_t kHzSdClk(); | |||||
/** | /** | ||||
* Read a 512 byte block from an SD card. | * Read a 512 byte block from an SD card. | ||||
* | * |
while ((F_CPU/(sdclkfs*dvs) > maxSdclk) && (dvs < DVS_LIMIT)) { | while ((F_CPU/(sdclkfs*dvs) > maxSdclk) && (dvs < DVS_LIMIT)) { | ||||
dvs++; | dvs++; | ||||
} | } | ||||
m_sdClkKhz = F_CPU/(sdclkfs*dvs); | |||||
m_sdClkKhz = F_CPU/(1000*sdclkfs*dvs); | |||||
sdclkfs >>= 1; | sdclkfs >>= 1; | ||||
dvs--; | dvs--; | ||||
return m_errorLine; | return m_errorLine; | ||||
} | } | ||||
//----------------------------------------------------------------------------- | //----------------------------------------------------------------------------- | ||||
uint32_t SdioCard::kHzSdClk() { | |||||
return m_sdClkKhz; | |||||
} | |||||
//----------------------------------------------------------------------------- | |||||
bool SdioCard::readBlock(uint32_t lba, uint8_t* buf) { | bool SdioCard::readBlock(uint32_t lba, uint8_t* buf) { | ||||
uint8_t aligned[512]; | uint8_t aligned[512]; | ||||