Selaa lähdekoodia

Merge pull request #17 from tsandmann/bugfixes/dma_alignment

check alignment for DMA buffers
main
Paul Stoffregen 6 vuotta sitten
vanhempi
commit
0fe064fab9
No account linked to committer's email address
1 muutettua tiedostoa jossa 8 lisäystä ja 0 poistoa
  1. +8
    -0
      utility/NXP_SDHC.cpp

+ 8
- 0
utility/NXP_SDHC.cpp Näytä tiedosto

{ {
int result=0; int result=0;
uint32_t* pData = (uint32_t*)buff; uint32_t* pData = (uint32_t*)buff;
/* check alignment for DMA */
if (reinterpret_cast<uintptr_t>(static_cast<const void*>(buff)) % 4) {
return -1;
}
// Serial.print("Sector: "); Serial.println(sector); Serial.flush(); // Serial.print("Sector: "); Serial.println(sector); Serial.flush();
// Check if this is ready // Check if this is ready
if (sdCardDesc.status != 0) return SDHC_RESULT_NOT_READY; if (sdCardDesc.status != 0) return SDHC_RESULT_NOT_READY;
{ {
int result=0; int result=0;
const uint32_t *pData = (const uint32_t *)buff; const uint32_t *pData = (const uint32_t *)buff;
/* check alignment for DMA */
if (reinterpret_cast<uintptr_t>(static_cast<const void*>(buff)) % 4) {
return -1;
}


// Check if this is ready // Check if this is ready
if (sdCardDesc.status != 0) return SDHC_RESULT_NOT_READY; if (sdCardDesc.status != 0) return SDHC_RESULT_NOT_READY;

Loading…
Peruuta
Tallenna