Explorar el Código

TeensySdioDemo - print SD clk

main
Bill Greiman hace 8 años
padre
commit
7aa42c303a
Se han modificado 3 ficheros con 10 adiciones y 2 borrados
  1. +3
    -1
      SdFat/examples/TeensySdioDemo/TeensySdioDemo.ino
  2. +2
    -0
      SdFat/src/SdCard/SdioCard.h
  3. +5
    -1
      SdFat/src/SdCard/SdioTeensy.cpp

+ 3
- 1
SdFat/examples/TeensySdioDemo/TeensySdioDemo.ino Ver fichero

@@ -102,7 +102,9 @@ void setup() {
Serial.print("yieldCalls ");
Serial.println(yieldCalls);
Serial.print("yieldMaxUsec ");
Serial.println(yieldMaxUsec);
Serial.println(yieldMaxUsec);
Serial.print("kHzSdClk ");
Serial.println(sd.card()->kHzSdClk());
Serial.println("Done");
}


+ 2
- 0
SdFat/src/SdCard/SdioCard.h Ver fichero

@@ -62,6 +62,8 @@ class SdioCard : public BaseBlockDriver {
uint32_t errorData();
/** \return error line for last error. Tmp function for debug. */
uint32_t errorLine();
/** \return the SD clock frequency in kHz. */
uint32_t kHzSdClk();
/**
* Read a 512 byte block from an SD card.
*

+ 5
- 1
SdFat/src/SdCard/SdioTeensy.cpp Ver fichero

@@ -274,7 +274,7 @@ static void setSdclk(uint32_t kHzMax) {
while ((F_CPU/(sdclkfs*dvs) > maxSdclk) && (dvs < DVS_LIMIT)) {
dvs++;
}
m_sdClkKhz = F_CPU/(sdclkfs*dvs);
m_sdClkKhz = F_CPU/(1000*sdclkfs*dvs);
sdclkfs >>= 1;
dvs--;

@@ -471,6 +471,10 @@ uint32_t SdioCard::errorLine() {
return m_errorLine;
}
//-----------------------------------------------------------------------------
uint32_t SdioCard::kHzSdClk() {
return m_sdClkKhz;
}
//-----------------------------------------------------------------------------
bool SdioCard::readBlock(uint32_t lba, uint8_t* buf) {
uint8_t aligned[512];


Cargando…
Cancelar
Guardar