Skip to content

Commit e4e0a4c

Browse files
author
Jason2866
committed
Release 2.0.1
1 parent 5f30bab commit e4e0a4c

File tree

94 files changed

+2850
-126
lines changed

Some content is hidden

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

94 files changed

+2850
-126
lines changed

CMakeLists.txt

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,27 @@
1+
# Check ESP-IDF version and error out if it is not in the supported range.
2+
#
3+
# Note for arduino-esp32 developers: to bypass the version check locally,
4+
# set ARDUINO_SKIP_IDF_VERSION_CHECK environment variable to 1. For example:
5+
# export ARDUINO_SKIP_IDF_VERSION_CHECK=1
6+
# idf.py build
7+
8+
set(min_supported_idf_version "4.4.0")
9+
set(max_supported_idf_version "4.4.99")
10+
set(idf_version "${IDF_VERSION_MAJOR}.${IDF_VERSION_MINOR}.${IDF_VERSION_PATCH}")
11+
12+
if ("${idf_version}" AND NOT "$ENV{ARDUINO_SKIP_IDF_VERSION_CHECK}")
13+
if (idf_version VERSION_LESS min_supported_idf_version)
14+
message(FATAL_ERROR "Arduino-esp32 can be used with ESP-IDF versions "
15+
"between ${min_supported_idf_version} and ${max_supported_idf_version}, "
16+
"but an older version is detected: ${idf_version}.")
17+
endif()
18+
if (idf_version VERSION_GREATER max_supported_idf_version)
19+
message(FATAL_ERROR "Arduino-esp32 can be used with ESP-IDF versions "
20+
"between ${min_supported_idf_version} and ${max_supported_idf_version}, "
21+
"but a newer version is detected: ${idf_version}.")
22+
endif()
23+
endif()
24+
125
set(CORE_SRCS
226
cores/esp32/base64.cpp
327
cores/esp32/cbuf.cpp

README.md

Lines changed: 2 additions & 13 deletions

cores/esp32/core_version.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#define ARDUINO_ESP32_GIT_VER 0xa443b816
2-
#define ARDUINO_ESP32_GIT_DESC 2.0.1.rc2
3-
#define ARDUINO_ESP32_RELEASE_2_0_1_rc2
4-
#define ARDUINO_ESP32_RELEASE "2_0_1_rc2"
2+
#define ARDUINO_ESP32_GIT_DESC 2.0.1
3+
#define ARDUINO_ESP32_RELEASE_2_0_1
4+
#define ARDUINO_ESP32_RELEASE "2_0_1"

cores/esp32/esp32-hal-ledc.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "freertos/task.h"
1818
#include "freertos/semphr.h"
1919
#include "esp32-hal-matrix.h"
20+
#include "soc/soc_caps.h"
2021
#include "soc/ledc_reg.h"
2122
#include "soc/ledc_struct.h"
2223
#include "driver/periph_ctrl.h"
@@ -331,3 +332,21 @@ double ledcChangeFrequency(uint8_t chan, double freq, uint8_t bit_num)
331332
double res_freq = _ledcSetupTimerFreq(chan, freq, bit_num);
332333
return res_freq;
333334
}
335+
336+
static int8_t pin_to_channel[SOC_GPIO_PIN_COUNT] = { 0 };
337+
static int cnt_channel = SOC_LEDC_CHANNEL_NUM;
338+
void analogWrite(uint8_t pin, int value) {
339+
// Use ledc hardware for internal pins
340+
if (pin < SOC_GPIO_PIN_COUNT) {
341+
if (pin_to_channel[pin] == 0) {
342+
if (!cnt_channel) {
343+
log_e("No more analogWrite channels available! You can have maximum %u", SOC_LEDC_CHANNEL_NUM);
344+
return;
345+
}
346+
pin_to_channel[pin] = cnt_channel--;
347+
ledcAttachPin(pin, cnt_channel);
348+
ledcSetup(cnt_channel, 1000, 8);
349+
}
350+
ledcWrite(pin_to_channel[pin] - 1, value);
351+
}
352+
}

cores/esp32/esp32-hal.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ void yield(void);
9090
#include "esp32-hal-psram.h"
9191
#include "esp32-hal-cpu.h"
9292

93+
void analogWrite(uint8_t pin, int value);
94+
9395
//returns chip temperature in Celsius
9496
float temperatureRead();
9597

