Skip to content

Commit 9c21886

Browse files
Merge branch 'master' into wokwi-python-client
2 parents c49aea4 + 8fa9149 commit 9c21886

File tree

45 files changed

+568
-187
lines changed

Some content is hidden

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

45 files changed

+568
-187
lines changed

boards.txt

Lines changed: 211 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51982,3 +51982,214 @@ fobe_quill_esp32s3_mesh.menu.ZigbeeMode.zczr.build.zigbee_mode=-DZIGBEE_MODE_ZCZ
5198251982
fobe_quill_esp32s3_mesh.menu.ZigbeeMode.zczr.build.zigbee_libs=-lesp_zb_api.zczr -lzboss_stack.zczr -lzboss_port.remote
5198351983

5198451984
##############################################################
51985+
51986+
twinaiot.name=Twin AIoT Module
51987+
51988+
twinaiot.bootloader.tool=esptool_py
51989+
twinaiot.bootloader.tool.default=esptool_py
51990+
51991+
twinaiot.upload.tool=esptool_py
51992+
twinaiot.upload.tool.default=esptool_py
51993+
twinaiot.upload.tool.network=esp_ota
51994+
51995+
twinaiot.upload.maximum_size=1310720
51996+
twinaiot.upload.maximum_data_size=327680
51997+
twinaiot.upload.use_1200bps_touch=false
51998+
twinaiot.upload.wait_for_upload_port=false
51999+
52000+
twinaiot.serial.disableDTR=false
52001+
twinaiot.serial.disableRTS=false
52002+
52003+
twinaiot.build.tarch=xtensa
52004+
twinaiot.build.bootloader_addr=0x0
52005+
twinaiot.build.target=esp32s3
52006+
twinaiot.build.mcu=esp32s3
52007+
twinaiot.build.core=esp32
52008+
twinaiot.build.variant=twinaiot
52009+
twinaiot.build.board=TWIN_AIOT
52010+
52011+
twinaiot.build.usb_mode=1
52012+
twinaiot.build.cdc_on_boot=0
52013+
twinaiot.build.msc_on_boot=0
52014+
twinaiot.build.dfu_on_boot=0
52015+
twinaiot.build.f_cpu=240000000L
52016+
twinaiot.build.flash_size=4MB
52017+
twinaiot.build.flash_freq=80m
52018+
twinaiot.build.flash_mode=dio
52019+
twinaiot.build.boot=qio
52020+
twinaiot.build.boot_freq=80m
52021+
twinaiot.build.partitions=default
52022+
twinaiot.build.defines=
52023+
twinaiot.build.loop_core=
52024+
twinaiot.build.event_core=
52025+
twinaiot.build.psram_type=qspi
52026+
twinaiot.build.memory_type={build.boot}_{build.psram_type}
52027+
52028+
twinaiot.menu.JTAGAdapter.default=Disabled
52029+
twinaiot.menu.JTAGAdapter.default.build.copy_jtag_files=0
52030+
twinaiot.menu.JTAGAdapter.builtin=Integrated USB JTAG
52031+
twinaiot.menu.JTAGAdapter.builtin.build.openocdscript=esp32s3-builtin.cfg
52032+
twinaiot.menu.JTAGAdapter.builtin.build.copy_jtag_files=1
52033+
twinaiot.menu.JTAGAdapter.external=FTDI Adapter
52034+
twinaiot.menu.JTAGAdapter.external.build.openocdscript=esp32s3-ftdi.cfg
52035+
twinaiot.menu.JTAGAdapter.external.build.copy_jtag_files=1
52036+
twinaiot.menu.JTAGAdapter.bridge=ESP USB Bridge
52037+
twinaiot.menu.JTAGAdapter.bridge.build.openocdscript=esp32s3-bridge.cfg
52038+
twinaiot.menu.JTAGAdapter.bridge.build.copy_jtag_files=1
52039+
52040+
twinaiot.menu.PSRAM.disabled=Disabled
52041+
twinaiot.menu.PSRAM.disabled.build.defines=
52042+
twinaiot.menu.PSRAM.disabled.build.psram_type=qspi
52043+
twinaiot.menu.PSRAM.enabled=QSPI PSRAM
52044+
twinaiot.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM
52045+
twinaiot.menu.PSRAM.enabled.build.psram_type=qspi
52046+
52047+
twinaiot.menu.FlashMode.qio=QIO 80MHz
52048+
twinaiot.menu.FlashMode.qio.build.flash_mode=dio
52049+
twinaiot.menu.FlashMode.qio.build.boot=qio
52050+
twinaiot.menu.FlashMode.qio.build.boot_freq=80m
52051+
twinaiot.menu.FlashMode.qio.build.flash_freq=80m
52052+
twinaiot.menu.FlashMode.qio120=QIO 120MHz
52053+
twinaiot.menu.FlashMode.qio120.build.flash_mode=dio
52054+
twinaiot.menu.FlashMode.qio120.build.boot=qio
52055+
twinaiot.menu.FlashMode.qio120.build.boot_freq=120m
52056+
twinaiot.menu.FlashMode.qio120.build.flash_freq=80m
52057+
twinaiot.menu.FlashMode.dio=DIO 80MHz
52058+
twinaiot.menu.FlashMode.dio.build.flash_mode=dio
52059+
twinaiot.menu.FlashMode.dio.build.boot=dio
52060+
twinaiot.menu.FlashMode.dio.build.boot_freq=80m
52061+
twinaiot.menu.FlashMode.dio.build.flash_freq=80m
52062+
52063+
52064+
twinaiot.menu.FlashSize.4M=4MB (32Mb)
52065+
twinaiot.menu.FlashSize.4M.build.flash_size=4MB
52066+
52067+
twinaiot.menu.CPUFreq.240=240MHz (WiFi)
52068+
twinaiot.menu.CPUFreq.240.build.f_cpu=240000000L
52069+
twinaiot.menu.CPUFreq.160=160MHz (WiFi)
52070+
twinaiot.menu.CPUFreq.160.build.f_cpu=160000000L
52071+
twinaiot.menu.CPUFreq.80=80MHz (WiFi)
52072+
twinaiot.menu.CPUFreq.80.build.f_cpu=80000000L
52073+
twinaiot.menu.CPUFreq.40=40MHz
52074+
twinaiot.menu.CPUFreq.40.build.f_cpu=40000000L
52075+
twinaiot.menu.CPUFreq.20=20MHz
52076+
twinaiot.menu.CPUFreq.20.build.f_cpu=20000000L
52077+
twinaiot.menu.CPUFreq.10=10MHz
52078+
twinaiot.menu.CPUFreq.10.build.f_cpu=10000000L
52079+
52080+
twinaiot.menu.UploadSpeed.921600=921600
52081+
twinaiot.menu.UploadSpeed.921600.upload.speed=921600
52082+
twinaiot.menu.UploadSpeed.115200=115200
52083+
twinaiot.menu.UploadSpeed.115200.upload.speed=115200
52084+
twinaiot.menu.UploadSpeed.256000.windows=256000
52085+
twinaiot.menu.UploadSpeed.256000.upload.speed=256000
52086+
twinaiot.menu.UploadSpeed.230400.windows.upload.speed=256000
52087+
twinaiot.menu.UploadSpeed.230400=230400
52088+
twinaiot.menu.UploadSpeed.230400.upload.speed=230400
52089+
twinaiot.menu.UploadSpeed.460800.linux=460800
52090+
twinaiot.menu.UploadSpeed.460800.macosx=460800
52091+
twinaiot.menu.UploadSpeed.460800.upload.speed=460800
52092+
twinaiot.menu.UploadSpeed.512000.windows=512000
52093+
twinaiot.menu.UploadSpeed.512000.upload.speed=512000
52094+
52095+
twinaiot.menu.PartitionScheme.default=Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS)
52096+
twinaiot.menu.PartitionScheme.default.build.partitions=default
52097+
twinaiot.menu.PartitionScheme.defaultffat=Default 4MB with ffat (1.2MB APP/1.5MB FATFS)
52098+
twinaiot.menu.PartitionScheme.defaultffat.build.partitions=default_ffat
52099+
twinaiot.menu.PartitionScheme.minimal=Minimal (1.3MB APP/700KB SPIFFS)
52100+
twinaiot.menu.PartitionScheme.minimal.build.partitions=minimal
52101+
twinaiot.menu.PartitionScheme.no_fs=No FS 4MB (2MB APP x2)
52102+
twinaiot.menu.PartitionScheme.no_fs.build.partitions=no_fs
52103+
twinaiot.menu.PartitionScheme.no_ota=No OTA (2MB APP/2MB SPIFFS)
52104+
twinaiot.menu.PartitionScheme.no_ota.build.partitions=no_ota
52105+
twinaiot.menu.PartitionScheme.noota_3g=No OTA (1MB APP/3MB SPIFFS)
52106+
twinaiot.menu.PartitionScheme.noota_3g.build.partitions=noota_3g
52107+
twinaiot.menu.PartitionScheme.noota_3g.upload.maximum_size=1048576
52108+
twinaiot.menu.PartitionScheme.noota_ffat=No OTA (2MB APP/2MB FATFS)
52109+
twinaiot.menu.PartitionScheme.noota_ffat.build.partitions=noota_ffat
52110+
twinaiot.menu.PartitionScheme.noota_ffat.upload.maximum_size=2097152
52111+
twinaiot.menu.PartitionScheme.noota_3gffat=No OTA (1MB APP/3MB FATFS)
52112+
twinaiot.menu.PartitionScheme.noota_3gffat.build.partitions=noota_3gffat
52113+
twinaiot.menu.PartitionScheme.noota_3gffat.upload.maximum_size=1048576
52114+
twinaiot.menu.PartitionScheme.huge_app=Huge APP (3MB No OTA/1MB SPIFFS)
52115+
twinaiot.menu.PartitionScheme.huge_app.build.partitions=huge_app
52116+
twinaiot.menu.PartitionScheme.huge_app.upload.maximum_size=3145728
52117+
twinaiot.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (1.9MB APP with OTA/190KB SPIFFS)
52118+
twinaiot.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs
52119+
twinaiot.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080
52120+
twinaiot.menu.PartitionScheme.rainmaker=RainMaker 4MB
52121+
twinaiot.menu.PartitionScheme.rainmaker.build.partitions=rainmaker
52122+
twinaiot.menu.PartitionScheme.rainmaker.upload.maximum_size=1966080
52123+
twinaiot.menu.PartitionScheme.rainmaker_4MB=RainMaker 4MB No OTA
52124+
twinaiot.menu.PartitionScheme.rainmaker_4MB.build.partitions=rainmaker_4MB_no_ota
52125+
twinaiot.menu.PartitionScheme.rainmaker_4MB.upload.maximum_size=4038656
52126+
twinaiot.menu.PartitionScheme.zigbee_zczr=Zigbee ZCZR 4MB with spiffs
52127+
twinaiot.menu.PartitionScheme.zigbee_zczr.build.partitions=zigbee_zczr
52128+
twinaiot.menu.PartitionScheme.zigbee_zczr.upload.maximum_size=1310720
52129+
twinaiot.menu.PartitionScheme.custom=Custom
52130+
twinaiot.menu.PartitionScheme.custom.build.partitions=
52131+
twinaiot.menu.PartitionScheme.custom.upload.maximum_size=16777216
52132+
52133+
twinaiot.menu.LoopCore.1=Core 1
52134+
twinaiot.menu.LoopCore.1.build.loop_core=-DARDUINO_RUNNING_CORE=1
52135+
twinaiot.menu.LoopCore.0=Core 0
52136+
twinaiot.menu.LoopCore.0.build.loop_core=-DARDUINO_RUNNING_CORE=0
52137+
52138+
twinaiot.menu.EventsCore.1=Core 1
52139+
twinaiot.menu.EventsCore.1.build.event_core=-DARDUINO_EVENT_RUNNING_CORE=1
52140+
twinaiot.menu.EventsCore.0=Core 0
52141+
twinaiot.menu.EventsCore.0.build.event_core=-DARDUINO_EVENT_RUNNING_CORE=0
52142+
52143+
twinaiot.menu.USBMode.hwcdc=Hardware CDC and JTAG
52144+
twinaiot.menu.USBMode.hwcdc.build.usb_mode=1
52145+
twinaiot.menu.USBMode.default=USB-OTG (TinyUSB)
52146+
twinaiot.menu.USBMode.default.build.usb_mode=0
52147+
52148+
twinaiot.menu.CDCOnBoot.default=Disabled
52149+
twinaiot.menu.CDCOnBoot.default.build.cdc_on_boot=0
52150+
twinaiot.menu.CDCOnBoot.cdc=Enabled
52151+
twinaiot.menu.CDCOnBoot.cdc.build.cdc_on_boot=1
52152+
52153+
twinaiot.menu.MSCOnBoot.default=Disabled
52154+
twinaiot.menu.MSCOnBoot.default.build.msc_on_boot=0
52155+
twinaiot.menu.MSCOnBoot.msc=Enabled (Requires USB-OTG Mode)
52156+
twinaiot.menu.MSCOnBoot.msc.build.msc_on_boot=1
52157+
52158+
twinaiot.menu.DFUOnBoot.default=Disabled
52159+
twinaiot.menu.DFUOnBoot.default.build.dfu_on_boot=0
52160+
twinaiot.menu.DFUOnBoot.dfu=Enabled (Requires USB-OTG Mode)
52161+
twinaiot.menu.DFUOnBoot.dfu.build.dfu_on_boot=1
52162+
52163+
twinaiot.menu.UploadMode.default=UART0 / Hardware CDC
52164+
twinaiot.menu.UploadMode.default.upload.use_1200bps_touch=false
52165+
twinaiot.menu.UploadMode.default.upload.wait_for_upload_port=false
52166+
twinaiot.menu.UploadMode.cdc=USB-OTG CDC (TinyUSB)
52167+
twinaiot.menu.UploadMode.cdc.upload.use_1200bps_touch=true
52168+
twinaiot.menu.UploadMode.cdc.upload.wait_for_upload_port=true
52169+
52170+
twinaiot.menu.DebugLevel.none=None
52171+
twinaiot.menu.DebugLevel.none.build.code_debug=0
52172+
twinaiot.menu.DebugLevel.error=Error
52173+
twinaiot.menu.DebugLevel.error.build.code_debug=1
52174+
twinaiot.menu.DebugLevel.warn=Warn
52175+
twinaiot.menu.DebugLevel.warn.build.code_debug=2
52176+
twinaiot.menu.DebugLevel.info=Info
52177+
twinaiot.menu.DebugLevel.info.build.code_debug=3
52178+
twinaiot.menu.DebugLevel.debug=Debug
52179+
twinaiot.menu.DebugLevel.debug.build.code_debug=4
52180+
twinaiot.menu.DebugLevel.verbose=Verbose
52181+
twinaiot.menu.DebugLevel.verbose.build.code_debug=5
52182+
52183+
twinaiot.menu.EraseFlash.none=Disabled
52184+
twinaiot.menu.EraseFlash.none.upload.erase_cmd=
52185+
twinaiot.menu.EraseFlash.all=Enabled
52186+
twinaiot.menu.EraseFlash.all.upload.erase_cmd=-e
52187+
52188+
twinaiot.menu.ZigbeeMode.default=Disabled
52189+
twinaiot.menu.ZigbeeMode.default.build.zigbee_mode=
52190+
twinaiot.menu.ZigbeeMode.default.build.zigbee_libs=
52191+
twinaiot.menu.ZigbeeMode.zczr=Zigbee ZCZR (coordinator/router)
52192+
twinaiot.menu.ZigbeeMode.zczr.build.zigbee_mode=-DZIGBEE_MODE_ZCZR
52193+
twinaiot.menu.ZigbeeMode.zczr.build.zigbee_libs=-lesp_zb_api.zczr -lzboss_stack.zczr -lzboss_port.remote
52194+
52195+
##############################################################

