nhatuan84 / esp32-micro-sdcard

120 stars 46 forks source link

Redefinition of File class #2

Closed SheepKnight closed 2 years ago

SheepKnight commented 6 years ago

many libraries (like JPEG decoder, Async HTTP web server...) uses the File Class from the ESP32 default library ESP32/FS; which is declared once again in this. It makes most of them unuseable, as seen below

[...]\Arduino\libraries\esp32-micro-sdcard/mySD.h:32:7: error: redefinition of 'class fs::File'

 class File : public Stream {

       ^

In file included from [...]\Arduino\ESP32JPG\ESP32JPG.ino:17:0:
[...]\Arduino\hardware\espressif\esp32\libraries\FS\src/FS.h:47:7: error: previous definition of 'class fs::File'

 class File : public Stream

Namespaces could work but are such a pain to use on every function call.

YvedD commented 5 years ago

Same issue over here, with the same outcome of errors... Any suggestions on this issue?

Grtz, Yves

SheepKnight commented 5 years ago

I gave up on this library. The default ESP32 SD library was good enough. The main feature I used from this lib was the ability to change the SPI pins, but we can do this with the default one

nhatuan84 commented 5 years ago

Hi friend,

Sorry I have not maintained it for a long time. But the default lib is good enough. I ported this lib from adafruit. The author said that it is fast.

Br,

On Mon, Oct 15, 2018, 12:06 AM sheep_knight notifications@github.com wrote:

I gave up on this library. The default ESP32 SD library was good enough. The main feature I used from this lib was the ability to change the SPI pins, but we can do this with the default one

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/nhatuan84/esp32-micro-sdcard/issues/2#issuecomment-429643389, or mute the thread https://github.com/notifications/unsubscribe-auth/AEjfLnsaj5tPUSu_McutkhFuo-lNT49_ks5uk28GgaJpZM4VGfpQ .

SheepKnight commented 5 years ago

Oh sorry for bothering you, didn't knew it was no longer supported, thanks for tout work though

lucasroth commented 4 years ago

Hi, thanks for your work, the only lib that could change the pins easy. @SheepKnight please give me an advice on how to make it! :/ this lib saved my life in that topic can´t find a way to make it really works (default lib).

Regards, Lucas.

SheepKnight commented 4 years ago

@lucasroth I would consider switching to the default library. If pin definition is what's causing you problems, the second parameter of SD.begin is a SPI class, with pin definition.

lucasroth commented 4 years ago

@SheepKnight I see the SD default begin as follows: bool SDFS::begin(uint8_t ssPin, SPIClass &spi, uint32_t frequency, const char * mountpoint, uint8_t max_files)

How do I pass the arguments of SPI Class? don´t got it how. In my program I use both VSPI and HSPI, so was kind of hard to find how to do it as simple as: SD.begin(15, 13, 12, 14) like with this lib. Not to much documentation to make it work, thanks for help.

SheepKnight commented 4 years ago
SPIClass SPISD;
SPISD.begin(14, 2, 15, 13);//SCK MISO MOSI SS
SD.begin(13, SPISD)
thiagolte commented 2 years ago

I gave up on this library, I'm using SD.h and it is working fine.

// ### TGO LORA32 ###

include "FS.h"

include

include "SPI.h"

// SD Card

define SDCARD_CS 13

define SDCARD_MOSI 15

define SDCARD_SCK 14

define SDCARD_MISO 2

SPIClass spi = SPIClass(); spi.begin(SDCARD_SCK, SDCARD_MISO, SDCARD_MOSI, SDCARD_CS);

SD.begin(SDCARD_CS, spi, 80000000);

nhatuan84 commented 2 years ago

I gave up on this library, I'm using SD.h and it is working fine.

// ### TGO LORA32 ###

include "FS.h" #include #include "SPI.h"

// SD Card #define SDCARD_CS 13 #define SDCARD_MOSI 15 #define SDCARD_SCK 14 #define SDCARD_MISO 2

SPIClass spi = SPIClass(); spi.begin(SDCARD_SCK, SDCARD_MISO, SDCARD_MOSI, SDCARD_CS);

SD.begin(SDCARD_CS, spi, 80000000);

Sorry, I have not updated it for long time. This error can be fixed by adding the namespace before the "class File". If you can do that I will appreciate so much. Thanks.

nhatuan84 commented 2 years ago

i have fixed