Skip to content

Commit 14a53d1

Browse files
committed
Update example to work without SD detect pin
Signed-off-by: Frederic.Pillon <[email protected]>
1 parent ee8e45e commit 14a53d1

File tree

7 files changed

+42
-0
lines changed

7 files changed

+42
-0
lines changed

examples/CardInfo/CardInfo.ino

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@
1111
// include the SD library:
1212
#include <STM32SD.h>
1313

14+
// If SD card slot has no detect pin then define it as SD_DETECT_NONE
15+
// to ignore it. One other option is to call 'card.init()' without parameter.
16+
#ifndef SD_DETECT_PIN
17+
#define SD_DETECT_PIN SD_DETECT_NONE
18+
#endif
19+
1420
Sd2Card card;
1521
SdFatFs fatFs;
1622

examples/Datalogger/Datalogger.ino

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@
1212

1313
#include <STM32SD.h>
1414

15+
// If SD card slot has no detect pin then define it as SD_DETECT_NONE
16+
// to ignore it. One other option is to call 'SD.begin()' without parameter.
17+
#ifndef SD_DETECT_PIN
18+
#define SD_DETECT_PIN SD_DETECT_NONE
19+
#endif
20+
1521
uint32_t A[] = { A0, A1, A2};
1622

1723
void setup()

examples/DumpFile/DumpFile.ino

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313

1414
#include <STM32SD.h>
1515

16+
// If SD card slot has no detect pin then define it as SD_DETECT_NONE
17+
// to ignore it. One other option is to call 'SD.begin()' without parameter.
18+
#ifndef SD_DETECT_PIN
19+
#define SD_DETECT_PIN SD_DETECT_NONE
20+
#endif
21+
1622
void setup()
1723
{
1824
// Open serial communications and wait for port to open:

examples/Files/Files.ino

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@
1010
*/
1111
#include <STM32SD.h>
1212

13+
// If SD card slot has no detect pin then define it as SD_DETECT_NONE
14+
// to ignore it. One other option is to call 'SD.begin()' without parameter.
15+
#ifndef SD_DETECT_PIN
16+
#define SD_DETECT_PIN SD_DETECT_NONE
17+
#endif
18+
1319
File myFile;
1420

1521
void setup()

examples/Full/Full.ino

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
#include <STM32SD.h>
22

3+
// If SD card slot has no detect pin then define it as SD_DETECT_NONE
4+
// to ignore it. One other option is to call 'SD.begin()' without parameter.
5+
#ifndef SD_DETECT_PIN
6+
#define SD_DETECT_PIN SD_DETECT_NONE
7+
#endif
8+
39
#define COUNTOF(__BUFFER__) (sizeof(__BUFFER__) / sizeof(*(__BUFFER__)))
410
#define BUFFERSIZE (COUNTOF(wtext) -1)
511

examples/ReadWrite/ReadWrite.ino

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@
1111

1212
#include <STM32SD.h>
1313

14+
// If SD card slot has no detect pin then define it as SD_DETECT_NONE
15+
// to ignore it. One other option is to call 'SD.begin()' without parameter.
16+
#ifndef SD_DETECT_PIN
17+
#define SD_DETECT_PIN SD_DETECT_NONE
18+
#endif
19+
1420
File myFile;
1521

1622
void setup()

examples/listfiles/listfiles.ino

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@
1212
*/
1313
#include <STM32SD.h>
1414

15+
// If SD card slot has no detect pin then define it as SD_DETECT_NONE
16+
// to ignore it. One other option is to call 'SD.begin()' without parameter.
17+
#ifndef SD_DETECT_PIN
18+
#define SD_DETECT_PIN SD_DETECT_NONE
19+
#endif
20+
1521
File root;
1622

1723
void setup()

0 commit comments

Comments
 (0)