Skip to content

Commit fbc67c6

Browse files
committed
Removed the SD class, I think it is out of scope for this project
1 parent a7e8517 commit fbc67c6

File tree

8 files changed

+32
-97
lines changed

8 files changed

+32
-97
lines changed

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
set(COMPONENT_SRCDIRS "src")
2+
set(COMPONENT_ADD_INCLUDEDIRS "src")
3+
4+
register_component()

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ Currently implemented:
1010
- The Wire library
1111
- The SPI library (Work in progress)
1212
- Partial WiFi library (Only WiFi class, no WiFiClient or WiFiServer)
13-
- Partial SD library (File isn't implemented, unistd functions are available)
1413
- The Stream, String, and Print classes
1514

1615
Out of scope:

src/Arduino.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,3 +151,23 @@ inline void randomSeed(long seed)
151151
{
152152
//
153153
}
154+
155+
/*
156+
#include "esp_vfs_fat.h"
157+
#include "driver/sdmmc_host.h"
158+
#include "driver/sdspi_host.h"
159+
bool sd_init(int miso, int mosi, int sck, int cs)
160+
{
161+
sdmmc_host_t host = SDSPI_HOST_DEFAULT();
162+
sdspi_slot_config_t slot_config = SDSPI_SLOT_CONFIG_DEFAULT();
163+
slot_config.gpio_miso = (gpio_num_t)miso;
164+
slot_config.gpio_mosi = (gpio_num_t)mosi;
165+
slot_config.gpio_sck = (gpio_num_t)sck;
166+
slot_config.gpio_cs = (gpio_num_t)cs;
167+
esp_vfs_fat_sdmmc_mount_config_t mount_config = {
168+
.format_if_mount_failed = false,
169+
.max_files = 8
170+
};
171+
return esp_vfs_fat_sdmmc_mount(mountPoint, &host, &slot_config, &mount_config, NULL) == ESP_OK;
172+
}
173+
*/

src/SD.cpp

Lines changed: 0 additions & 67 deletions
This file was deleted.

src/SD.h

Lines changed: 0 additions & 23 deletions
This file was deleted.

src/SPI.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ void SPIClass::end()
5151

5252
void SPIClass::beginTransaction(SPISettings settings)
5353
{
54+
/*
5455
spi_device_interface_config_t devcfg = {
5556
.mode = settings.dataMode,
5657
.clock_speed_hz = settings.clock,
@@ -63,6 +64,7 @@ void SPIClass::beginTransaction(SPISettings settings)
6364
// start transaction
6465
memset(&transaction, 0, sizeof(transaction));
6566
}
67+
*/
6668
}
6769

6870
void SPIClass::endTransaction(void)
@@ -74,7 +76,7 @@ void SPIClass::endTransaction(void)
7476

7577
uint8_t SPIClass::transfer(uint8_t data)
7678
{
77-
79+
return 0;
7880
}
7981

8082
void SPIClass::transfer(void *buf, size_t count)

src/SPI.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@
2424
class SPISettings
2525
{
2626
public:
27-
uint32_t clock;
28-
uint32_t bitOrder;
29-
uint32_t dataMode;
30-
SPISettings(uint32_t clock = SPI_MASTER_FREQ_8M, uint8_t bitOrder = MSBFIRST, uint8_t dataMode = SPI_MODE0) {}
27+
int clock;
28+
uint8_t bitOrder;
29+
uint8_t dataMode;
30+
SPISettings(int clock = SPI_MASTER_FREQ_8M, uint8_t bitOrder = MSBFIRST, uint8_t dataMode = SPI_MODE0) {}
3131
};
3232

3333
class SPIClass

src/WString.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,7 @@ void String::remove(unsigned int index, unsigned int count){
693693
if (count > len - index) { count = len - index; }
694694
char *writeTo = buffer + index;
695695
len = len - count;
696-
strncpy(writeTo, buffer + index + count,len - index);
696+
memmove(writeTo, buffer + index + count, len - index);
697697
buffer[len] = 0;
698698
}
699699

0 commit comments

Comments
 (0)