Skip to content

Commit ec02cd6

Browse files
committed
merging in v1.02 release.
* 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.
1 parent 77d701e commit ec02cd6

File tree

5 files changed

+11
-6
lines changed

5 files changed

+11
-6
lines changed

doc/help_mla_fileio.jar

4.56 KB
Binary file not shown.

doc/help_mla_fileio.pdf

4.22 KB
Binary file not shown.

drivers/internal_flash/internal_flash.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ please contact mla_licensing@microchip.com
2222
#include "string.h"
2323
#include <fileio_config.h>
2424
#include <fileio.h>
25-
#include <driver/fileio/internal_flash.h>
25+
#include <internal_flash.h>
2626

2727
#include <stdint.h>
2828
#include <stdbool.h>

drivers/sd_spi/sd_spi.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ please contact mla_licensing@microchip.com
2424
#include "fileio.h"
2525
#include "../src/fileio_private.h"
2626
#include "system.h"
27-
#include "driver/fileio/sd_spi.h"
28-
#include "driver/fileio/src/sd_spi_private.h"
29-
#include "driver/spi/drv_spi.h"
27+
#include "sd_spi.h"
28+
#include "sd_spi_private.h"
29+
3030
#include <string.h>
3131
#include <stdint.h>
3232
#include <stdbool.h>
@@ -129,7 +129,7 @@ static inline __attribute__((always_inline)) unsigned char SPICalculateBRG(unsig
129129

130130
bool FILEIO_SD_MediaDetect (FILEIO_SD_DRIVE_CONFIG * config)
131131
{
132-
#ifndef MEDIA_SOFT_DETECT
132+
#ifndef FILEIO_SD_CONFIG_MEDIA_SOFT_DETECT
133133
return (*config->cdFunc)();
134134
#else
135135
FILEIO_SD_RESPONSE response;
@@ -162,7 +162,7 @@ bool FILEIO_SD_MediaDetect (FILEIO_SD_DRIVE_CONFIG * config)
162162
//minimizing risk of SPI clock pulse master/slave synchronization problems,
163163
//due to possible application noise on the SCK line.
164164
(*config->csFunc)(1); //De-select card
165-
FILEIO_SD_SendCmdSlow(config, 0xFF, 0); //Send some "extraneous" clock pulses. If a previous
165+
FILEIO_SD_SPI_Put_Slow(config->index, 0xFF); //Send some "extraneous" clock pulses. If a previous
166166
//command was terminated before it completed normally,
167167
//the card might not have received the required clocking
168168
//following the transfer.

drivers/sd_spi/sd_spi_config_template.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,9 @@ please contact mla_licensing@microchip.com
5757
#define FILEIO_SD_SPI_Get_Slow DRV_SPI_Get
5858
#endif
5959

60+
// Define FILEIO_SD_CONFIG_MEDIA_SOFT_DETECT to enable soft detect of an SD card.
61+
// Some connectors do not have a card detect pin and must use software to detect
62+
// the presence of a card.
63+
#define FILEIO_SD_CONFIG_MEDIA_SOFT_DETECT
64+
6065

0 commit comments

Comments
 (0)