Skip to content

Commit

Permalink
h7: drop SDCARD_SDIO_DMA as IDMA is used
Browse files Browse the repository at this point in the history
  • Loading branch information
bkleiner committed Nov 6, 2021
1 parent 9965eb8 commit b4ba470
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
11 changes: 9 additions & 2 deletions src/main/drivers/sdcard/sdcard_sdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,11 +241,12 @@ static sdcardOperationStatus_e sdcard_endWriteBlocks(void)
*/
static bool sdcardSdio_poll(void)
{
#if !defined(STM32H7) // H7 uses IDMA
if (!sdcard.dma) {
sdcard.state = SDCARD_STATE_NOT_PRESENT;
return false;
}

#endif
doMore:
switch (sdcard.state) {
case SDCARD_STATE_RESET:
Expand Down Expand Up @@ -545,6 +546,7 @@ static bool sdcardSdio_readBlock(uint32_t blockIndex, uint8_t *buffer, sdcard_op
*/
void sdcardSdio_init(void)
{
#if !defined(STM32H7) // H7 uses IDMA
sdcard.dma = dmaGetByTag(SDCARD_SDIO_DMA);

if (!sdcard.dma) {
Expand All @@ -564,7 +566,12 @@ void sdcardSdio_init(void)
sdcard.state = SDCARD_STATE_NOT_PRESENT;
return;
}

#else
if (!SD_Initialize_LL(0)) {
sdcard.state = SDCARD_STATE_NOT_PRESENT;
return;
}
#endif
// We don't support hot insertion
if (!sdcard_isInserted()) {
sdcard.state = SDCARD_STATE_NOT_PRESENT;
Expand Down
3 changes: 0 additions & 3 deletions src/main/target/MATEKH743/target.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,6 @@
#define SDCARD_SDIO_DEVICE SDIODEV_1
#define SDCARD_SDIO_4BIT



#define SDCARD_SDIO_DMA DMA_TAG(2,3,4)
#define ENABLE_BLACKBOX_LOGGING_ON_SDCARD_BY_DEFAULT

// *************** ADC *****************************
Expand Down

0 comments on commit b4ba470

Please sign in to comment.