cores/esp32/esp32-hal-ledc.c

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -784,17 +784,23 @@ void analogWrite(uint8_t pin, int value) {
784784
}
785785

786786
void analogWriteFrequency(uint8_t pin, uint32_t freq) {
787-
if (ledcChangeFrequency(pin, freq, analog_resolution) == 0) {
788-
log_e("analogWrite frequency cant be set due to selected resolution! Try to adjust resolution first");
789-
return;
787+
ledc_channel_handle_t *bus = (ledc_channel_handle_t *)perimanGetPinBus(pin, ESP32_BUS_TYPE_LEDC);
788+
if (bus != NULL) { // if pin is attached to LEDC change frequency, otherwise update the global frequency
789+
if (ledcChangeFrequency(pin, freq, analog_resolution) == 0) {
790+
log_e("analogWrite frequency cant be set due to selected resolution! Try to adjust resolution first");
791+
return;
792+
}
790793
}
791794
analog_frequency = freq;
792795
}
793796

794797
void analogWriteResolution(uint8_t pin, uint8_t resolution) {
795-
if (ledcChangeFrequency(pin, analog_frequency, resolution) == 0) {
796-
log_e("analogWrite resolution cant be set due to selected frequency! Try to adjust frequency first");
797-
return;
798+
ledc_channel_handle_t *bus = (ledc_channel_handle_t *)perimanGetPinBus(pin, ESP32_BUS_TYPE_LEDC);
799+
if (bus != NULL) { // if pin is attached to LEDC change resolution, otherwise update the global resolution
800+
if (ledcChangeFrequency(pin, analog_frequency, resolution) == 0) {
801+
log_e("analogWrite resolution cant be set due to selected frequency! Try to adjust frequency first");
802+
return;
803+
}
798804
}
799805
analog_resolution = resolution;
800806
}

cores/esp32/esp32-hal-time.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,24 +22,24 @@
2222
#endif
2323

2424
static void setTimeZone(long offset, int daylight) {
25-
char cst[17] = {0};
26-
char cdt[17] = "DST";
27-
char tz[33] = {0};
25+
char cst[21] = {0};
26+
char cdt[21] = "DST";
27+
char tz[41] = {0};
2828

2929
if (offset % 3600) {
30-
sprintf(cst, "UTC%ld:%02u:%02u", offset / 3600, abs((offset % 3600) / 60), abs(offset % 60));
30+
snprintf(cst, sizeof(cst), "UTC%ld:%02u:%02u", offset / 3600, abs((offset % 3600) / 60), abs(offset % 60));
3131
} else {
32-
sprintf(cst, "UTC%ld", offset / 3600);
32+
snprintf(cst, sizeof(cst), "UTC%ld", offset / 3600);
3333
}
3434
if (daylight != 3600) {
3535
long tz_dst = offset - daylight;
3636
if (tz_dst % 3600) {
37-
sprintf(cdt, "DST%ld:%02u:%02u", tz_dst / 3600, abs((tz_dst % 3600) / 60), abs(tz_dst % 60));
37+
snprintf(cdt, sizeof(cdt), "DST%ld:%02u:%02u", tz_dst / 3600, abs((tz_dst % 3600) / 60), abs(tz_dst % 60));
3838
} else {
39-
sprintf(cdt, "DST%ld", tz_dst / 3600);
39+
snprintf(cdt, sizeof(cdt), "DST%ld", tz_dst / 3600);
4040
}
4141
}
42-
sprintf(tz, "%s%s", cst, cdt);
42+
snprintf(tz, sizeof(tz), "%s%s", cst, cdt);
4343
setenv("TZ", tz, 1);
4444
tzset();
4545
}

docs/en/api/spi.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ For some APIs, the reference to be used is the same as the Arduino Core.
1010
Arduino API Reference
1111
---------------------
1212

13-
`SPI Reference <https://www.arduino.cc/reference/en/language/functions/communication/spi/>`_
13+
`SPI Reference <https://docs.arduino.cc/language-reference/en/functions/communication/SPI/>`_
1414

1515
`SPI Description <https://docs.arduino.cc/learn/communication/spi>`_
1616

docs/en/guides/core_compatibility.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ To ensure compatibility with both versions of the ESP32 Arduino core, developers
2626
Version Print
2727
-------------
2828

29-
To easily print the ESP32 Arduino core version at runtime, developers can use the `ESP_ARDUINO_VERSION_STR` macro. Below is an example of how to print the ESP32 Arduino core version:
29+
To easily print the ESP32 Arduino core version at runtime, developers can use the ``ESP_ARDUINO_VERSION_STR`` macro. Below is an example of how to print the ESP32 Arduino core version:
3030

3131
.. code-block:: cpp
3232
@@ -35,10 +35,10 @@ To easily print the ESP32 Arduino core version at runtime, developers can use th
3535
API Differences
3636
---------------
3737

38-
Developers should be aware, that there may be API differences between major versions of the ESP32 Arduino core. For this we created a `Migration guide <https://docs.espressif.com/projects/arduino-esp32/en/latest/migration_guides.html>`_. to help developers transition from between major versions of the ESP32 Arduino core.
38+
Developers should be aware, that there may be API differences between major versions of the ESP32 Arduino core. For this we created a `Migration guide <https://docs.espressif.com/projects/arduino-esp32/en/latest/migration_guides/migration_guides.html>`_. to help developers transition from between major versions of the ESP32 Arduino core.
3939

4040
Library Testing
4141
---------------
4242

4343
We have added an External Library Test CI job, which tests external libraries with the latest version of the ESP32 Arduino core to help developers ensure compatibility with the latest version of the ESP32 Arduino core.
44-
If you want to include your library in the External Library Test CI job, please follow the instructions in the `External Libraries Test <https://docs.espressif.com/projects/arduino-esp32/en/latest/esp32/external_libraries_test.html>`_.
44+
If you want to include your library in the External Library Test CI job, please follow the instructions in the `External Libraries Test <https://docs.espressif.com/projects/arduino-esp32/en/latest/external_libraries_test.html>`_.

libraries/AsyncUDP/src/AsyncUDP.cpp

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,33 @@ AsyncUDPPacket::AsyncUDPPacket(AsyncUDPPacket &packet) {
317317
pbuf_ref(_pb);
318318
}
319319

320+
AsyncUDPPacket &AsyncUDPPacket::operator=(const AsyncUDPPacket &packet) {
321+
if (this != &packet) {
322+
if (_pb) {
323+
// Free existing pbuf reference
324+
pbuf_free(_pb);
325+
}
326+
327+
// Copy all members
328+
_udp = packet._udp;
329+
_pb = packet._pb;
330+
_if = packet._if;
331+
_data = packet._data;
332+
_len = packet._len;
333+
_index = 0;
334+
335+
memcpy(&_remoteIp, &packet._remoteIp, sizeof(ip_addr_t));
336+
memcpy(&_localIp, &packet._localIp, sizeof(ip_addr_t));
337+
_localPort = packet._localPort;
338+
_remotePort = packet._remotePort;
339+
memcpy(_remoteMac, packet._remoteMac, 6);
340+
341+
// Increment reference count for the new pbuf
342+
pbuf_ref(_pb);
343+
}
344+
return *this;
345+
}
346+
320347
AsyncUDPPacket::AsyncUDPPacket(AsyncUDP *udp, pbuf *pb, const ip_addr_t *raddr, uint16_t rport, struct netif *ntif) {
321348
_udp = udp;
322349
_pb = pb;

libraries/AsyncUDP/src/AsyncUDP.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@ class AsyncUDPPacket : public Stream {
100100

101101
size_t write(const uint8_t *data, size_t len);
102102
size_t write(uint8_t data);
103+
104+
// Copy assignment operator
105+
AsyncUDPPacket &operator=(const AsyncUDPPacket &packet);
103106
};
104107

105108
class AsyncUDP : public Print {

0 commit comments

Comments
 (0)