-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fixed issue with soft detect for SD card connectors that don't have card detect pin * Relocated driver files from "<mla installation folder>/framework/drivers/fileio" to "<mla installation folder>/framework/fileio/drivers". Fixed issues with that relocation.
- Loading branch information
1 parent
77d701e
commit ec02cd6
Showing
5 changed files
with
11 additions
and
6 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,7 @@ please contact [email protected] | |
#include "string.h" | ||
#include <fileio_config.h> | ||
#include <fileio.h> | ||
#include <driver/fileio/internal_flash.h> | ||
#include <internal_flash.h> | ||
|
||
#include <stdint.h> | ||
#include <stdbool.h> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,9 +24,9 @@ please contact [email protected] | |
#include "fileio.h" | ||
#include "../src/fileio_private.h" | ||
#include "system.h" | ||
#include "driver/fileio/sd_spi.h" | ||
#include "driver/fileio/src/sd_spi_private.h" | ||
#include "driver/spi/drv_spi.h" | ||
#include "sd_spi.h" | ||
#include "sd_spi_private.h" | ||
|
||
#include <string.h> | ||
#include <stdint.h> | ||
#include <stdbool.h> | ||
|
@@ -129,7 +129,7 @@ static inline __attribute__((always_inline)) unsigned char SPICalculateBRG(unsig | |
|
||
bool FILEIO_SD_MediaDetect (FILEIO_SD_DRIVE_CONFIG * config) | ||
{ | ||
#ifndef MEDIA_SOFT_DETECT | ||
#ifndef FILEIO_SD_CONFIG_MEDIA_SOFT_DETECT | ||
return (*config->cdFunc)(); | ||
#else | ||
FILEIO_SD_RESPONSE response; | ||
|
@@ -162,7 +162,7 @@ bool FILEIO_SD_MediaDetect (FILEIO_SD_DRIVE_CONFIG * config) | |
//minimizing risk of SPI clock pulse master/slave synchronization problems, | ||
//due to possible application noise on the SCK line. | ||
(*config->csFunc)(1); //De-select card | ||
FILEIO_SD_SendCmdSlow(config, 0xFF, 0); //Send some "extraneous" clock pulses. If a previous | ||
FILEIO_SD_SPI_Put_Slow(config->index, 0xFF); //Send some "extraneous" clock pulses. If a previous | ||
//command was terminated before it completed normally, | ||
//the card might not have received the required clocking | ||
//following the transfer. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,4 +57,9 @@ please contact [email protected] | |
#define FILEIO_SD_SPI_Get_Slow DRV_SPI_Get | ||
#endif | ||
|
||
// Define FILEIO_SD_CONFIG_MEDIA_SOFT_DETECT to enable soft detect of an SD card. | ||
// Some connectors do not have a card detect pin and must use software to detect | ||
// the presence of a card. | ||
#define FILEIO_SD_CONFIG_MEDIA_SOFT_DETECT | ||
|
||
|