Compare commits

...

26 Commits

Author SHA1 Message Date
6d256b6454 IDF release/v3.3 68b237fe5 with Disable IRAM optimisation for WiFi 2020-11-16 13:06:50 +02:00
f6bf0f7aa2 IDF release/v3.3 68b237fe5 2020-11-16 12:44:07 +02:00
a59eb5d51e Merge branch 'master' into idf-release/v3.3 2020-11-16 12:09:23 +02:00
adafd9d7c0 Merge pull request #4538 from loick111/feature/custom_variants_dir
The goal is to allow custom configuration for `variants_dir` to define our own board variant directly in the project.

With this functionnality, we are now allowed to define in our projects a custom board **AND** a custom variant.
https://docs.platformio.org/en/latest/platforms/creating_board.html#custom-embedded-boards

Here is an example of how to define a custom board with custom variant:
```
my_project
├── boards
│   └── custom_esp32dev.json
└── variants
    └── custom-esp32dev
        └── pins_arduino.h
```

custom_esp32dev.json
```json
{
  "build": {
    "arduino":{
      "ldscript": "esp32_out.ld"
    },
    "core": "esp32",
    "extra_flags": "-DARDUINO_ESP32_DEV",
    "f_cpu": "240000000L",
    "f_flash": "40000000L",
    "flash_mode": "dio",
    "mcu": "esp32",
    "variants_dir": "variants",
    "variant": "custom-esp32dev"
  },
  "connectivity": [
    "wifi",
    "bluetooth",
    "ethernet",
    "can"
  ],
  "debug": {
    "openocd_board": "esp-wroom-32.cfg"
  },
  "frameworks": [
    "arduino",
    "espidf"
  ],
  "name": "My Custom Espressif ESP32 Dev Module",
  "upload": {
    "flash_size": "4MB",
    "maximum_ram_size": 327680,
    "maximum_size": 4194304,
    "require_upload_port": true,
    "speed": 460800
  },
  "url": "https://en.wikipedia.org/wiki/ESP32",
  "vendor": "Espressif"
}
```
2020-11-15 20:43:43 +02:00
ac9fdeffe4 Allow custom variants directory 2020-11-15 16:20:02 +01:00
cee7b4237c Merge branch 'master' into idf-release/v3.3 2020-11-15 12:02:51 +02:00
954df2fc3e Disable IRAM optimization for WiFi 2020-11-15 11:56:01 +02:00
e41fb08b2a Update esptool to work on BigSur 2020-11-15 08:53:07 +02:00
d8b1fc81c0 Added usedBytes to match other filesystems (#4534) 2020-11-15 08:48:21 +02:00
378b6ac032 Fix issue in webserver with Chrome based browsers
https://github.com/espressif/arduino-esp32/issues/3652
2020-11-15 08:46:23 +02:00
cecef8e930 IDF release/v3.3 68b237fe5 2020-11-14 00:33:27 +00:00
a8e99baeab Merge branch 'master' into idf-release/v3.3 2020-11-12 21:29:57 +02:00
b6cc108d49 Update WiFiProv.cpp (#4519)
Do not pollute the global namespace with generic names like 'config' by declaring global variables 'static'.
2020-11-10 20:51:10 +02:00
8816bb5505 Added #define LED_BUILTIN to all pins_arduino.h that need it. (#4520) 2020-11-10 20:50:35 +02:00
3274602eb0 Notify the batteryLevel change (#4517) 2020-11-10 13:02:00 +02:00
534f0810a6 fix bitWrite macro (#4507)
Fixes https://github.com/espressif/arduino-esp32/issues/4466
2020-11-09 17:08:13 +02:00
28a8073069 Fix issue 4095 (#4503)
pgmspace.h missing 'pgm_get_far_address'
2020-11-08 04:55:59 +02:00
7494c4e76d IDF release/v3.3 44ec7972b 2020-11-08 00:36:32 +00:00
486a4c66c4 SDCARD: First sector always written twice if multiple sectors are updated 2020-11-06 22:20:20 +02:00
c1951670d1 IDF release/v3.3 66d3783c8 2020-11-06 18:15:23 +00:00
ad07d36932 Update README.md 2020-11-06 17:21:12 +02:00
c6a8da61f7 Allow faster reuse of socket, to be able to restart WifiServer. (#4306)
See #3960 for more details of the problem and the solution. I only implemented what was proposed in this ticket, as it solves my problem, which was the same as in this ticket. Credits for the code going to @etrinh ;-)

This also is a more consistence behaviour compared to esp8266, where it also is possible to restart the wifiserver immediately on the same port.
2020-11-06 14:16:50 +02:00
dd1a15478f add TimerCAM and CoreInk board (#4498) 2020-11-06 13:30:57 +02:00
bcb7012a32 Change variants folder T-Beam (#4496) 2020-11-06 12:42:18 +02:00
3968821834 HttpClient uses Serial.printf() (#4488)
changed to log_d()
2020-11-04 14:49:33 +02:00
90f869e772 Fix BUG: Parsing of first line fails (#4484)
..because a firstLine = false; is missing ;)
2020-11-04 02:24:01 +02:00
154 changed files with 501 additions and 54 deletions

View File

@ -14,7 +14,7 @@
Latest Stable Release [![Release Version](https://img.shields.io/github/release/espressif/arduino-esp32.svg?style=plastic)](https://github.com/espressif/arduino-esp32/releases/latest/) [![Release Date](https://img.shields.io/github/release-date/espressif/arduino-esp32.svg?style=plastic)](https://github.com/espressif/arduino-esp32/releases/latest/) [![Downloads](https://img.shields.io/github/downloads/espressif/arduino-esp32/latest/total.svg?style=plastic)](https://github.com/espressif/arduino-esp32/releases/latest/) Latest Stable Release [![Release Version](https://img.shields.io/github/release/espressif/arduino-esp32.svg?style=plastic)](https://github.com/espressif/arduino-esp32/releases/latest/) [![Release Date](https://img.shields.io/github/release-date/espressif/arduino-esp32.svg?style=plastic)](https://github.com/espressif/arduino-esp32/releases/latest/) [![Downloads](https://img.shields.io/github/downloads/espressif/arduino-esp32/latest/total.svg?style=plastic)](https://github.com/espressif/arduino-esp32/releases/latest/)
Latest Development Release [![Release Version](https://img.shields.io/github/release/espressif/arduino-esp32.svg?style=plastic)](https://github.com/espressif/arduino-esp32/releases/latest/) [![Release Date](https://img.shields.io/github/release-date/espressif/arduino-esp32.svg?style=plastic)](https://github.com/espressif/arduino-esp32/releases/latest/) [![Downloads](https://img.shields.io/github/downloads/espressif/arduino-esp32/latest/total.svg?style=plastic)](https://github.com/espressif/arduino-esp32/releases/latest/) Latest Development Release [![Release Version](https://img.shields.io/github/release/espressif/arduino-esp32/all.svg?style=plastic)](https://github.com/espressif/arduino-esp32/releases/latest/) [![Release Date](https://img.shields.io/github/release-date-pre/espressif/arduino-esp32.svg?style=plastic)](https://github.com/espressif/arduino-esp32/releases/latest/) [![Downloads](https://img.shields.io/github/downloads-pre/espressif/arduino-esp32/latest/total.svg?style=plastic)](https://github.com/espressif/arduino-esp32/releases/latest/)
### Installation Instructions ### Installation Instructions

View File

@ -2826,6 +2826,161 @@ m5stack-core2.menu.DebugLevel.verbose.build.code_debug=5
############################################################## ##############################################################
m5stack-timer-cam.name=M5Stack-Timer-CAM
m5stack-timer-cam.upload.tool=esptool_py
m5stack-timer-cam.upload.maximum_size=1310720
m5stack-timer-cam.upload.maximum_data_size=327680
m5stack-timer-cam.upload.wait_for_upload_port=true
m5stack-timer-cam.serial.disableDTR=true
m5stack-timer-cam.serial.disableRTS=true
m5stack-timer-cam.build.mcu=esp32
m5stack-timer-cam.build.core=esp32
m5stack-timer-cam.build.variant=m5stack_timer_cam
m5stack-timer-cam.build.board=M5Stack-Timer-CAM
m5stack-timer-cam.build.f_cpu=240000000L
m5stack-timer-cam.build.flash_size=4MB
m5stack-timer-cam.build.flash_freq=80m
m5stack-timer-cam.build.flash_mode=dio
m5stack-timer-cam.build.boot=dio
m5stack-timer-cam.build.partitions=default
m5stack-timer-cam.build.defines=
m5stack-timer-cam.menu.PSRAM.enabled=Enabled
m5stack-timer-cam.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue
m5stack-timer-cam.menu.PSRAM.disabled=Disabled
m5stack-timer-cam.menu.PSRAM.disabled.build.defines=
m5stack-timer-cam.menu.PartitionScheme.default=Default(3MB No OTA/1MB SPIFFS)
m5stack-timer-cam.menu.PartitionScheme.default.build.partitions=huge_app
m5stack-timer-cam.menu.PartitionScheme.default.upload.maximum_size=3145728
m5stack-timer-cam.menu.PartitionScheme.no_ota=No OTA (Large APP)
m5stack-timer-cam.menu.PartitionScheme.no_ota.build.partitions=no_ota
m5stack-timer-cam.menu.PartitionScheme.no_ota.upload.maximum_size=2097152
m5stack-timer-cam.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (Large APPS with OTA)
m5stack-timer-cam.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs
m5stack-timer-cam.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080
m5stack-timer-cam.menu.PartitionScheme.no_ota=No OTA (2MB APP/2MB SPIFFS)
m5stack-timer-cam.menu.PartitionScheme.no_ota.build.partitions=no_ota
m5stack-timer-cam.menu.PartitionScheme.no_ota.upload.maximum_size=2097152
m5stack-timer-cam.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (1.9MB APP with OTA/190KB SPIFFS)
m5stack-timer-cam.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs
m5stack-timer-cam.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080
m5stack-timer-cam.menu.CPUFreq.240=240MHz (WiFi/BT)
m5stack-timer-cam.menu.CPUFreq.240.build.f_cpu=240000000L
m5stack-timer-cam.menu.CPUFreq.160=160MHz (WiFi/BT)
m5stack-timer-cam.menu.CPUFreq.160.build.f_cpu=160000000L
m5stack-timer-cam.menu.CPUFreq.80=80MHz (WiFi/BT)
m5stack-timer-cam.menu.CPUFreq.80.build.f_cpu=80000000L
m5stack-timer-cam.menu.CPUFreq.40=40MHz (40MHz XTAL)
m5stack-timer-cam.menu.CPUFreq.40.build.f_cpu=40000000L
m5stack-timer-cam.menu.CPUFreq.26=26MHz (26MHz XTAL)
m5stack-timer-cam.menu.CPUFreq.26.build.f_cpu=26000000L
m5stack-timer-cam.menu.CPUFreq.20=20MHz (40MHz XTAL)
m5stack-timer-cam.menu.CPUFreq.20.build.f_cpu=20000000L
m5stack-timer-cam.menu.CPUFreq.13=13MHz (26MHz XTAL)
m5stack-timer-cam.menu.CPUFreq.13.build.f_cpu=13000000L
m5stack-timer-cam.menu.CPUFreq.10=10MHz (40MHz XTAL)
m5stack-timer-cam.menu.CPUFreq.10.build.f_cpu=10000000L
m5stack-timer-cam.menu.UploadSpeed.1500000=1500000
m5stack-timer-cam.menu.UploadSpeed.1500000.upload.speed=1500000
m5stack-timer-cam.menu.UploadSpeed.750000=750000
m5stack-timer-cam.menu.UploadSpeed.750000.upload.speed=750000
m5stack-timer-cam.menu.UploadSpeed.500000=500000
m5stack-timer-cam.menu.UploadSpeed.500000.upload.speed=500000
m5stack-timer-cam.menu.UploadSpeed.250000=250000
m5stack-timer-cam.menu.UploadSpeed.250000.upload.speed=250000
m5stack-timer-cam.menu.UploadSpeed.115200=115200
m5stack-timer-cam.menu.UploadSpeed.115200.upload.speed=115200
m5stack-timer-cam.menu.DebugLevel.none=None
m5stack-timer-cam.menu.DebugLevel.none.build.code_debug=0
m5stack-timer-cam.menu.DebugLevel.error=Error
m5stack-timer-cam.menu.DebugLevel.error.build.code_debug=1
m5stack-timer-cam.menu.DebugLevel.warn=Warn
m5stack-timer-cam.menu.DebugLevel.warn.build.code_debug=2
m5stack-timer-cam.menu.DebugLevel.info=Info
m5stack-timer-cam.menu.DebugLevel.info.build.code_debug=3
m5stack-timer-cam.menu.DebugLevel.debug=Debug
m5stack-timer-cam.menu.DebugLevel.debug.build.code_debug=4
m5stack-timer-cam.menu.DebugLevel.verbose=Verbose
m5stack-timer-cam.menu.DebugLevel.verbose.build.code_debug=5
##############################################################
m5stack-coreink.name=M5Stack-CoreInk
m5stack-coreink.upload.tool=esptool_py
m5stack-coreink.upload.maximum_size=1310720
m5stack-coreink.upload.maximum_data_size=327680
m5stack-coreink.upload.wait_for_upload_port=true
m5stack-coreink.serial.disableDTR=true
m5stack-coreink.serial.disableRTS=true
m5stack-coreink.build.mcu=esp32
m5stack-coreink.build.core=esp32
m5stack-coreink.build.variant=m5stack_coreink
m5stack-coreink.build.board=M5Stack_CoreInk
m5stack-coreink.build.f_cpu=240000000L
m5stack-coreink.build.flash_size=4MB
m5stack-coreink.build.flash_freq=80m
m5stack-coreink.build.flash_mode=dio
m5stack-coreink.build.boot=dio
m5stack-coreink.build.partitions=default
m5stack-coreink.build.defines=
m5stack-coreink.menu.PartitionScheme.default=Default
m5stack-coreink.menu.PartitionScheme.default.build.partitions=default
m5stack-coreink.menu.PartitionScheme.no_ota=No OTA (Large APP)
m5stack-coreink.menu.PartitionScheme.no_ota.build.partitions=no_ota
m5stack-coreink.menu.PartitionScheme.no_ota.upload.maximum_size=2097152
m5stack-coreink.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (Large APPS with OTA)
m5stack-coreink.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs
m5stack-coreink.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080
m5stack-coreink.menu.UploadSpeed.921600=921600
m5stack-coreink.menu.UploadSpeed.921600.upload.speed=921600
m5stack-coreink.menu.UploadSpeed.115200=115200
m5stack-coreink.menu.UploadSpeed.115200.upload.speed=115200
m5stack-coreink.menu.UploadSpeed.256000.windows=256000
m5stack-coreink.menu.UploadSpeed.256000.upload.speed=256000
m5stack-coreink.menu.UploadSpeed.230400.windows.upload.speed=256000
m5stack-coreink.menu.UploadSpeed.230400=230400
m5stack-coreink.menu.UploadSpeed.230400.upload.speed=230400
m5stack-coreink.menu.UploadSpeed.460800.linux=460800
m5stack-coreink.menu.UploadSpeed.460800.macosx=460800
m5stack-coreink.menu.UploadSpeed.460800.upload.speed=460800
m5stack-coreink.menu.UploadSpeed.512000.windows=512000
m5stack-coreink.menu.UploadSpeed.512000.upload.speed=512000
m5stack-coreink.menu.UploadSpeed.1500000=1500000
m5stack-coreink.menu.UploadSpeed.1500000.upload.speed=1500000
m5stack-coreink.menu.DebugLevel.none=None
m5stack-coreink.menu.DebugLevel.none.build.code_debug=0
m5stack-coreink.menu.DebugLevel.error=Error
m5stack-coreink.menu.DebugLevel.error.build.code_debug=1
m5stack-coreink.menu.DebugLevel.warn=Warn
m5stack-coreink.menu.DebugLevel.warn.build.code_debug=2
m5stack-coreink.menu.DebugLevel.info=Info
m5stack-coreink.menu.DebugLevel.info.build.code_debug=3
m5stack-coreink.menu.DebugLevel.debug=Debug
m5stack-coreink.menu.DebugLevel.debug.build.code_debug=4
m5stack-coreink.menu.DebugLevel.verbose=Verbose
m5stack-coreink.menu.DebugLevel.verbose.build.code_debug=5
##############################################################
odroid_esp32.name=ODROID ESP32 odroid_esp32.name=ODROID ESP32
odroid_esp32.upload.tool=esptool_py odroid_esp32.upload.tool=esptool_py

View File

@ -88,7 +88,7 @@
#define bitRead(value, bit) (((value) >> (bit)) & 0x01) #define bitRead(value, bit) (((value) >> (bit)) & 0x01)
#define bitSet(value, bit) ((value) |= (1UL << (bit))) #define bitSet(value, bit) ((value) |= (1UL << (bit)))
#define bitClear(value, bit) ((value) &= ~(1UL << (bit))) #define bitClear(value, bit) ((value) &= ~(1UL << (bit)))
#define bitWrite(value, bit, bitvalue) (bitvalue ? bitSet(value, bit) : bitClear(value, bit)) #define bitWrite(value, bit, bitvalue) ((bitvalue) ? bitSet(value, bit) : bitClear(value, bit))
// avr-libc defines _NOP() since 1.6.2 // avr-libc defines _NOP() since 1.6.2
#ifndef _NOP #ifndef _NOP

View File

@ -53,6 +53,8 @@ typedef unsigned long prog_uint32_t;
*(void * const *)(_addr); \ *(void * const *)(_addr); \
}) })
#define pgm_get_far_address(x) ((uint32_t)(&(x)))
#define pgm_read_byte_near(addr) pgm_read_byte(addr) #define pgm_read_byte_near(addr) pgm_read_byte(addr)
#define pgm_read_word_near(addr) pgm_read_word(addr) #define pgm_read_word_near(addr) pgm_read_word(addr)
#define pgm_read_dword_near(addr) pgm_read_dword(addr) #define pgm_read_dword_near(addr) pgm_read_dword(addr)

View File

@ -194,6 +194,7 @@ BLECharacteristic* BLEHIDDevice::protocolMode() {
void BLEHIDDevice::setBatteryLevel(uint8_t level) { void BLEHIDDevice::setBatteryLevel(uint8_t level) {
m_batteryLevelCharacteristic->setValue(&level, 1); m_batteryLevelCharacteristic->setValue(&level, 1);
m_batteryLevelCharacteristic->notify();
} }
/* /*
* @brief Returns battery level characteristic * @brief Returns battery level characteristic

View File

@ -135,6 +135,21 @@ size_t F_Fat::totalBytes()
return tot_sect * sect_size; return tot_sect * sect_size;
} }
size_t F_Fat::usedBytes()
{
FATFS *fs;
DWORD free_clust, used_sect, sect_size;
BYTE pdrv = ff_diskio_get_pdrv_wl(_wl_handle);
char drv[3] = {(char)(48+pdrv), ':', 0};
if ( f_getfree(drv, &free_clust, &fs) != FR_OK){
return 0;
}
used_sect = (fs->n_fatent - 2 - free_clust) * fs->csize;
sect_size = CONFIG_WL_SECTOR_SIZE;
return used_sect * sect_size;
}
size_t F_Fat::freeBytes() size_t F_Fat::freeBytes()
{ {

View File

@ -31,6 +31,7 @@ public:
bool begin(bool formatOnFail=false, const char * basePath="/ffat", uint8_t maxOpenFiles=10, const char * partitionLabel = (char*)FFAT_PARTITION_LABEL); bool begin(bool formatOnFail=false, const char * basePath="/ffat", uint8_t maxOpenFiles=10, const char * partitionLabel = (char*)FFAT_PARTITION_LABEL);
bool format(bool full_wipe = FFAT_WIPE_QUICK, char* partitionLabel = (char*)FFAT_PARTITION_LABEL); bool format(bool full_wipe = FFAT_WIPE_QUICK, char* partitionLabel = (char*)FFAT_PARTITION_LABEL);
size_t totalBytes(); size_t totalBytes();
size_t usedBytes();
size_t freeBytes(); size_t freeBytes();
void end(); void end();
bool exists(const char* path); bool exists(const char* path);

View File

@ -583,7 +583,7 @@ int HTTPClient::sendRequest(const char * type, uint8_t * payload, size_t size)
} }
code = handleHeaderResponse(); code = handleHeaderResponse();
Serial.printf("sendRequest code=%d\n", code); log_d("sendRequest code=%d\n", code);
// Handle redirections as stated in RFC document: // Handle redirections as stated in RFC document:
// https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html // https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
@ -1199,6 +1199,7 @@ int HTTPClient::handleHeaderResponse()
log_v("RX: '%s'", headerLine.c_str()); log_v("RX: '%s'", headerLine.c_str());
if(firstLine) { if(firstLine) {
firstLine = false;
if(_canReuse && headerLine.startsWith("HTTP/1.")) { if(_canReuse && headerLine.startsWith("HTTP/1.")) {
_canReuse = (headerLine[sizeof "HTTP/1." - 1] != '0'); _canReuse = (headerLine[sizeof "HTTP/1." - 1] != '0');
} }

View File

@ -607,8 +607,9 @@ DRESULT ff_sd_write(uint8_t pdrv, const uint8_t* buffer, DWORD sector, UINT coun
if (count > 1) { if (count > 1) {
res = sdWriteSectors(pdrv, (const char*)buffer, sector, count) ? RES_OK : RES_ERROR; res = sdWriteSectors(pdrv, (const char*)buffer, sector, count) ? RES_OK : RES_ERROR;
} else {
res = sdWriteSector(pdrv, (const char*)buffer, sector) ? RES_OK : RES_ERROR;
} }
res = sdWriteSector(pdrv, (const char*)buffer, sector) ? RES_OK : RES_ERROR;
return res; return res;
} }

View File

@ -313,11 +313,12 @@ void WebServer::handleClient() {
_contentLength = CONTENT_LENGTH_NOT_SET; _contentLength = CONTENT_LENGTH_NOT_SET;
_handleRequest(); _handleRequest();
if (_currentClient.connected()) { // Fix for issue with Chrome based browsers: https://github.com/espressif/arduino-esp32/issues/3652
_currentStatus = HC_WAIT_CLOSE; // if (_currentClient.connected()) {
_statusChange = millis(); // _currentStatus = HC_WAIT_CLOSE;
keepCurrentClient = true; // _statusChange = millis();
} // keepCurrentClient = true;
// }
} }
} else { // !_currentClient.available() } else { // !_currentClient.available()
if (millis() - _statusChange <= HTTP_MAX_DATA_WAIT) { if (millis() - _statusChange <= HTTP_MAX_DATA_WAIT) {

View File

@ -33,9 +33,10 @@
#undef IPADDR_NONE #undef IPADDR_NONE
#include "WiFi.h" #include "WiFi.h"
wifi_prov_mgr_config_t config;
scheme_t prov_scheme;
extern esp_err_t postToSysQueue(system_prov_event_t *); extern esp_err_t postToSysQueue(system_prov_event_t *);
static wifi_prov_mgr_config_t config;
static scheme_t prov_scheme;
static const uint8_t custom_service_uuid[16] = { 0xb4, 0xdf, 0x5a, 0x1c, 0x3f, 0x6b, 0xf4, 0xbf, static const uint8_t custom_service_uuid[16] = { 0xb4, 0xdf, 0x5a, 0x1c, 0x3f, 0x6b, 0xf4, 0xbf,
0xea, 0x4a, 0x82, 0x03, 0x04, 0x90, 0x1a, 0x02, }; 0xea, 0x4a, 0x82, 0x03, 0x04, 0x90, 0x1a, 0x02, };

View File

@ -63,6 +63,10 @@ WiFiClient WiFiServer::available(){
} }
void WiFiServer::begin(uint16_t port){ void WiFiServer::begin(uint16_t port){
begin(port, 1);
}
void WiFiServer::begin(uint16_t port, int enable){
if(_listening) if(_listening)
return; return;
if(port){ if(port){
@ -72,6 +76,7 @@ void WiFiServer::begin(uint16_t port){
sockfd = socket(AF_INET , SOCK_STREAM, 0); sockfd = socket(AF_INET , SOCK_STREAM, 0);
if (sockfd < 0) if (sockfd < 0)
return; return;
setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, &enable, sizeof(int));
server.sin_family = AF_INET; server.sin_family = AF_INET;
server.sin_addr.s_addr = INADDR_ANY; server.sin_addr.s_addr = INADDR_ANY;
server.sin_port = htons(_port); server.sin_port = htons(_port);

View File

@ -40,6 +40,7 @@ class WiFiServer : public Server {
WiFiClient available(); WiFiClient available();
WiFiClient accept(){return available();} WiFiClient accept(){return available();}
void begin(uint16_t port=0); void begin(uint16_t port=0);
void begin(uint16_t port, int reuse_enable);
void setNoDelay(bool nodelay); void setNoDelay(bool nodelay);
bool getNoDelay(); bool getNoDelay();
bool hasClient(); bool hasClient();

View File

@ -41,7 +41,7 @@
{ {
"packager": "esp32", "packager": "esp32",
"name": "esptool_py", "name": "esptool_py",
"version": "2.6.1" "version": "3.0.0"
}, },
{ {
"packager": "esp32", "packager": "esp32",
@ -102,49 +102,49 @@
}, },
{ {
"name": "esptool_py", "name": "esptool_py",
"version": "2.6.1", "version": "3.0.0",
"systems": [ "systems": [
{ {
"host": "i686-mingw32", "host": "i686-mingw32",
"url": "https://dl.espressif.com/dl/esptool-2.6.1-windows.zip", "url": "https://dl.espressif.com/dl/esptool-3.0.0.2-windows.zip",
"archiveFileName": "esptool-2.6.1-windows.zip", "archiveFileName": "esptool-3.0.0.2-windows.zip",
"checksum": "SHA-256:84cf0b369a7707fe566434faba148852fc464992111d5baa95b658b374802f96", "checksum": "SHA-256:b192bfc1545a3c92658ce586b4edcc2aca3f0ad4b3fa8417d658bc8a48f1387e",
"size": "3422445" "size": "3434736"
}, },
{ {
"host": "x86_64-apple-darwin", "host": "x86_64-apple-darwin",
"url": "https://dl.espressif.com/dl/esptool-2.6.1-macos.tar.gz", "url": "https://dl.espressif.com/dl/esptool-3.0.0.2-macos.tar.gz",
"archiveFileName": "esptool-2.6.1-macos.tar.gz", "archiveFileName": "esptool-3.0.0.2-macos.tar.gz",
"checksum": "SHA-256:f4eb758a301d6902cc9dfcd49d36345d2f075ad123da7cf8132d15cfb7533457", "checksum": "SHA-256:9213f46d5aa865558da4a2ef4218e87eef4782779128083c15ce2b3e4d07a1ea",
"size": "3837085" "size": "3849615"
}, },
{ {
"host": "x86_64-pc-linux-gnu", "host": "x86_64-pc-linux-gnu",
"url": "https://dl.espressif.com/dl/esptool-2.6.1-linux.tar.gz", "url": "https://dl.espressif.com/dl/esptool-3.0.0.2-linux.tar.gz",
"archiveFileName": "esptool-2.6.1-linux.tar.gz", "archiveFileName": "esptool-3.0.0.2-linux.tar.gz",
"checksum": "SHA-256:eaf82ff4070d9792f6a42ae1e485375de5a87bec59ef01dfb95de901519ec7fb", "checksum": "SHA-256:d5cb51da1c74ff69f81b820470d2ecccb5c7c3a2dec7776483d4c89588b00020",
"size": "44762" "size": "57526"
}, },
{ {
"host": "i686-pc-linux-gnu", "host": "i686-pc-linux-gnu",
"url": "https://dl.espressif.com/dl/esptool-2.6.1-linux.tar.gz", "url": "https://dl.espressif.com/dl/esptool-3.0.0.2-linux.tar.gz",
"archiveFileName": "esptool-2.6.1-linux.tar.gz", "archiveFileName": "esptool-3.0.0.2-linux.tar.gz",
"checksum": "SHA-256:eaf82ff4070d9792f6a42ae1e485375de5a87bec59ef01dfb95de901519ec7fb", "checksum": "SHA-256:d5cb51da1c74ff69f81b820470d2ecccb5c7c3a2dec7776483d4c89588b00020",
"size": "44762" "size": "57526"
}, },
{ {
"host": "arm-linux-gnueabihf", "host": "arm-linux-gnueabihf",
"url": "https://dl.espressif.com/dl/esptool-2.6.1-linux.tar.gz", "url": "https://dl.espressif.com/dl/esptool-3.0.0.2-linux.tar.gz",
"archiveFileName": "esptool-2.6.1-linux.tar.gz", "archiveFileName": "esptool-3.0.0.2-linux.tar.gz",
"checksum": "SHA-256:eaf82ff4070d9792f6a42ae1e485375de5a87bec59ef01dfb95de901519ec7fb", "checksum": "SHA-256:d5cb51da1c74ff69f81b820470d2ecccb5c7c3a2dec7776483d4c89588b00020",
"size": "44762" "size": "57526"
}, },
{ {
"host": "aarch64-linux-gnu", "host": "aarch64-linux-gnu",
"url": "https://dl.espressif.com/dl/esptool-2.6.1-linux.tar.gz", "url": "https://dl.espressif.com/dl/esptool-3.0.0.2-linux.tar.gz",
"archiveFileName": "esptool-2.6.1-linux.tar.gz", "archiveFileName": "esptool-3.0.0.2-linux.tar.gz",
"checksum": "SHA-256:eaf82ff4070d9792f6a42ae1e485375de5a87bec59ef01dfb95de901519ec7fb", "checksum": "SHA-256:d5cb51da1c74ff69f81b820470d2ecccb5c7c3a2dec7776483d4c89588b00020",
"size": "44762" "size": "57526"
} }
] ]
}, },

View File

@ -194,16 +194,20 @@ if not env.BoardConfig().get("build.ldscript", ""):
libs = [] libs = []
variants_dir = join(FRAMEWORK_DIR, "variants")
if "build.variants_dir" in env.BoardConfig():
variants_dir = join("$PROJECT_DIR", env.BoardConfig().get("build.variants_dir"))
if "build.variant" in env.BoardConfig(): if "build.variant" in env.BoardConfig():
env.Append( env.Append(
CPPPATH=[ CPPPATH=[
join(FRAMEWORK_DIR, "variants", join(variants_dir, env.BoardConfig().get("build.variant"))
env.BoardConfig().get("build.variant"))
] ]
) )
libs.append(env.BuildLibrary( libs.append(env.BuildLibrary(
join("$BUILD_DIR", "FrameworkArduinoVariant"), join("$BUILD_DIR", "FrameworkArduinoVariant"),
join(FRAMEWORK_DIR, "variants", env.BoardConfig().get("build.variant")) join(variants_dir, env.BoardConfig().get("build.variant"))
)) ))
envsafe = env.Clone() envsafe = env.Clone()

Binary file not shown.

View File

@ -87,6 +87,7 @@
#define CONFIG_MFN56_1X 1 #define CONFIG_MFN56_1X 1
#define CONFIG_LWIP_MAX_SOCKETS 10 #define CONFIG_LWIP_MAX_SOCKETS 10
#define CONFIG_LWIP_NETIF_LOOPBACK 1 #define CONFIG_LWIP_NETIF_LOOPBACK 1
#define CONFIG_LWIP_TCP_ISN_HOOK 1
#define CONFIG_ESP32_PTHREAD_TASK_NAME_DEFAULT "pthread" #define CONFIG_ESP32_PTHREAD_TASK_NAME_DEFAULT "pthread"
#define CONFIG_EMAC_TASK_PRIORITY 20 #define CONFIG_EMAC_TASK_PRIORITY 20
#define CONFIG_TIMER_TASK_STACK_DEPTH 2048 #define CONFIG_TIMER_TASK_STACK_DEPTH 2048
@ -244,7 +245,6 @@
#define CONFIG_SPIFFS_GC_MAX_RUNS 10 #define CONFIG_SPIFFS_GC_MAX_RUNS 10
#define CONFIG_ARDUINO_RUN_CORE1 1 #define CONFIG_ARDUINO_RUN_CORE1 1
#define CONFIG_ESP32_APPTRACE_DEST_NONE 1 #define CONFIG_ESP32_APPTRACE_DEST_NONE 1
#define CONFIG_ESP32_WIFI_RX_IRAM_OPT 1
#define CONFIG_HP_NANO1 1 #define CONFIG_HP_NANO1 1
#define CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC 1 #define CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC 1
#define CONFIG_MBEDTLS_SSL_PROTO_TLS1_2 1 #define CONFIG_MBEDTLS_SSL_PROTO_TLS1_2 1
@ -392,7 +392,6 @@
#define CONFIG_HD_NANO1 1 #define CONFIG_HD_NANO1 1
#define CONFIG_BTDM_MODEM_SLEEP_MODE_ORIG 1 #define CONFIG_BTDM_MODEM_SLEEP_MODE_ORIG 1
#define CONFIG_ARDUHAL_LOG_DEFAULT_LEVEL_ERROR 1 #define CONFIG_ARDUHAL_LOG_DEFAULT_LEVEL_ERROR 1
#define CONFIG_ESP32_WIFI_IRAM_OPT 1
#define CONFIG_FATFS_API_ENCODING_ANSI_OEM 1 #define CONFIG_FATFS_API_ENCODING_ANSI_OEM 1
#define CONFIG_ARDUINO_IDF_COMMIT "66d3783c8" #define CONFIG_ARDUINO_IDF_COMMIT "68b237fe5"
#define CONFIG_ARDUINO_IDF_BRANCH "release/v3.3" #define CONFIG_ARDUINO_IDF_BRANCH "release/v3.3"

View File

@ -263,6 +263,16 @@ esp_err_t esp_mesh_set_announce_interval(int short_ms, int long_ms);
*/ */
esp_err_t esp_mesh_get_announce_interval(int *short_ms, int *long_ms); esp_err_t esp_mesh_get_announce_interval(int *short_ms, int *long_ms);
/**
* @brief Enable mesh print scan result
*
* @param[in] enable enable or not
*
* @return
* - ESP_OK
*/
esp_err_t esp_mesh_print_scan_result(bool enable);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -20,6 +20,7 @@ extern "C"
#ifndef __ASSEMBLER__ #ifndef __ASSEMBLER__
#include "esp_err.h" #include "esp_err.h"
#include "soc/soc.h"
/** /**
@ -61,12 +62,36 @@ esp_err_t esp_set_watchpoint(int no, void *adr, int size, int flags);
*/ */
void esp_clear_watchpoint(int no); void esp_clear_watchpoint(int no);
/**
* @brief Checks stack pointer in dram
*/
inline static bool esp_stack_ptr_in_dram(uint32_t sp)
{
//Check if stack ptr is in between SOC_DRAM_LOW and SOC_DRAM_HIGH, and 16 byte aligned.
return !(sp < SOC_DRAM_LOW + 0x10 || sp > SOC_DRAM_HIGH - 0x10 || ((sp & 0xF) != 0));
}
#if CONFIG_SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY
/**
* @brief Checks stack pointer in external ram
*/
inline static bool esp_stack_ptr_in_extram(uint32_t sp)
{
//Check if stack ptr is in between SOC_EXTRAM_DATA_LOW and SOC_EXTRAM_DATA_HIGH, and 16 byte aligned.
return !(sp < SOC_EXTRAM_DATA_LOW + 0x10 || sp > SOC_EXTRAM_DATA_HIGH - 0x10 || ((sp & 0xF) != 0));
}
#endif
/** /**
* @brief Checks stack pointer * @brief Checks stack pointer
*/ */
static inline bool esp_stack_ptr_is_sane(uint32_t sp) static inline bool esp_stack_ptr_is_sane(uint32_t sp)
{ {
return !(sp < 0x3ffae010UL || sp > 0x3ffffff0UL || ((sp & 0xf) != 0)); #if CONFIG_SPIRAM_ALLOW_STACK_EXTERNAL_MEMORY
return (esp_stack_ptr_in_dram(sp) || esp_stack_ptr_in_extram(sp));
#else
return esp_stack_ptr_in_dram(sp);
#endif
} }
#endif #endif

View File

@ -396,6 +396,17 @@
*/ */
#define LWIP_TCP_RTO_TIME CONFIG_LWIP_TCP_RTO_TIME #define LWIP_TCP_RTO_TIME CONFIG_LWIP_TCP_RTO_TIME
/**
* Set TCP hook for Initial Sequence Number (ISN)
*/
#ifdef CONFIG_LWIP_TCP_ISN_HOOK
#include <lwip/arch.h>
struct ip_addr;
u32_t lwip_hook_tcp_isn(const struct ip_addr *local_ip, u16_t local_port,
const struct ip_addr *remote_ip, u16_t remote_port);
#define LWIP_HOOK_TCP_ISN lwip_hook_tcp_isn
#endif
/* /*
---------------------------------- ----------------------------------
---------- Pbuf options ---------- ---------- Pbuf options ----------

View File

@ -32,9 +32,17 @@
#include "lwip/netdb.h" #include "lwip/netdb.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef ESP_PLATFORM #ifdef ESP_PLATFORM
int getnameinfo(const struct sockaddr *addr, socklen_t addrlen, int getnameinfo(const struct sockaddr *addr, socklen_t addrlen,
char *host, socklen_t hostlen, char *host, socklen_t hostlen,
char *serv, socklen_t servlen, int flags); char *serv, socklen_t servlen, int flags);
#endif #endif
#ifdef __cplusplus
}
#endif

View File

@ -0,0 +1,48 @@
/*
* Copyright (c) 2016 The MINIX 3 Project.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
* OF SUCH DAMAGE.
*
* Author: David van Moolenbroek <david@minix3.org>
*/
#ifndef LWIP_TCP_ISN_H
#define LWIP_TCP_ISN_H
#include "lwip/opt.h"
#include "lwip/ip_addr.h"
#ifdef __cplusplus
extern "C" {
#endif
void lwip_init_tcp_isn(u32_t boot_time, const u8_t *secret_16_bytes);
u32_t lwip_hook_tcp_isn(const ip_addr_t *local_ip, u16_t local_port,
const ip_addr_t *remote_ip, u16_t remote_port);
#ifdef __cplusplus
}
#endif
#endif /* LWIP_TCP_ISN_H */

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -457,8 +457,8 @@ CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_1=
CONFIG_ESP32_WIFI_SOFTAP_BEACON_MAX_LEN=752 CONFIG_ESP32_WIFI_SOFTAP_BEACON_MAX_LEN=752
CONFIG_ESP32_WIFI_MGMT_SBUF_NUM=32 CONFIG_ESP32_WIFI_MGMT_SBUF_NUM=32
CONFIG_ESP32_WIFI_DEBUG_LOG_ENABLE= CONFIG_ESP32_WIFI_DEBUG_LOG_ENABLE=
CONFIG_ESP32_WIFI_IRAM_OPT=y CONFIG_ESP32_WIFI_IRAM_OPT=
CONFIG_ESP32_WIFI_RX_IRAM_OPT=y CONFIG_ESP32_WIFI_RX_IRAM_OPT=
# #
# PHY # PHY
@ -690,6 +690,7 @@ CONFIG_LWIP_LOOPBACK_MAX_PBUFS=8
# #
# TCP # TCP
# #
CONFIG_LWIP_TCP_ISN_HOOK=y
CONFIG_LWIP_MAX_ACTIVE_TCP=16 CONFIG_LWIP_MAX_ACTIVE_TCP=16
CONFIG_LWIP_MAX_LISTENING_TCP=16 CONFIG_LWIP_MAX_LISTENING_TCP=16
CONFIG_TCP_MAXRTX=12 CONFIG_TCP_MAXRTX=12

View File

@ -13,6 +13,7 @@
static const uint8_t LED_BUILTIN = -1; static const uint8_t LED_BUILTIN = -1;
#define BUILTIN_LED LED_BUILTIN // backward compatibility #define BUILTIN_LED LED_BUILTIN // backward compatibility
#define LED_BUILTIN LED_BUILTIN
#define MTDO 15 #define MTDO 15
#define MTDI 12 #define MTDI 12

View File

@ -14,6 +14,7 @@
static const uint8_t LED_BUILTIN = 2; static const uint8_t LED_BUILTIN = 2;
static const uint8_t LED_BUILTINB = 4; static const uint8_t LED_BUILTINB = 4;
#define BUILTIN_LED LED_BUILTIN // backward compatibility #define BUILTIN_LED LED_BUILTIN // backward compatibility
#define LED_BUILTIN LED_BUILTIN
#define BUILTIN_LED2 LED_BUILTINB #define BUILTIN_LED2 LED_BUILTINB
static const uint8_t TX = 1; static const uint8_t TX = 1;

View File

@ -15,6 +15,7 @@
static const uint8_t LED_BUILTIN = 23; static const uint8_t LED_BUILTIN = 23;
#define BUILTIN_LED LED_BUILTIN // backward compatibility #define BUILTIN_LED LED_BUILTIN // backward compatibility
#define LED_BUILTIN LED_BUILTIN
static const uint8_t TX = 1; static const uint8_t TX = 1;
static const uint8_t RX = 3; static const uint8_t RX = 3;

Some files were not shown because too many files have changed in this diff Show More