libraries/Ethernet/src/ETH.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,10 @@ bool ETHClass::begin(uint8_t phy_addr, int power, int mdc, int mdio, eth_phy_typ
368368
log_e("esp_eth_init error: %d", err);
369369
}
370370
#endif
371+
// holds a few microseconds to let DHCP start and enter into a good state
372+
// FIX ME -- adresses issue https://github.com/espressif/arduino-esp32/issues/5733
373+
delay(50);
374+
371375
return true;
372376
}
373377

@@ -396,7 +400,8 @@ bool ETHClass::config(IPAddress local_ip, IPAddress gateway, IPAddress subnet, I
396400
if(err != ERR_OK){
397401
log_e("STA IP could not be configured! Error: %d", err);
398402
return false;
399-
}
403+
}
404+
400405
if(info.ip.addr){
401406
staticIP = true;
402407
} else {

libraries/Wire/src/Wire.cpp

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -447,32 +447,40 @@ void TwoWire::flush(void)
447447

448448
uint8_t TwoWire::requestFrom(uint8_t address, uint8_t quantity, uint8_t sendStop)
449449
{
450-
return requestFrom(static_cast<uint16_t>(address), static_cast<size_t>(quantity), static_cast<bool>(sendStop));
450+
return requestFrom(static_cast<uint16_t>(address), static_cast<uint8_t>(quantity), static_cast<bool>(sendStop));
451451
}
452452

453453
uint8_t TwoWire::requestFrom(uint16_t address, uint8_t quantity, uint8_t sendStop)
454454
{
455-
return requestFrom(address, static_cast<size_t>(quantity), static_cast<bool>(sendStop));
455+
return requestFrom(address, static_cast<uint8_t>(quantity), static_cast<bool>(sendStop));
456+
}
457+
458+
/* Added to match the Arduino function definition: https://github.com/arduino/ArduinoCore-API/blob/173e8eadced2ad32eeb93bcbd5c49f8d6a055ea6/api/HardwareI2C.h#L39
459+
* See: https://github.com/arduino-libraries/ArduinoECCX08/issues/25
460+
*/
461+
size_t TwoWire::requestFrom(uint8_t address, size_t len, bool stopBit)
462+
{
463+
return requestFrom((uint16_t)address, (uint8_t)len, stopBit);
456464
}
457465

458466
uint8_t TwoWire::requestFrom(uint8_t address, uint8_t quantity)
459467
{
460-
return requestFrom(static_cast<uint16_t>(address), static_cast<size_t>(quantity), true);
468+
return requestFrom(static_cast<uint16_t>(address), static_cast<uint8_t>(quantity), true);
461469
}
462470

463471
uint8_t TwoWire::requestFrom(uint16_t address, uint8_t quantity)
464472
{
465-
return requestFrom(address, static_cast<size_t>(quantity), true);
473+
return requestFrom(address, static_cast<uint8_t>(quantity), true);
466474
}
467475

468476
uint8_t TwoWire::requestFrom(int address, int quantity)
469477
{
470-
return requestFrom(static_cast<uint16_t>(address), static_cast<size_t>(quantity), true);
478+
return requestFrom(static_cast<uint16_t>(address), static_cast<uint8_t>(quantity), true);
471479
}
472480

473481
uint8_t TwoWire::requestFrom(int address, int quantity, int sendStop)
474482
{
475-
return static_cast<uint8_t>(requestFrom(static_cast<uint16_t>(address), static_cast<size_t>(quantity), static_cast<bool>(sendStop)));
483+
return static_cast<uint8_t>(requestFrom(static_cast<uint16_t>(address), static_cast<uint8_t>(quantity), static_cast<bool>(sendStop)));
476484
}
477485

478486
void TwoWire::beginTransmission(int address)

libraries/Wire/src/Wire.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ class TwoWire: public Stream
9595

9696
uint8_t requestFrom(uint16_t address, uint8_t size, bool sendStop);
9797
uint8_t requestFrom(uint16_t address, uint8_t size, uint8_t sendStop);
98+
size_t requestFrom(uint8_t address, size_t len, bool stopBit);
9899
uint8_t requestFrom(uint16_t address, uint8_t size);
99100
uint8_t requestFrom(uint8_t address, uint8_t size, uint8_t sendStop);
100101
uint8_t requestFrom(uint8_t address, uint8_t size);

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "framework-arduinoespressif32",
33
"description": "Arduino Wiring-based Framework (ESP32 Core) for Tasmota",
4-
"version": "2.0.1+rc2",
4+
"version": "2.0.1",
55
"url": "https://github.com/tasmota/arduino-esp32"
66
}

platform.txt

Lines changed: 7 additions & 7 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)