Skip to content

Commit 25d6cc2

Browse files
authored
Merge branch 'espressif:master' into master
2 parents fd739d9 + a9d77ac commit 25d6cc2

File tree

41 files changed

+350
-182
lines changed

Some content is hidden

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

41 files changed

+350
-182
lines changed

.github/ISSUE_TEMPLATE/Issue-report.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ body:
4141
options:
4242
- latest master (checkout manually)
4343
- latest development Release Candidate (RC-X)
44+
- v2.0.3
4445
- v2.0.2
4546
- v2.0.1
4647
- v2.0.0
@@ -129,4 +130,4 @@ body:
129130
description: You agree to check all the resources above before opening a new issue.
130131
options:
131132
- label: I confirm I have checked existing issues, online documentation and Troubleshooting guide.
132-
required: true
133+
required: true

.github/workflows/hil.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,9 @@ jobs:
110110

111111
event_file:
112112
name: "Event File"
113-
if: ${{ always() }}
113+
if: |
114+
contains(github.event.pull_request.labels.*.name, 'hil_test') ||
115+
github.event_name == 'schedule'
114116
needs: Test
115117
runs-on: ubuntu-latest
116118
steps:

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ set(LIBRARY_SRCS
9595
libraries/RainMaker/src/RMakerParam.cpp
9696
libraries/RainMaker/src/RMakerDevice.cpp
9797
libraries/RainMaker/src/RMakerType.cpp
98+
libraries/RainMaker/src/RMakerQR.cpp
99+
libraries/RainMaker/src/RMakerUtils.cpp
98100
libraries/SD_MMC/src/SD_MMC.cpp
99101
libraries/SD/src/SD.cpp
100102
libraries/SD/src/sd_diskio.cpp

boards.txt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4314,6 +4314,28 @@ nina_w10.menu.UploadSpeed.460800.upload.speed=460800
43144314
nina_w10.menu.UploadSpeed.512000.windows=512000
43154315
nina_w10.menu.UploadSpeed.512000.upload.speed=512000
43164316

4317+
nina_w10.menu.FlashSize.2M=2MB (16Mb, NINA-W101/W102)
4318+
nina_w10.menu.FlashSize.2M.build.flash_size=2MB
4319+
nina_w10.menu.FlashSize.4M=4MB (32Mb, NINA-W106-00B)
4320+
nina_w10.menu.FlashSize.4M.build.flash_size=4MB
4321+
nina_w10.menu.FlashSize.8M=8MB (64Mb, NINA-W106-10B)
4322+
nina_w10.menu.FlashSize.8M.build.flash_size=8MB
4323+
4324+
nina_w10.menu.FlashFreq.80=80MHz
4325+
nina_w10.menu.FlashFreq.80.build.flash_freq=80m
4326+
nina_w10.menu.FlashFreq.40=40MHz
4327+
nina_w10.menu.FlashFreq.40.build.flash_freq=40m
4328+
4329+
nina_w10.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (1.9MB APP with OTA/190KB SPIFFS)
4330+
nina_w10.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs
4331+
nina_w10.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080
4332+
nina_w10.menu.PartitionScheme.default=Default (3MB No OTA/1MB SPIFFS)
4333+
nina_w10.menu.PartitionScheme.default.build.partitions=huge_app
4334+
nina_w10.menu.PartitionScheme.default.upload.maximum_size=3145728
4335+
nina_w10.menu.PartitionScheme.no_ota=No OTA (2MB APP/2MB SPIFFS)
4336+
nina_w10.menu.PartitionScheme.no_ota.build.partitions=no_ota
4337+
nina_w10.menu.PartitionScheme.no_ota.upload.maximum_size=2097152
4338+
43174339
nina_w10.menu.DebugLevel.none=None
43184340
nina_w10.menu.DebugLevel.none.build.code_debug=0
43194341
nina_w10.menu.DebugLevel.error=Error

cores/esp32/Arduino.h

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,12 @@
6969
#define __STRINGIFY(a) #a
7070
#endif
7171

72+
// can't define max() / min() because of conflicts with C++
73+
#define _min(a,b) ((a)<(b)?(a):(b))
74+
#define _max(a,b) ((a)>(b)?(a):(b))
75+
#define _abs(x) ((x)>0?(x):-(x)) // abs() comes from STL
7276
#define constrain(amt,low,high) ((amt)<(low)?(low):((amt)>(high)?(high):(amt)))
77+
#define _round(x) ((x)>=0?(long)((x)+0.5):(long)((x)-0.5)) // round() comes from STL
7378
#define radians(deg) ((deg)*DEG_TO_RAD)
7479
#define degrees(rad) ((rad)*RAD_TO_DEG)
7580
#define sq(x) ((x)*(x))
@@ -89,6 +94,7 @@
8994
#define bitRead(value, bit) (((value) >> (bit)) & 0x01)
9095
#define bitSet(value, bit) ((value) |= (1UL << (bit)))
9196
#define bitClear(value, bit) ((value) &= ~(1UL << (bit)))
97+
#define bitToggle(value, bit) ((value) ^= (1UL << (bit)))
9298
#define bitWrite(value, bit, bitvalue) ((bitvalue) ? bitSet(value, bit) : bitClear(value, bit))
9399

94100
// avr-libc defines _NOP() since 1.6.2
@@ -168,12 +174,13 @@ void shiftOut(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder, uint8_t val);
168174
#include "Esp.h"
169175
#include "esp32/spiram.h"
170176

177+
// Use float-compatible stl abs() and round(), we don't use Arduino macros to avoid issues with the C++ libraries
171178
using std::abs;
172179
using std::isinf;
173180
using std::isnan;
174181
using std::max;
175182
using std::min;
176-
using ::round;
183+
using std::round;
177184

178185
uint16_t makeWord(uint16_t w);
179186
uint16_t makeWord(uint8_t h, uint8_t l);
@@ -203,9 +210,6 @@ void noTone(uint8_t _pin);
203210
long random(long);
204211
#endif /* __cplusplus */
205212

206-
#define _min(a,b) ((a)<(b)?(a):(b))
207-
#define _max(a,b) ((a)>(b)?(a):(b))
208-
209213
#include "pins_arduino.h"
210214

211215
#endif /* _ESP32_CORE_ARDUINO_H_ */

cores/esp32/Tone.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ static void tone_task(void*){
2828
xQueueReceive(_tone_queue, &tone_msg, portMAX_DELAY);
2929
switch(tone_msg.tone_cmd){
3030
case TONE_START:
31-
log_d("Task received from queue TONE_START: _pin=%d, frequency=%u Hz, duration=%u ms", tone_msg.pin, tone_msg.frequency, tone_msg.duration);
31+
log_d("Task received from queue TONE_START: _pin=%d, frequency=%u Hz, duration=%lu ms", tone_msg.pin, tone_msg.frequency, tone_msg.duration);
3232

3333
log_d("Setup LED controll on channel %d", _channel);
3434
// ledcSetup(_channel, tone_msg.frequency, 11);
@@ -118,7 +118,7 @@ void noTone(uint8_t _pin){
118118
// duration - time in ms - how long will the signal be outputted.
119119
// If not provided, or 0 you must manually call noTone to end output
120120
void tone(uint8_t _pin, unsigned int frequency, unsigned long duration){
121-
log_d("_pin=%d, frequency=%u Hz, duration=%u ms", _pin, frequency, duration);
121+
log_d("_pin=%d, frequency=%u Hz, duration=%lu ms", _pin, frequency, duration);
122122
if(tone_init()){
123123
tone_msg_t tone_msg = {
124124
.tone_cmd = TONE_START,

cores/esp32/esp32-hal-cpu.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ bool addApbChangeCallback(void * arg, apb_change_cb_t cb){
107107
// look for duplicate callbacks
108108
while( (r != NULL ) && !((r->cb == cb) && ( r->arg == arg))) r = r->next;
109109
if (r) {
110-
log_e("duplicate func=%08X arg=%08X",c->cb,c->arg);
110+
log_e("duplicate func=%8p arg=%8p",c->cb,c->arg);
111111
free(c);
112112
xSemaphoreGive(apb_change_lock);
113113
return false;
@@ -129,7 +129,7 @@ bool removeApbChangeCallback(void * arg, apb_change_cb_t cb){
129129
// look for matching callback
130130
while( (r != NULL ) && !((r->cb == cb) && ( r->arg == arg))) r = r->next;
131131
if ( r == NULL ) {
132-
log_e("not found func=%08X arg=%08X",cb,arg);
132+
log_e("not found func=%8p arg=%8p",cb,arg);
133133
xSemaphoreGive(apb_change_lock);
134134
return false;
135135
}

cores/esp32/esp32-hal-gpio.c

Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -91,30 +91,34 @@ static InterruptHandle_t __pinInterruptHandlers[SOC_GPIO_PIN_COUNT] = {0,};
9191

9292
extern void ARDUINO_ISR_ATTR __pinMode(uint8_t pin, uint8_t mode)
9393
{
94-
if (!GPIO_IS_VALID_GPIO(pin)) {
94+
if (!GPIO_IS_VALID_GPIO(pin)) {
9595
log_e("Invalid pin selected");
96-
return;
97-
}
98-
gpio_config_t conf = {
99-
.pin_bit_mask = (1ULL<<pin), /*!< GPIO pin: set with bit mask, each bit maps to a GPIO */
100-
.mode = GPIO_MODE_DISABLE, /*!< GPIO mode: set input/output mode */
101-
.pull_up_en = GPIO_PULLUP_DISABLE, /*!< GPIO pull-up */
102-
.pull_down_en = GPIO_PULLDOWN_DISABLE, /*!< GPIO pull-down */
103-
.intr_type = GPIO_INTR_DISABLE /*!< GPIO interrupt type */
104-
};
105-
if (mode < 0x20) {//io
106-
conf.mode = mode & (INPUT | OUTPUT);
107-
if (mode & OPEN_DRAIN) {
108-
conf.mode |= GPIO_MODE_DEF_OD;
109-
}
110-
if (mode & PULLUP) {
111-
conf.pull_up_en = GPIO_PULLUP_ENABLE;
112-
}
113-
if (mode & PULLDOWN) {
114-
conf.pull_down_en = GPIO_PULLDOWN_ENABLE;
115-
}
116-
}
117-
if(gpio_config(&conf) != ESP_OK)
96+
return;
97+
}
98+
99+
gpio_hal_context_t gpiohal;
100+
gpiohal.dev = GPIO_LL_GET_HW(GPIO_PORT_0);
101+
102+
gpio_config_t conf = {
103+
.pin_bit_mask = (1ULL<<pin), /*!< GPIO pin: set with bit mask, each bit maps to a GPIO */
104+
.mode = GPIO_MODE_DISABLE, /*!< GPIO mode: set input/output mode */
105+
.pull_up_en = GPIO_PULLUP_DISABLE, /*!< GPIO pull-up */
106+
.pull_down_en = GPIO_PULLDOWN_DISABLE, /*!< GPIO pull-down */
107+
.intr_type = gpiohal.dev->pin[pin].int_type /*!< GPIO interrupt type - previously set */
108+
};
109+
if (mode < 0x20) {//io
110+
conf.mode = mode & (INPUT | OUTPUT);
111+
if (mode & OPEN_DRAIN) {
112+
conf.mode |= GPIO_MODE_DEF_OD;
113+
}
114+
if (mode & PULLUP) {
115+
conf.pull_up_en = GPIO_PULLUP_ENABLE;
116+
}
117+
if (mode & PULLDOWN) {
118+
conf.pull_down_en = GPIO_PULLDOWN_ENABLE;
119+
}
120+
}
121+
if(gpio_config(&conf) != ESP_OK)
118122
{
119123
log_e("GPIO config failed");
120124
return;

cores/esp32/esp32-hal-i2c-slave.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,6 @@ static void i2c_slave_isr_handler(void* arg)
695695
uint32_t activeInt = i2c_ll_get_intsts_mask(i2c->dev);
696696
i2c_ll_clr_intsts_mask(i2c->dev, activeInt);
697697
uint8_t rx_fifo_len = i2c_ll_get_rxfifo_cnt(i2c->dev);
698-
uint8_t tx_fifo_len = SOC_I2C_FIFO_LEN - i2c_ll_get_txfifo_len(i2c->dev);
699698
bool slave_rw = i2c_ll_slave_rw(i2c->dev);
700699

701700
if(activeInt & I2C_RXFIFO_WM_INT_ENA){ // RX FiFo Full

cores/esp32/esp32-hal-timer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ typedef struct hw_timer_s
4747

4848
// Works for all chips
4949
static hw_timer_t timer_dev[4] = {
50-
{0,0}, {1,0}, {1,0}, {1,1}
50+
{0,0}, {1,0}, {0,1}, {1,1}
5151
};
5252

5353
// NOTE: (in IDF 5.0 there wont be need to know groups/numbers

cores/esp32/esp32-hal-tinyusb.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -646,8 +646,9 @@ static void usb_device_task(void *param) {
646646
/*
647647
* PUBLIC API
648648
* */
649-
static const char *tinyusb_interface_names[USB_INTERFACE_MAX] = {"MSC", "DFU", "HID", "VENDOR", "CDC", "MIDI", "CUSTOM"};
650-
649+
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_ERROR
650+
const char *tinyusb_interface_names[USB_INTERFACE_MAX] = {"MSC", "DFU", "HID", "VENDOR", "CDC", "MIDI", "CUSTOM"};
651+
#endif
651652
static bool tinyusb_is_initialized = false;
652653

653654
esp_err_t tinyusb_enable_interface(tinyusb_interface_t interface, uint16_t descriptor_len, tinyusb_descriptor_cb_t cb)

cores/esp32/esp32-hal-uart.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -538,8 +538,6 @@ void uartStartDetectBaudrate(uart_t *uart) {
538538
return;
539539
}
540540

541-
uart_dev_t *hw = UART_LL_GET_HW(uart->num);
542-
543541
#ifdef CONFIG_IDF_TARGET_ESP32C3
544542

545543
// ESP32-C3 requires further testing
@@ -555,6 +553,7 @@ void uartStartDetectBaudrate(uart_t *uart) {
555553
//hw->conf0.autobaud_en = 1;
556554
#elif CONFIG_IDF_TARGET_ESP32S3
557555
#else
556+
uart_dev_t *hw = UART_LL_GET_HW(uart->num);
558557
hw->auto_baud.glitch_filt = 0x08;
559558
hw->auto_baud.en = 0;
560559
hw->auto_baud.en = 1;
@@ -571,7 +570,6 @@ uartDetectBaudrate(uart_t *uart)
571570
#ifndef CONFIG_IDF_TARGET_ESP32C3 // ESP32-C3 requires further testing - Baud rate detection returns wrong values
572571

573572
static bool uartStateDetectingBaudrate = false;
574-
uart_dev_t *hw = UART_LL_GET_HW(uart->num);
575573

576574
if(!uartStateDetectingBaudrate) {
577575
uartStartDetectBaudrate(uart);
@@ -592,6 +590,7 @@ uartDetectBaudrate(uart_t *uart)
592590
//hw->conf0.autobaud_en = 0;
593591
#elif CONFIG_IDF_TARGET_ESP32S3
594592
#else
593+
uart_dev_t *hw = UART_LL_GET_HW(uart->num);
595594
hw->auto_baud.en = 0;
596595
#endif
597596
uartStateDetectingBaudrate = false; // Initialize for the next round

libraries/BluetoothSerial/src/BluetoothSerial.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -973,10 +973,12 @@ bool BluetoothSerial::connect(uint8_t remoteAddress[], int channel, esp_spp_sec_
973973
log_i("master : remoteAddress");
974974
xEventGroupClearBits(_spp_event_group, SPP_CLOSED);
975975
if (channel > 0) {
976+
#if (ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_INFO)
976977
char bda_str[18];
977978
log_i("spp connect to remote %s channel %d",
978979
bda2str(_peer_bd_addr, bda_str, sizeof(bda_str)),
979980
channel);
981+
#endif
980982
if(esp_spp_connect(sec_mask, role, channel, _peer_bd_addr) != ESP_OK ) {
981983
log_e("spp connect failed");
982984
return false;

libraries/DNSServer/src/DNSServer.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,22 @@ DNSServer::DNSServer()
2020
_port = 0;
2121
}
2222

23+
DNSServer::~DNSServer()
24+
{
25+
if (_dnsHeader) {
26+
free(_dnsHeader);
27+
_dnsHeader = NULL;
28+
}
29+
if (_dnsQuestion) {
30+
free(_dnsQuestion);
31+
_dnsQuestion = NULL;
32+
}
33+
if (_buffer) {
34+
free(_buffer);
35+
_buffer = NULL;
36+
}
37+
}
38+
2339
bool DNSServer::start(const uint16_t &port, const String &domainName,
2440
const IPAddress &resolvedIP)
2541
{

libraries/DNSServer/src/DNSServer.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ class DNSServer
7676
{
7777
public:
7878
DNSServer();
79+
~DNSServer();
7980
void processNextRequest();
8081
void setErrorReplyCode(const DNSReplyCode &replyCode);
8182
void setTTL(const uint32_t &ttl);

0 commit comments

Comments
 (0)