Skip to content

Commit 50a6d9a

Browse files
committed
remove a lot of pre-compiled files and esp-idf headers. modify code to
work with esp-idf v4.0-beta2
1 parent cec3fca commit 50a6d9a

File tree

1,483 files changed

+21
-346942
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,483 files changed

+21
-346942
lines changed

cores/esp32/Arduino.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ typedef unsigned int word;
118118
void setup(void);
119119
void loop(void);
120120

121-
long random(long, long);
121+
// long random(long, long);
122122
void randomSeed(unsigned long);
123123
long map(long, long, long, long, long);
124124

@@ -177,6 +177,8 @@ extern "C" void configTzTime(const char* tz,
177177

178178
// WMath prototypes
179179
long random(long);
180+
long random(long,long);
181+
long random(void);
180182
#endif /* __cplusplus */
181183

182184
#define _min(a,b) ((a)<(b)?(a):(b))

cores/esp32/esp32-hal-spi.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
#include "freertos/FreeRTOS.h"
1818
#include "freertos/task.h"
1919
#include "freertos/semphr.h"
20-
#include "rom/ets_sys.h"
20+
#include "esp32/rom/ets_sys.h"
2121
#include "esp_attr.h"
22-
#include "esp_intr.h"
23-
#include "rom/gpio.h"
22+
#include "esp_intr_alloc.h"
23+
#include "esp32/rom/gpio.h"
2424
#include "soc/spi_reg.h"
2525
#include "soc/spi_struct.h"
2626
#include "soc/io_mux_reg.h"
@@ -421,14 +421,14 @@ spi_t * spiStartBus(uint8_t spi_num, uint32_t clockDiv, uint8_t dataMode, uint8_
421421
#endif
422422

423423
if(spi_num == HSPI) {
424-
DPORT_SET_PERI_REG_MASK(DPORT_PERIP_CLK_EN_REG, DPORT_SPI_CLK_EN);
425-
DPORT_CLEAR_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG, DPORT_SPI_RST);
424+
DPORT_SET_PERI_REG_MASK(DPORT_PERIP_CLK_EN_REG, DPORT_SPI2_CLK_EN);
425+
DPORT_CLEAR_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG, DPORT_SPI2_RST);
426426
} else if(spi_num == VSPI) {
427-
DPORT_SET_PERI_REG_MASK(DPORT_PERIP_CLK_EN_REG, DPORT_SPI_CLK_EN_2);
428-
DPORT_CLEAR_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG, DPORT_SPI_RST_2);
427+
DPORT_SET_PERI_REG_MASK(DPORT_PERIP_CLK_EN_REG, DPORT_SPI3_CLK_EN);
428+
DPORT_CLEAR_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG, DPORT_SPI2_RST);
429429
} else {
430-
DPORT_SET_PERI_REG_MASK(DPORT_PERIP_CLK_EN_REG, DPORT_SPI_CLK_EN_1);
431-
DPORT_CLEAR_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG, DPORT_SPI_RST_1);
430+
DPORT_SET_PERI_REG_MASK(DPORT_PERIP_CLK_EN_REG, DPORT_SPI01_CLK_EN);
431+
DPORT_CLEAR_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG, DPORT_SPI01_RST);
432432
}
433433

434434
spiStopBus(spi);

