Initial Esp32c3 Support (#5060)

This commit is contained in:
Me No Dev
2021-04-14 18:10:05 +03:00
committed by GitHub
parent 371f382db7
commit 404a31f445
1929 changed files with 382833 additions and 190 deletions

View File

@ -9,9 +9,9 @@
*/
// Set up the rgb led names
uint8_t ledR = A4;
uint8_t ledG = A5;
uint8_t ledB = A18;
uint8_t ledR = 2;
uint8_t ledG = 4;
uint8_t ledB = 5;
uint8_t ledArray[3] = {1, 2, 3}; // three led channels

View File

@ -17,6 +17,8 @@
#include "esp32/rom/rtc.h"
#elif CONFIG_IDF_TARGET_ESP32S2
#include "esp32s2/rom/rtc.h"
#elif CONFIG_IDF_TARGET_ESP32C3
#include "esp32c3/rom/rtc.h"
#else
#error Target CONFIG_IDF_TARGET is not supported
#endif

View File

@ -124,6 +124,8 @@ bool sdSelectCard(uint8_t pdrv)
bool s = sdWait(pdrv, 300);
if (!s) {
log_e("Select Failed");
digitalWrite(card->ssPin, HIGH);
return false;
}
return true;
}

View File

@ -13,7 +13,7 @@
// limitations under the License.
#include "SD_MMC.h"
#ifndef CONFIG_IDF_TARGET_ESP32S2 //SDMMC does not work on ESP32S2
#if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) //SDMMC does not work on ESP32S2
#include "vfs_api.h"
extern "C" {

View File

@ -55,6 +55,11 @@ void SPIClass::begin(int8_t sck, int8_t miso, int8_t mosi, int8_t ss)
_miso = (_spi_num == FSPI) ? MISO : -1;
_mosi = (_spi_num == FSPI) ? MOSI : -1;
_ss = (_spi_num == FSPI) ? SS : -1;
#elif CONFIG_IDF_TARGET_ESP32C3
_sck = SCK;
_miso = MISO;
_mosi = MOSI;
_ss = SS;
#else
_sck = (_spi_num == VSPI) ? SCK : 14;
_miso = (_spi_num == VSPI) ? MISO : 12;

View File

@ -321,7 +321,7 @@ int WiFiClient::setOption(int option, int *value)
int WiFiClient::getOption(int option, int *value)
{
size_t size = sizeof(int);
socklen_t size = sizeof(int);
int res = getsockopt(fd(), IPPROTO_TCP, option, (char *)value, &size);
if(res < 0) {
log_e("fail on fd %d, errno: %d, \"%s\"", fd(), errno, strerror(errno));

View File

@ -41,7 +41,7 @@
bool wifiLowLevelInit(bool persistent);
#if CONFIG_IDF_TARGET_ESP32
#if CONFIG_BLUEDROID_ENABLED
static const uint8_t custom_service_uuid[16] = { 0xb4, 0xdf, 0x5a, 0x1c, 0x3f, 0x6b, 0xf4, 0xbf,
0xea, 0x4a, 0x82, 0x03, 0x04, 0x90, 0x1a, 0x02, };
#endif