libraries/WiFi/src/WiFiClient.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class WiFiClientRxBuffer {
4646
return 0;
4747
}
4848
int count;
49-
int res = lwip_ioctl_r(_fd, FIONREAD, &count);
49+
int res = lwip_ioctl(_fd, FIONREAD, &count);
5050
if(res < 0) {
5151
_failed = true;
5252
return 0;
@@ -227,7 +227,7 @@ int WiFiClient::connect(IPAddress ip, uint16_t port, int32_t timeout)
227227
tv.tv_sec = 0;
228228
tv.tv_usec = timeout * 1000;
229229

230-
int res = lwip_connect_r(sockfd, (struct sockaddr*)&serveraddr, sizeof(serveraddr));
230+
int res = lwip_connect(sockfd, (struct sockaddr*)&serveraddr, sizeof(serveraddr));
231231
if (res < 0 && errno != EINPROGRESS) {
232232
log_e("connect on fd %d, errno: %d, \"%s\"", sockfd, errno, strerror(errno));
233233
close(sockfd);

libraries/WiFi/src/WiFiSTA.cpp

Lines changed: 4 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -488,8 +488,8 @@ IPAddress WiFiSTAClass::dnsIP(uint8_t dns_no)
488488
if(WiFiGenericClass::getMode() == WIFI_MODE_NULL){
489489
return IPAddress();
490490
}
491-
ip_addr_t dns_ip = dns_getserver(dns_no);
492-
return IPAddress(dns_ip.u_addr.ip4.addr);
491+
const ip_addr_t* dns_ip = dns_getserver(dns_no);
492+
return IPAddress(dns_ip->u_addr.ip4.addr);
493493
}
494494

495495
/**
@@ -687,7 +687,8 @@ bool WiFiSTAClass::beginSmartConfig() {
687687
esp_wifi_disconnect();
688688

689689
esp_err_t err;
690-
err = esp_smartconfig_start(reinterpret_cast<sc_callback_t>(&WiFiSTAClass::_smartConfigCallback), 1);
690+
smartconfig_start_config_t cfg = SMARTCONFIG_START_CONFIG_DEFAULT();
691+
err = esp_smartconfig_start(&cfg);
691692
if (err == ESP_OK) {
692693
_smartConfigStarted = true;
693694
_smartConfigDone = false;
@@ -732,29 +733,3 @@ const char * sc_type_strings[] = {
732733
"ESPTOUCH_AIRKISS"
733734
};
734735
#endif
735-
736-
void WiFiSTAClass::_smartConfigCallback(uint32_t st, void* result) {
737-
smartconfig_status_t status = (smartconfig_status_t) st;
738-
log_d("Status: %s", sc_status_strings[st % 5]);
739-
if (status == SC_STATUS_GETTING_SSID_PSWD) {
740-
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_DEBUG
741-
smartconfig_type_t * type = (smartconfig_type_t *)result;
742-
log_d("Type: %s", sc_type_strings[*type % 3]);
743-
#endif
744-
} else if (status == SC_STATUS_LINK) {
745-
wifi_sta_config_t *sta_conf = reinterpret_cast<wifi_sta_config_t *>(result);
746-
log_d("SSID: %s", (char *)(sta_conf->ssid));
747-
sta_conf->bssid_set = 0;
748-
esp_wifi_set_config(WIFI_IF_STA, (wifi_config_t *)sta_conf);
749-
esp_wifi_connect();
750-
_smartConfigDone = true;
751-
} else if (status == SC_STATUS_LINK_OVER) {
752-
if(result){
753-
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_DEBUG
754-
ip4_addr_t * ip = (ip4_addr_t *)result;
755-
log_d("Sender IP: " IPSTR, IP2STR(ip));
756-
#endif
757-
}
758-
WiFi.stopSmartConfig();
759-
}
760-
}

libraries/WiFi/src/WiFiServer.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ WiFiClient WiFiServer::available(){
4949
else {
5050
struct sockaddr_in _client;
5151
int cs = sizeof(struct sockaddr_in);
52-
client_sock = lwip_accept_r(sockfd, (struct sockaddr *)&_client, (socklen_t*)&cs);
52+
client_sock = lwip_accept(sockfd, (struct sockaddr *)&_client, (socklen_t*)&cs);
5353
}
5454
if(client_sock >= 0){
5555
int val = 1;
@@ -99,15 +99,15 @@ bool WiFiServer::hasClient() {
9999
}
100100
struct sockaddr_in _client;
101101
int cs = sizeof(struct sockaddr_in);
102-
_accepted_sockfd = lwip_accept_r(sockfd, (struct sockaddr *)&_client, (socklen_t*)&cs);
102+
_accepted_sockfd = lwip_accept(sockfd, (struct sockaddr *)&_client, (socklen_t*)&cs);
103103
if (_accepted_sockfd >= 0) {
104104
return true;
105105
}
106106
return false;
107107
}
108108

109109
void WiFiServer::end(){
110-
lwip_close_r(sockfd);
110+
lwip_close(sockfd);
111111
sockfd = -1;
112112
_listening = false;
113113
}

tools/sdk/bin/bootloader_dio_40m.bin

-15.5 KB
Binary file not shown.

tools/sdk/bin/bootloader_dio_80m.bin

-15.5 KB
Binary file not shown.

tools/sdk/bin/bootloader_dout_40m.bin

-15.5 KB
Binary file not shown.

tools/sdk/bin/bootloader_dout_80m.bin

-15.5 KB
Binary file not shown.

tools/sdk/bin/bootloader_qio_40m.bin

-17 KB
Binary file not shown.

tools/sdk/bin/bootloader_qio_80m.bin

-17 KB
Binary file not shown.

tools/sdk/bin/bootloader_qout_40m.bin

-17 KB
Binary file not shown.

tools/sdk/bin/bootloader_qout_80m.bin

-17 KB
Binary file not shown.

0 commit comments

Comments
 (0)