Commit graph

772 commits

Author SHA1 Message Date
Jason2866
4a8ba4294e
fix weird formatting, no code change (#10617)
* fix formatting

* Disable formatter for these lines

---------

Co-authored-by: Lucas Saavedra Vaz <32426024+lucasssvaz@users.noreply.github.com>
2024-11-19 12:18:06 +02:00
Me No Dev
f8d9ffb74a
fix(net): Allow to compile without IPv6 enabled (#10582)
* fix(net): Allow to compile without IPv6 enabled

cc: @Jason2866

* ci(pre-commit): Apply automatic fixes

---------

Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
2024-11-12 11:29:52 +02:00
s-hadinger
a80b03e017
fix(IPaddress): IPv6 restore zone id (#10546)
* IPv6 restore zone id

This PR restores the IPv6 zone-id in String representation of IPv6 address as well as parsing. This follows 20a28b58bc that disabled it due to a crash in `netif_index_to_name()`.

The fixed code scans through `netif_list` to find the `netif` name and id.

Note: zone-id are incremented by 1 compared to `netif` id.

For example internal zoneid value `3` actually translates to `%st2`

* ci(pre-commit): Apply automatic fixes

---------

Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
2024-11-06 00:58:30 +02:00
Lucas Saavedra Vaz
f1e1f5ab95
Merge branch 'master' into release/v3.1.x 2024-11-04 19:43:44 -03:00
Mathieu Carbou
d47771f2cc
fix(sntp): Lock / Unlock LWIP if CONFIG_LWIP_TCPIP_CORE_LOCKING is set (#10529)
* fix(sntp): Lock / Unlock LWIP if CONFIG_LWIP_TCPIP_CORE_LOCKING is set
Fixes: https://github.com/espressif/arduino-esp32/issues/10526

* ci(pre-commit): Apply automatic fixes

---------

Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
2024-10-29 13:10:40 +02:00
Rodrigo Garcia
9aeb1ba548
ESP32-P4 UART Pin Definitions (#10521)
* feat(uart): allow pins_arduino.h to define esp32-p4 uart pins

ESP32-P4 has UART default pins only for UART0 and UART1.
This PR allows the board definition from pins_arduino.h to define RX2 ... RX4 and TX2 ... TX4 if necessary.
It also solves the issue of begin(baud) with no pins for UART2...4 by just sending a error message and returning.

* feat(uart): removes the uart2 pin definitions - not existant

* fix(uart): solves the case when uart has already been initialized

* ci(pre-commit): Apply automatic fixes

* fix(ci): uart definition for esp32-p4 uart2 rx,tx pins

---------

Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
2024-10-25 15:07:37 +03:00
Me No Dev
38a4c29fed
feature(rtos): Add Tasks status print function (#10515)
* feature(rtos): Add Tasks status print function

* fix(cmake): Add the new cpp file to CMakeLists

* fix(stats): Adjust size of Load column

* fix(format): Fix print of runtime formatting

* fix(stats): Add license, usage note and C++ guards

* fix(stats): Fix formatting and variable names

* ci(pre-commit): Apply automatic fixes

---------

Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
2024-10-25 14:57:21 +03:00
Me No Dev
dc1a49e6f0
IDF release/v5.3 (#10503)
* fix(psram): Do not disable PSRAM when used as component

Information: https://github.com/espressif/arduino-esp32/issues/10500

* IDF release/v5.3 59550599
2024-10-23 02:04:03 +03:00
me-no-dev
20a28b58bc fix(net): Do not use netif_index_to_name
Causes error on recent IDF builds
2024-10-22 12:13:04 +03:00
Jan Procházka
7cfe470d8d
feat(touch): Support NG touch driver for P4 (#10448)
* feat(touch): Support NG touch driver for P4

* fix(ci): Touch test + IDF compilation fixes

* fix(ci): remove debug prints from touch test

* fix(ci): Fix touch test for esp32

* ci(pre-commit): Apply automatic fixes

---------

Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
2024-10-21 13:29:01 +03:00
me-no-dev
9e48d9f238 fix(spi): Fix P4 SPI Pin definitions
Use GPIOs 36 or lower to avoid LDO power issues
2024-10-17 16:13:59 +03:00
me-no-dev
f706c27671 Update TinyUSB init method 2024-10-15 20:42:26 +03:00
Me No Dev
a3f2568a19
IDF release/v5.3 (#10465)
* fix(usb): Update tinyusb init call

* Update esp-insights version (#10456)

* Add support for WiFi to ESP32-P4 (#10463)

* feat(p4): Add support for WiFi to ESP32-P4

Implements support for external MCU connected through SDIO

* fix(p4): Init SDIO host properly on Network boot

esp-hosted has one function marked as "constructor" that did not run in the boot phase of the chip. This calls the function when network is started

* Fix RainMaker dependent versions because Matter requires Insights 1.0.1

* IDF release/v5.3 707d097b

* ci(pre-commit): Apply automatic fixes

---------

Co-authored-by: Mahesh Tupe <tupemahesh91@gmail.com>
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
2024-10-15 20:20:04 +03:00
Lucas Saavedra Vaz
81d2cbca96
fix(uart): Add missing HP UARTs for ESP32-P4 (#10447)
* fix(uart): Add missing HP UARTs for ESP32-P4

* fix(comment): Fix macro in comment

* fix(uart): Fix macro guard
2024-10-10 14:27:04 -03:00
Me No Dev
774f2756f1
Merge branch 'master' into release/v3.1.x 2024-10-10 18:38:27 +03:00
Rodrigo Garcia
0d5d50eb41
feat(uart): eliminates nonexistent functions (#10428)
loop() calls Serial Events functions when those are declared. The way it was declared was forcing to alway call avalable() to then call an empty function. This commit fixes it.
2024-10-07 15:56:04 +03:00
Lucas Saavedra Vaz
765173372f
Add P4 to chip info 2024-10-04 11:33:27 -03:00
me-no-dev
341dc18079 fix(usb): Add support for HighSpeed USB
This commit adds support for HighSpeed USB as present on ESP32-P4
2024-10-03 13:47:24 +03:00
Me No Dev
ea50cf6f5f
fix(spiram): Fix OPI PSRAM init (#10406) 2024-10-02 22:18:17 +03:00
me-no-dev
c3aa74f60a fix(spiram): Fix OPI PSRAM init 2024-10-02 19:42:32 +03:00
me-no-dev
58c0bbc0e9 fix(usb): Add support for ESP32-P4 to esp32-hal-tinyusb 2024-10-02 16:17:12 +03:00
Me No Dev
e3499bc4b7
Merge branch 'master' into release/v3.1.x 2024-10-02 15:36:56 +03:00
Me No Dev
2ec5584d06
fix(hid): Fix OUTPUT report not received (#10398)
Fixes an issue where the keyboard LEDs will not trigger the proper event
2024-10-02 15:34:27 +03:00
Me No Dev
84ddf0ad28
fix(psram): Do not abort if PSRAM is not found (#10395)
Also add to heap in app_main
2024-10-01 16:34:41 +03:00
me-no-dev
753e2032e7 fix(psram): ESP32-S2 does not like to early debug log 2024-10-01 16:12:13 +03:00
me-no-dev
482c0a3c26 fix(psram): Do not abort if PSRAM is not found
Also add to heap in app_main
2024-10-01 15:45:09 +03:00
me-no-dev
c980fdc996 Update early system init function declaration 2024-10-01 12:34:44 +03:00
Me No Dev
a5a5809eec
Merge branch 'master' into release/v3.1.x 2024-10-01 12:12:04 +03:00
Me No Dev
5a06dd9e57
fix(psram): Init PSRAM before app_main to fix mmu_map (#10390)
* fix(psram): Init PSRAM before app_main to fix mmu_map

Makes sure that PSRAM is part of the map before app_main is called.

* ci(pre-commit): Apply automatic fixes

---------

Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
2024-10-01 12:11:21 +03:00
Luca Burelli
a4cbdaf3a8
fix(HardwareSerial): fix pin remapping in begin() (#10379)
The pin remapping functions have to be called as early as possible in
the begin() function, to immediately convert the input parameters to the
GPIO numbers used everywhere in the core.

This issue has always been dormant since the introduction of pin
remapping in 2.x via 9b4622d, but was exposed by the proper pin muxing
support that is present in the 3.x core.

Move the pin remapping function calls earlier in the begin() function to
fix this issue.
2024-10-01 12:11:03 +03:00
Me No Dev
7a0138462d
Merge branch 'master' into release/v3.1.x 2024-09-26 01:37:46 +03:00
Luca Burelli
55bd1d5ee2
digitalPinToInterrupt: fix double pin remapping (#10373)
The digitalPinToInterrupt() macro currently remaps the pin number to the
GPIO number. This is not necessary, as most users will then use the
returned value in attachInterrupt() or other similar API functions,
which already perform the same remapping.

The first half of the macro (the condition) does indeed require the
remapping to ensure the check operates on GPIO numbers.

Fixes espressif/arduino-esp32#10367.
2024-09-25 23:47:08 +03:00
Lucas Saavedra Vaz
4bb287eaf6
fix(esp32p4): Fix compilation errors (#10371)
* fix(esp32p4): Add missing touchpad definitions

* fix(esp32p4): Add missing target in SPI example

* fix(esp32p4): Start touch driver fix

* fix(esp32p4): Skip touch examples while it is not implemented

* fix(esp32p4): Add missing analog pin definitions

* refactor(formatting): Fix formatting that was broken in P4 PR

* fix(openthread): Add missing targets to skip

* fix(esp32p4): Skip ethernet sketches

* fix(esp32p4): Disable periman test while touch is not implemented

* fix(esp32p4): Disable touch test while touch is not implemented

* fix(esp32p4): Fix UART test

* fix(esp32p4): Skip Wi-Fi test

* fix(esp32): Skip unsupported example

* fix(esp32p4): Fix skip files

* ci(pre-commit): Apply automatic fixes

---------

Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
2024-09-25 23:38:21 +03:00
Lucas Saavedra Vaz
a4c33e3897
feat(esp32p4): Add initial ESP32-P4 support (#10358)
* feat(esp32p4): Initial changes required for ESP32-P4

* esp32-p4: Initial changes to build with Arduino

Signed-off-by: Lucas Saavedra Vaz <32426024+lucasssvaz@users.noreply.github.com>

* fix(esp32p4): Fix lib builder errors

* change(esp32p4): Unhide board

* ci(esp32p4): Add ESP32-P4 to workflow

* change(esptool): Update esptool to 4.8.0

* fix(build): Fix redefinition errors

* fix(build): Remove old commands

* change(esptool): Remove unsupported 32-bit tools

* fix(get.py): Force exe generation

* Revert "fix(get.py): Force exe generation"

This reverts commit 979b16b3b19d02917ddccf0139c6913cca618714.

* fix(get.py): Fix system check

* change(tools): Push generated binaries to PR

* ci(esp32p4): Add missing ESP32-P4 entries

* fix(esp32p4): Add chip info

* fix(esp32p4): Fix build commands

* docs(esp32p4): Add missing references to P4

* fix(esp32p4): Fix clock sources definitions

* fix(esp32p4): Set CPU frequency to 360 MHz so it is stable in all chips

* refactor(esp32p4): Change preprocessor conditionals for maintainability

Co-authored-by: me-no-dev <hristo@espressif.com>

* fix(esp32p4): Add missing menu options

* fix(esp32p4): Mark as not in development json in readme

* fix(esp32p4): Add P4 to ci.json files

* ci(pre-commit): Apply automatic fixes

* fix(get.py): Remove unused include

* ci(pre-commit): Apply automatic fixes

* change(tools): Push generated binaries to PR

* ci(pre-commit): Apply automatic fixes

* fix(ci.json): Fix formatting

---------

Signed-off-by: Lucas Saavedra Vaz <32426024+lucasssvaz@users.noreply.github.com>
Co-authored-by: Jason2866 <24528715+Jason2866@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: me-no-dev <hristo@espressif.com>
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
2024-09-24 21:18:28 +03:00
me-no-dev
e68b1cca09 Merge branch 'master' into release/v3.1.x 2024-09-18 15:06:31 +03:00
me-no-dev
7018cd114d Update core version to 3.0.5 2024-09-18 14:54:00 +03:00
TD-er
e989445b62
Fix missing virtual declarations in Stream.h (#10348)
* Fix missing virtual declarations in Stream.h

Fixes some changes made in PR #10328

* Remove the virtual destructor as Print class has one

As pointed out by @JAndrassy
2024-09-17 11:54:48 +03:00
Me No Dev
648094c733
fix(api): Update Arduino Stream class (#10328)
* fix(api): Update Arduino Stream class

Upstream code contains some fixes

* Update Stream.h

* ci(pre-commit): Apply automatic fixes

---------

Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
2024-09-13 10:49:49 +03:00
Me No Dev
855da422ba
Merge branch 'master' into release/v3.1.x 2024-09-11 15:18:38 +03:00
Me No Dev
2c4ce95e16
fix(i2c): Ensure that semaphore is properly given if init fails (#10313)
Currently code can return before semaphore is given, which can cause the bus to lock. Change makes sure that it's properly given in case of failure.
2024-09-10 16:18:16 +03:00
Rodrigo Garcia
532d5f2fad
feat(tone): missing set tone channel implementation (#10305)
Adds the implementation to setToneChannel() declared in Arduino.h, but removed when movin from Arduino 2.x to 3.x.
2024-09-09 12:45:13 +03:00
Me No Dev
976bda6b49
fix(report): Print correct chip revision (#10277)
It was printed wrongly before. Actual revision is the value divided by 100 in float.
2024-09-09 12:39:30 +03:00
Me No Dev
e6dc9db764
Merge branch 'master' into release/v3.1.x 2024-08-28 17:10:24 +03:00
Adriano Konzen
dd4a7d6c5e
feat(LEDC): Adds the ability to set the clock source for the LEDC (#10171)
* Adds the ability to set the clock source for the LEDC

* feat(LEDC): Adjusting function names to more suitable

* feat(LEDC):  Fix clock_source to static

* docs(ledc): Document ledc set and get clock source

* docs(ledc): Update ledcSetClockSource description

* ci(pre-commit): Apply automatic fixes

---------

Co-authored-by: Jan Prochazka <90197375+P-R-O-C-H-Y@users.noreply.github.com>
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
2024-08-28 17:09:56 +03:00
me-no-dev
0b842442c9 Update core version to 3.1.0 2024-08-28 16:11:35 +03:00
Me No Dev
75b29fde57
Merge branch 'master' into release/v3.1.x 2024-08-28 15:49:38 +03:00
Lucas Saavedra Vaz
e04f050639
fix(spelling): Fix misspellings detected by codespell and enable it (#10232)
* fix(spelling): Fix misspellings detected by codespell and enable it

* change(tools): Push generated binaries to PR

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-08-28 15:43:02 +03:00
Me No Dev
fa6711551d
Merge branch 'master' into release/v3.1.x 2024-08-28 11:57:41 +03:00
Rodrigo Garcia
4c4906f470
fix(uart): sleep retention (#10248)
* fix(uart): sleep retention

sets new flag from IDF 5.3 that causes error with Serial.begin(115200).

* fix(typo): typo and commentaries

* feat(uart): adds memset to make structure empty

* fix(uart): missing parentesis - typo

* ci(pre-commit): Apply automatic fixes

---------

Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
2024-08-28 10:50:49 +03:00
Rodrigo Garcia
99e68a0518
Change "neopixel" references to use RGB LED naming (#10225)
* fix(rgbled): fixes core rgbledWrite()

* fix(rgbled): fixes examples - rgbledWrite()

* fix(rgbled): fixes variants commetaries - rgbledWrite()

* fix(rgbled): examples and doc - use RGB_LED naming

* fix(rgbled): variants - use RGB_LED naming

* fix(rgbled): other places for RGB LED naming

* fix(typo): cores - rgbLed instead of rgbled

* fix(typo): examples - rgbLed instead of rgbled

* fix(typo): variants commentaties - rgbLed instead of rgbled

* fix(rgbled): bad file name

* fix(typo): typo and commentaries

Co-authored-by: Lucas Saavedra Vaz <32426024+lucasssvaz@users.noreply.github.com>

* fix(rgbled): deprecating neopixelWrite()

* fix(rgbled): use RGB LED naming

* fix(rgbled): document formatting

* fix(rgbled): neopixelWrite() is now deprecated

* fix(rgbled): removed attribute in wrong place

* just a git push test

* restart git bash test

* ci(pre-commit): Apply automatic fixes

* removed wrong test file

* fix(rgbled): new Arduino style depreacted attribute

---------

Co-authored-by: Lucas Saavedra Vaz <32426024+lucasssvaz@users.noreply.github.com>
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
2024-08-28 09:53:24 +03:00
Me No Dev
0539ebf322
fix(chip): Return correct ESP32 chip model (#10243) 2024-08-26 15:02:22 +03:00
Me No Dev
0a8888d5d6
Merge branch 'master' into release/v3.1.x 2024-08-22 23:48:51 +03:00
Leandro Mattioli
6c4e9ee609
fix(timer): Typo - milis instead of millis (#10193)
* fix(timer): Typo - milis instead of millis.

* fix(doc0: format

fix CI error about format

---------

Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com>
2024-08-22 23:44:17 +03:00
Me No Dev
7fe4aa672c
Merge branch 'master' into release/v3.1.x 2024-08-21 22:38:41 +03:00
Davide Perini
66c9c0b1a6
Add ability for boards to provide a custom pixel order in neopixelWrite() (#10128)
* fix(esp32): Fixed the hint for the builtin neopixleWrite() function

* change(esp32): Added neopixelWriteOrdered() function

* change(esp32): Added neopixelWriteOrdered() function

* change(esp32): Added neopixelWriteOrdered() function

* change(esp32): Added the possibility to specify LED color order

* change(esp32): Added the possibility to specify LED color order

* feat(rgbled): add license information

* feat(rgbled): add color order enum

* feat(rgbled): add color order feature

* feat(rgbled): change color order for lolin_s3_mini

* fix(rgbled): suffix

* fix(rgbled): suffix

* ci(pre-commit): Apply automatic fixes

* fix(rgbled): it lacks GRB case

Made GRB default + switch/case exceptions.

* fix(rgbled): add guard for rgb_led_color_order_t

If RGB_BUILTIN_LED_COLOR_ORDER is not defined, the type rgb_led_color_order_t won't be declared.

* fix(rgb-led): Implement rgbLedWriteOrdered()

* ci(pre-commit): Apply automatic fixes

* Remove const to allow changing the order

---------

Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com>
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
Co-authored-by: me-no-dev <hristo@espressif.com>
2024-08-20 01:29:13 +03:00
me-no-dev
f77ce040db fix(build): Fix many warnings 2024-08-20 00:51:23 +03:00
me-no-dev
e1673e4c0c fix(build): IDF release/v5.3 466a392a and initial changes 2024-08-19 23:28:11 +03:00
Rodrigo Garcia
2a971751a7
fix(uart): clock source (#10172)
Problem detected with ESP32 and ESP32-S2 when the baudrate goes to 460600 bps.

REF_TICK (2MHz) seem not to work properly.
Limiting the use of REF_TICK for up to 205 Kbps.
2024-08-16 16:42:18 +03:00
Rodrigo Garcia
384cc27bba
fix(USB): OTG S2 and S3 debug print (#10123)
* fix(USB): OTG S2 and S3 debug print

ESP32-S2 and S3 using USB CDC OTG (TinyUSB) won't print any log information. This commit fixes that.

* fix(cdc): trying macos

changed Macro testing

* ci(pre-commit): Apply automatic fixes

---------

Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
2024-08-13 14:27:06 +03:00
Me No Dev
0d4ffcf74b
fix(core): Update versions to 3.0.4 (#10106) 2024-08-02 12:18:35 +03:00
Rodrigo Garcia
b1b62286db
fix(uart): Sets XTAL as clock source for uart (#10087)
* fix(uart): Sets XTAL as clock source for uart

C6 and H2 have problems after returning from light sleep. The baud rate seems to be off when APB is used as clock source.

This fix solves the issue using a steady clock source.

* fix(typo): Typo and commentaries

Adds C2 in the XTAL list.

* fix(uart): adjust get/set baudrate

Fixes the functions for reading/writing UART baudrate by using IDF functions instead of HAL/LL.

* fix(uart): uses REF_TICK for ESP32/S2

* fix(uart): esp32/s2 baudrate > 1MHz

Fixes the baudrate for ESP32 and ESP32-S2 when the baud rate is higher than 1MHz.
REF_TICK is just 2MHZ and can handle up to 1MHZ baudrate.

* fix(uart): rxTimeout minimum

Default RxTimeout changed to the minimum = 1.
When TICK_REF is used as clock source, this is mandatory,

* ci(pre-commit): Apply automatic fixes

---------

Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
2024-08-01 12:09:59 +03:00
Xylopyrographer
6244d9a45b
feat: Print chip features bitfield (#10080)
Prints the value of the chip features bitfield to printChipInfo() to facilitate debugging.

Co-authored-by: Lucas Saavedra Vaz <32426024+lucasssvaz@users.noreply.github.com>
2024-07-31 21:44:13 +03:00
Jan Procházka
3722dbad6c
fix(ledc): Fix freeing channel if not used anymore (#10094) 2024-07-31 15:16:55 +03:00
Jan Procházka
f5be003d0b
fix(timer): Add check to avoid crashing (#10069) 2024-07-29 13:09:22 +03:00
Jan Procházka
b33fbca9b7
fix(gpio): Add missing include for digitalPinCanOutput (#10070) 2024-07-29 12:49:45 +03:00
Marek Knosala
b2e67ca278
Update analogContinuous function for passing pins as const and constexpr (#10044)
* Update esp32-hal-adc.c

* Update esp32-hal-adc.h

* Update adc.rst
2024-07-22 11:59:18 +03:00
me-no-dev
bd0abb3474 Update core versions to 3.0.3 2024-07-16 21:55:50 +03:00
Jan Procházka
3c1e5a9189
feat(ledc): Allow attaching multiple pins to 1 channel (#10032)
* feat(ledc): Allow attaching multiple pins to 1 channel

* feat(ledc): Add ledcWriteChannel function

* feat(ledc): Print info about already set channel

* docs(ledc): Add ledcWriteChannel function and attach update

* feat(ledc): Add example and fixes

* feat(ledc): Remove commented code

* feat(ledc): Fix missing new line at end of file

* ci(pre-commit): Apply automatic fixes

---------

Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
2024-07-16 15:52:45 +03:00
Rodrigo Garcia
5f663e708a
fix(uart): Set back Pin signal polarity (#9950)
* fix(uart): Set back Pin signal polarity

Fixes a problem related to inverting signal polarity back to normal after a previous inversion.

This shall set the correct polarity in Serial.begin().

* fix(uart): Remove useless commentary

Removes a commentary with a question about the inversing polarity function.

* fix(uart): Update comment

Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com>

---------

Co-authored-by: Me No Dev <me-no-dev@users.noreply.github.com>
Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com>
2024-07-01 13:11:15 +03:00
Rodrigo Garcia
36863449e4
RMT Legacy Driver option (#9941)
* feat(rmt): allow legacy driver

* feat(rmt): legacy driver example

* fix(rmt): legacy driver example

* fix(rmt): ESP32_ARDUINO_NEW_RMT_DRV_OFF

* fix(rmt): ESP32_ARDUINO_NEW_RMT_DRV_OFF

* fix(rmt): ESP32_ARDUINO_NEW_RMT_DRV_OFF

* fix(rmt): GPIO HAL only

* fix(rmt): error case

* fix(rmt): not necessary change

* ci(pre-commit): Apply automatic fixes

* ci(pre-commit): Ignore build_opt in clangformat

---------

Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
Co-authored-by: Lucas Saavedra Vaz <32426024+lucasssvaz@users.noreply.github.com>
2024-06-28 12:06:58 +03:00
Rodrigo Garcia
0ef2986874
feat(rmt): Solve neopixel issue (#9906)
* feat(rmt): Solve neopixel issue

if neopixelWrite() is used from different tasks/isr_callbacks, it may result in a concurrency problem and many detach/attach calls in sequence, but not in synch.

This commit avoids initializing the neopixel GPIO again and improves the respomse time of neopixelWrite().
2024-06-20 16:33:06 -03:00
Me No Dev
b77b38e40e
fix(version): Update version to 3.0.2 (#9902) 2024-06-19 16:23:29 +03:00
Me No Dev
1d895e58e7
fix(xtal): Add a way to change the XTAL frequency for SparkFun ESP32 Thing (#9844)
* fix(xtal): Add a way to change the XTAL frequency

Add support for boards like SparkFun ESP32 Thing that use 26MHz XTAL

* ci(pre-commit): Apply automatic fixes

* feat(dbg): Print the XTAL frequency in the debug report

---------

Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
2024-06-13 10:26:54 +03:00
Rodrigo Garcia
575a415719
fix (adc): fixes limit test (#9807)
Fixes analogContinuousSetWidth() border test.
2024-06-10 15:31:30 +03:00
Lucas Saavedra Vaz
2928654027
change(idf): Rename component example and fix compilation warnings (#9801)
* change(idf): Rename component example

* ci(push): Fix steps conditions

* ci(tests): Remove unnecessary concurrency

* ci(push): Fix step condition

* fix(idf): Fix compilation warnings when as component
2024-06-10 15:30:18 +03:00
Me No Dev
8b4c1303f4
feat(usb): Support the new USB IDF API (#9761)
* feat(usb): Support the new USB IDF API

Required for the latest ESP-IDF release/v5.1

* ci(pre-commit): Apply automatic fixes

---------

Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
2024-06-03 15:45:31 +03:00
me-no-dev
97c98eb0cb Update core version to 3.0.1 2024-06-03 13:09:02 +03:00
Me No Dev
ffeebf8da8
fix(esp): Fix getFlashChipMode breaking on S3 and C3 (#9758) 2024-06-03 13:04:42 +03:00
Mathieu Carbou
16b1aeb745
fix(net): Fix IPv4 address construction from ip_addr_t and comparison (#9724) (#9725) 2024-05-30 14:18:46 +03:00
Matti Airas
d94b32ed20
fix(esp-hal-log):Provide a default TAG name for USE_ESP_IDF_LOG logging macro (#9686)
* change(logging): Provide a default TAG name for USE_ESP_IDF_LOG

The ESP-IDF logging library has some nice features such as log
forwarding. esp32-hal-log.h has long supported the USE_ESP_IDF_LOG
macro, but due to subsequent changes, it requires a global TAG
preprocessor macro to be defined. The macro name is too generic and
just having a sane default would be preferable.

* ci(pre-commit): Apply automatic fixes

---------

Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
2024-05-27 16:34:40 +03:00
Jan Procházka
ca28e65f4d
fix(adc): Remove masking for channel number (#9692) 2024-05-27 15:30:18 +03:00
Me No Dev
6adeca446b
fix(cdc): Disable SOF interrupt and CDC reset on begin() (#9628)
* fix(cdc): Disable SOF interrupt and CDC reset on begin()

* feat(jtag/hwcdc): uses SOF detection from IDF

Restores back IDF 5.1 SOF detection method in order to fix the HW CDC uploading process.

Enabling SOF mask in the ISR routine causes a problem with esptool uploading when using CDC/JTAG port.

* feat(jtag/hwcdc): uses SOF detection from IDF

Restores back IDF 5.1 SOF detection method in order to fix the HW CDC uploading process.

Enabling SOF mask in the ISR routine causes a problem with esptool uploading when using CDC/JTAG port.

* feat: revert include 

This include is not necessary here.

Moving it back to the HWCDC.cpp file.

* feat: adding a necessary include 

Adding the IDF 5.1 SOF check include file.

Necessary to make it compile. Moved from HWCDC.h file to here.

* feat: move function call to header file

* feat: Moved SOF function

* feat: Removed unused header file

* fix: Use correct SOF header file

* ci(pre-commit): Apply automatic fixes

* Small fixes for Debug prints on C3, C6 and H2

* fix(usb): Fix log prints

---------

Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com>
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
2024-05-15 13:58:45 +02:00
Jan Procházka
7acd875b78
fix(ledc): Match channel number with groups (#9638) 2024-05-15 13:16:28 +02:00
Rodrigo Garcia
c7b98a51aa
Update esp32-hal-uart.c (#9637) 2024-05-15 13:15:28 +02:00
Me No Dev
a3c8a48eed
fix(net): Add back the friend classes required for Ethernet.h to work (#9635) 2024-05-15 13:15:10 +02:00
Me No Dev
0c4b35e07e
IDF release/v5.1 (#9613)
* IDF release/v5.1 01b912a9e5

* Fix USB OTG Init on new IDF

* Delete libraries/TFLiteMicro/examples/micro_speech directory

Done in order to fix a CI problem created by an entire folder that was removed in original Library Repository.

* IDF release/v5.1 442a798083

* Update esp32-hal-tinyusb.c

---------

Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com>
2024-05-14 01:04:12 +02:00
Happy Code Farm
a04fceee2f
feat(usbmsc): Add is_writable function to the USBMSC class. (#9569)
* (feat)usbmsc: Add is_writable function

Add is_writable function to the USBMSC class.
Allows USBMSC to be mounted in read-only mode.

* Update USBMSC.ino

Changes to USB Mass Storage (MSC) example code in Arduino USB library

* Added MSC.isWritable(true) line to set the disk as writable

* ci(pre-commit): Apply automatic fixes

---------

Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com>
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
2024-05-13 15:10:45 +02:00
Rodrigo Garcia
7e7c01aadf
feat (hwcdc): ports changes made in 2.0.15 (#9565)
* feat (hwcdc): ports changes made in 2.0.15

Ports many changes, fixes and improvements made in 2.0.15:
- correct use of timeout
- avoids problems with CDC ISR not reading data
- fixes problems with transmitting many bytes to USB Host
- changes how USB SOF and CDC connection is detected

* feat (HWCDC) : port 2.0.15 

Changed header for a few functions.

* feat (HWCDC): port 2.0.15 upwards

Fixes include file that is not necessary any more.

- SOF is used directly now.

* fix (HWCDC): removes left over

Removes a left over function from previous 3.0.0 code.

- just removing unused code.

* ci(pre-commit): Apply automatic fixes

* fix: typo and commentaries

This fixes a few commentaries.

Just a typo error.

---------

Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
2024-04-29 18:16:37 +03:00
Rodrigo Garcia
84086cd4a2
feat (uart): change log level of UART events (#9563)
Changes from Warning to Verbose UART errors/warnings in order to make debugging easier, specially with UART BREAK.
2024-04-29 18:15:40 +03:00
Unbinilium
b6f7d403d1
fix(hal-uart): truncated tx/rx buffer size (uint16_t -> uint32_t) (#9554) 2024-04-29 18:14:22 +03:00
Lucas Saavedra Vaz
6bfcd6d9a9
refactor(style): Change some style options (#9526)
* refactor(style): Change some style options

* refactor(style): Apply style changes
2024-04-19 18:16:55 +03:00
Me No Dev
4960d86ba2
Add support for PPP Modems to Arduino (#9518)
* feat(ppp): Add support for PPP Modems

* feat(sdk): Add libs with PPP enabled

* ci(pre-commit): Apply automatic fixes

* IDF c432c692fa (#9527)

---------

Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
2024-04-19 15:50:50 +03:00
Darkl0ud
6b3a9a9bff
Fixed typo for adc_continuous_data typedef in esp32-hal-adc.h/.c (#9529)
* Fixed typo in adc_continuous_data typedef

Fixed typo in adc_continuous_data typedef

* Additional typo fix for adc_continuous_data typedef

Additional commit for previous commit (#9529) adding typo corrections within

1. /docs/en/api/adc.rst
2. /libraries/ESP32/examples/AnalogReadContinuous\AnalogReadContinuous.ino
3. tests/periman/periman.ino

---------

Co-authored-by: Lucas Saavedra Vaz <32426024+lucasssvaz@users.noreply.github.com>
2024-04-19 12:42:41 +03:00
Jason2866
9caa3638f0
add LittleFS as partition type (#9354)
Co-authored-by: Lucas Saavedra Vaz <32426024+lucasssvaz@users.noreply.github.com>
2024-04-15 23:08:52 +03:00
Lucas Saavedra Vaz
da5c6ab9ae
Refactor repository with pre-commit hooks (#9515)
* Add Config

* Add Cache and remove pre-commit action

* [pre-commit.ci lite] apply automatic fixes

* Remove freeze

* Fix

* Update action

* Use latest stable Python 3 version

* Improve caching

* Improve cache tag

* Improve bot message

* fix(typos): Fix typos

* fix(typos): Fix more typos

* refactor(udp_server): Convert script from Python 2 to 3

* Fix whitespace

* Clang-format fixes

* Prettier fixes

* Black formatting

* Manual fixes

* Line endings

* Fix flake and make Vale manual

* Fix flake and reformat

---------

Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com>
2024-04-15 19:40:56 +03:00
Rodrigo Garcia
34f5456f51
fix: HW CDC write() (#9401)
When writing a stream of data to the HW CDC of S3/C3/C6/H2, the SoC looses some bytes and don't send them all.

This fix makes it work fine.
2024-04-08 15:17:40 +03:00
Juraj Andrássy
205781b921
core Server class back to Arduino Core API version (#9447) 2024-04-02 20:40:37 +03:00
Holger Lembke
e92b4ca62b
Add: make digitalRead() for RGB_BUILTIN work (#9419)
* make digitalRead() for RGB_BUILTIN work

Standard Arduino-Way of blinking a LED can be the shortest with:

void loop() {
  static uint32_t ledticker = 0;
  if (millis() - ledticker > 1000) {
    ledticker = millis();
    digitalWrite(RGB_BUILTIN, !digitalRead(RGB_BUILTIN));
  }
}

Worked with the old LED_BUILTIN on Pin 2, now even works with Pin 48/neopixel.

* Add: make digitalRead() for RGB_BUILTIN work

Standard Arduino-Way of blinking a LED can be the shortest with:

void loop() {
  static uint32_t ledticker = 0;
  if (millis() - ledticker > 1000) {
    ledticker = millis();
    digitalWrite(RGB_BUILTIN, !digitalRead(RGB_BUILTIN));
  }
}

Worked with the old LED_BUILTIN on Pin 2, now even works with Pin 48/neopixel.

(Retry. Didn't sync my local sources. Sorry.)
2024-03-26 17:46:59 +02:00
Lucas Saavedra Vaz
f9bb62a91f
Add MacAddress string constructor (#9400)
* Add MacAddress string constructor

* Change implementation
2024-03-22 12:50:23 +02:00
Jan Procházka
fcef7395e8
fix(boards): Fixes needed to pass CI all-boards-test (#9390) 2024-03-20 14:11:35 +02:00
Jan Procházka
c17a688b62
Feature: New Class MacAddress similar to IPAddress (#9304)
* Added new classes MacAddress and MacAddress8

In the same style as class IPAddress.
Based on Apache License.

* Update MacAddress8.h

* Added Printable, constructor and extra operators

Added a few changes to make it closer to IPAddress Class implementation.

* Added construtor and Printable

Makes it closer to IPAddress Class implementation

* Fixes include Printable

* Update MacAddress.cpp

* Update MacAddress.h

* Update MacAddress.cpp

* Added Printable

* Added Printble and some more operators

* Cleanup and bounds checking

Moved implementation details .h->.cpp.  Added bounds checking on index operators.  Added constructor to MacAddress8 to match MacAddress.

* Fixed printTo

Chars must be uppercase to match toString() and pass test

* feat(MAC): Rework API to support both 6+8 bytes MacAddress

* feat(MAC): Remove MacAddress8.h file

* fix(MAC): Remove comment + reorder lines

* Update toString function with single buf and return

* Fix buffer size for toString

---------

Co-authored-by: David McCurley <44048235+mrengineer7777@users.noreply.github.com>
Co-authored-by: David McCurley <mrengineer02@gmail.com>
Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com>
Co-authored-by: Lucas Saavedra Vaz <32426024+lucasssvaz@users.noreply.github.com>
2024-03-18 15:45:00 +02:00
Rodrigo Garcia
0a26a8c4e3
Fixes HW Serial attaching pins, PHY initialization, crash after end() (#9365)
* fix: HWCDC pin number

Fixes HW Serial pin setup.

The pins were set up to the wrong value and it could not be correctly configured and used.

* fix: PHY initialization

Fixes the PHY initialization.

After detaching the pin and ending the HW Serial, a new begin() wouldn't start the CDC because it lacked the proper PHY initialization.

* fix: crashing end()

Fixes a crash when calling end()

end() treminanates the `tx_ring_buf` but it was not tested for NULL in the ISR and in the cdc0_write_char() causing a crash if those are used. This depends on events and happens eventually.

* reduces number of debug messages

* fix git stash/commit added lines

* fixes usb_phy_ll include and call

* roll back

* solves HWSerial initialization

* fixes C6|H2 issue

issue with `if(Serial)` not working always

* github commit problem

* fixes
2024-03-14 11:51:41 +02:00
Lucas Saavedra Vaz
dce754b693
Improve USBVendor Example (#9349)
* Add WebUSB console

* Improve Console Page

* Improve example

* Add comments

* Add flush method

---------

Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com>
2024-03-11 15:10:46 +02:00
Rodrigo Garcia
b92ad5574a
fix: begin cts rts (#9353)
Begin() may undo a setpins() that has set RTS and/or CTS pin.
This pins are only changed with RTS and CTS.
setpins() can be called after or before begin()
when called before, begin() shall not change those pins.
2024-03-11 15:09:50 +02:00
Jan Procházka
6304aaf1c2
fix(spi): Update sck for C6,H2,C2 (#9335) 2024-03-05 14:23:50 +02:00
Rodrigo Garcia
a7fcf86826
fix: perimgr + begin (#9331)
* fix: perimgr + begin

Fixes Perimgr setup in begin()
Fixes issue with reset INTR mask preventing previous sent data to be read.
Adds a INTR mask to end() to clear all pending interrupts.

* Update cores/esp32/HWCDC.cpp

* Update cores/esp32/HWCDC.cpp

* Update cores/esp32/HWCDC.cpp

* Update cores/esp32/HWCDC.cpp

* Update cores/esp32/HWCDC.cpp

* Update cores/esp32/HWCDC.cpp

* Update cores/esp32/HWCDC.cpp

* Update cores/esp32/HWCDC.cpp

* Update HWCDC.cpp

* Update HWCDC.cpp

* Update cores/esp32/HWCDC.cpp

* Update cores/esp32/HWCDC.cpp

* Update cores/esp32/HWCDC.cpp

* Update cores/esp32/HWCDC.cpp
2024-03-05 14:22:44 +02:00
Jason2866
5bcaf99ffd
Fix compile branch master as Arduino as component with latest IDF 5.1 (#9322)
* Fix compile with Lib Builder

with latest IDF 5.1.

* change function name
2024-03-05 11:02:10 +02:00
Andrew Dunai
629ffc55ed
fix(hal): force spiTransaction to update clock line immediately (#9221) (#9333) 2024-03-05 11:01:06 +02:00
Jason2866
20859d0be4
Update binary.h (#9323) 2024-03-05 10:54:00 +02:00
Rodrigo Garcia
58b9f079d2
HardwareSerial Available For Write (#9319)
* feat(uart): setBufferSize 

It makes sure that setting TX buffer size will match availableForWrite() response. It also sets the buffer to the minimum instead of doing nothing and returning an error.

For RX Buffer, it sets the minimum and also don't return an error.

This makes the APIs better and easy to understand its results.

* feat: sets TX buffer 

This will allow to set TX buffer to a minimum with no error message.
It also makes it works as in the Arduino API specification that is to return the buffer available space. In ESP32 case it will be the minmum the HW TX FIFO size of 128 bytes.

* feat: adjust availableForWrite

This change will make sure that if no TX Ringbuffer is used, it will return the UART FIFO available space. Otherwise, it will return the Ringbuffer available space, as defined in the Arduino especification.
2024-03-05 10:53:14 +02:00
Rodrigo Garcia
2fdd901639
fixes default 100ms delay with HWCDC write() is CDC is not connected (#9307)
* feat(hwcdc): fix delay

Fixes delay when CDC is disconnected. At this time is only fixes it when USB cable is unplugged.

* feat(hwcdc): fix delay

fixes delay when CDC is not connected. It was only considering when the USB cable was not plugged.

* feat(hwcdc): add 2 methods

Adds 2 new methods:
- isPlugged() will return true when USB cable is plugged, false otherwise.
- isConnected() will return true when USB CDC is connected to a application in the USB Host side and communication is stablished.

* feat(hwcdc): adjusts APIs

Fixes the example to use the new added APIs for checking if USB cable is plugged and for checking if CDC is connected.

* fixes api declaration

* fixes API declaration
2024-02-29 08:40:28 +02:00
Rodrigo Garcia
b7af090f71
Fixes the hardware cdc jtag plugged/unplugged status and related timeout/delay (#9275)
* feat(hw_cdc):fixes the hardware cdc jtag plugged/unplugged status

This will use a new IDF 5.1 feature to detect if the USB HW CDC is plugged or not. This can be checked testing HWCDCSerial.
It also fixes issues related to timeout or delays while writing to the HW Serial when USB is unplugged.

* feat(usb): Creates HWSerial_Events.ino example

* feat: adds .skip.esp32

Skips the ESP32 SoC test given that it has no USB

* feat: adds .skip.esp32s2

Skips the ESP32S2 because it has no HW CDC JTAG interface

* fix: fixes issues with Ubuntu CI 

Only compiles the example in case it is using Hardware CD and JTAG mode.

* feat(serialcdc): non block functions

modifies write and flush to do not clock in case CDC host is not connected to the CDC client from the C3/S3/C6/H2

* fix(HWCDC): changes made demands testing for CDC ON BOOT

* feat(hwcdc): Improves HWSerial_Events.ino

Improves the example by adding more information about USB being plugged and CDC being connected.

* feat(hwcdc): solves CDC connection issue

Detects correctly when CDC is or not connected. 
Deals with USB unplugged while the sketch is printing to CDD.

* Update cores/esp32/HWCDC.cpp

* Update cores/esp32/HWCDC.cpp

* Update cores/esp32/HWCDC.cpp

* Update cores/esp32/HWCDC.cpp

* Update cores/esp32/HWCDC.cpp

* Update cores/esp32/HWCDC.cpp

* Update cores/esp32/HWCDC.cpp

* Update cores/esp32/HWCDC.cpp

* Update cores/esp32/HWCDC.cpp

* Update cores/esp32/HWCDC.cpp

* Update cores/esp32/HWCDC.cpp

* Update cores/esp32/HWCDC.cpp

* Update cores/esp32/HWCDC.cpp

* Update cores/esp32/HWCDC.cpp

* Update cores/esp32/HWCDC.cpp

* Update cores/esp32/HWCDC.cpp

* Apply suggestions from code review

---------

Co-authored-by: Lucas Saavedra Vaz <32426024+lucasssvaz@users.noreply.github.com>
2024-02-28 18:14:21 +02:00
Me No Dev
22d7fc91eb
Enable USB Serial only if selected (#9294)
* Enable USB Serial only if selected

* fix examples

---------

Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com>
2024-02-27 17:32:19 +02:00
Rodrigo Garcia
f2a5041c9c
Fix(sigmaDelta): fixes sigmaDeltaAttach() when another peripheral is already attached (#9268) 2024-02-21 16:24:59 +02:00
Jan Procházka
c4b55bb9f1
feature(ledc): Add output invert option for LEDC pin + minor fixes (#9257)
* feat(ledc): Add output invert option for LEDC pin + minor fixes

* docs(ledc): Document LEDC functions in header file

* feat(ledc): Replace log2 with __builtin_ctz

* fix(ledc): Fixing free_channel for > 8 supported channels

* fix(ledc): Apply suggestions from code review

Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com>

* fix(ledc): Added freq check to ledcChangeFrequency

* docs(ledc): Fix ledc documentation formatting

* docs(migration): Add new functions to the migration guide

* docs(ledc): Fix functions name and parameters

---------

Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com>
Co-authored-by: Lucas Saavedra Vaz <32426024+lucasssvaz@users.noreply.github.com>
2024-02-21 16:15:06 +02:00
Rodrigo Garcia
1847723c6e
Update new RMT function rmtSetEOT(pin, EOT_Level) in the pin remap macros (#9266)
* Fix: adds RMT new function  to io_pin_remap list

* Fix: adds rmtSetEOT(int pin, uint8_t EOT_Level) to the new API list

* Fix: error in macro definition - left over from function signature
2024-02-20 15:13:42 +02:00
Rodrigo Garcia
7eb1ce89b4
Adds RMT End of Transmission Level API (#9238)
* RMT (featt):  adds a new function to set EOT level after RMT writing

* RMT (feat): adds new feature to set the EOT level after writing RMT channel

* adds return value to rmtSetEOT()

* adds bool return to rmtSetEOT()

* adds return value to the rmtSetEOT() function

* FIX (rmt): fixes eot_level setting using flags in the TX structure

* RMT(feat): Create RMT_EndOfTransmissionState.ino example

* Update cores/esp32/esp32-hal-rmt.h

Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com>

* Update cores/esp32/esp32-hal-rmt.c

Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com>

* Update cores/esp32/esp32-hal-rmt.c

Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com>

---------

Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com>
2024-02-14 15:26:51 +02:00
Theo Arends
bbbbec977a
Fix ESP32-Solo WDT on HTTP OTA update (#5426)
* Fix ESP32-Solo WDT on HTTP OTA update

* Fix ESP32-Solo WDT on HTTP OTA update

* Fix commits

---------

Co-authored-by: Lucas Saavedra Vaz <32426024+lucasssvaz@users.noreply.github.com>
2024-02-07 15:49:01 +02:00
Me No Dev
d59efdcecd
Rework cbuf to use FreeRTOS Ringbuffer (#7860)
* Rework cbuf to use FreeRTOS Ringbuffer

* Update cbuf.cpp

* Fix typo

* Initialize with NULL

* Implement peek method

* Add initializer

---------

Co-authored-by: Lucas Saavedra Vaz <lucas.vaz@espressif.com>
Co-authored-by: Lucas Saavedra Vaz <32426024+lucasssvaz@users.noreply.github.com>
2024-02-07 15:43:06 +02:00
Rodrigo Garcia
7d595547e8
SPI (fix): Adds SPI 3 to the ESP32-S2 and adds comments about it (#9216)
* SPI (fix): Adds SPI 3 to the ESP32-S2 and adds comments about it

* SPI (fix): added a space - typo error, simple fix.
2024-02-07 14:43:54 +02:00
safocl
7966f4ae79
Fix ambiguous for TwoWire::requestFrom() methods and align API with Arduino.cc (#8817)
* Fix ambiguous for TwoWire::requestFrom() methods.

* Remove TwoWire::begin(int) overload
Inside the function, this overload truncated the data type to a shorter one. This could break some users' hopes.

* Rewrite TwoWire with using HardwareI2C
- implement proposal https://github.com/espressif/arduino-esp32/pull/8818#issuecomment-1792191815
  to bring the HARDWARE interface into compliance

* Fix TwoWire::end() return type.

* Fix TwoWire::setClock() return type.

* Fix no return statement in the TwoWire::requestFrom.

* fix(libraries/Wire): fix bad return-statement

Remove non-void values of the return-statements in function returning 'void'.

* style(libraries/Wire): replace tabs with spaces

* refactor(libraries/Wire): use slave without support
TwoWire::begin(uint8_t address) should be available without slave
support by SoC?

* refactor(libraries/Wire): remove unused variables
Compiler reports "Wire.cpp:393:15: error: variable 'err' set but not used [-Werror=unused-but-set-variable]".

* refactor(libraries/Wire): remove unused variables
Compiler reports "Wire.cpp:337:15: error: variable 'err' set but not used [-Werror=unused-but-set-variable]".

* fix(libraries/Wire): hide slave support elements
TwoWire::user_onRequest is used only in conjunction with slave support?

* refactor(libraries/Wire): remove temporary comment

* fix(libraries/Wire): restore an accidentally deleted implementation
TwoWire::endTransmission() was accidentally deleted from a cpp file.

* refactor(libraries/Wire): return return types
In TwoWire class return return types.

* fix(libraries/Wire): fix return type

* refactor(libraries/Wire): add return statement if slave isn't supported

Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com>

* refactor(libraries/Wire): fix indentation

Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com>

* refactor(libraries/Wire): fix indentation

Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com>

* refactor(libraries/Wire): fix indentation

Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com>

* refactor(libraries/Wire): remove unnecessary empty lines

---------

Co-authored-by: Lucas Saavedra Vaz <32426024+lucasssvaz@users.noreply.github.com>
Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com>
2024-01-31 12:50:35 +02:00
Jan Procházka
23c6779d87
fix(i2c): Moved i2c pins out of CONFIG_DISABLE_HAL_LOCKS (#9164) 2024-01-23 14:10:43 +02:00
Sly Gryphon
dd712db323
fix(ledc): Add missing include for SemaphoreHandle_t (#9133) (#9134) 2024-01-19 17:23:56 +02:00
Stefan Oberhumer
9aae6f5ec2
change(MD5Builder): Const-correctness. (#9104)
* change(HashBuilder): Const-correctness

Propagate 'const' of buffer variable from underlying functions.

* Remove char* methods

---------

Co-authored-by: Lucas Saavedra Vaz <32426024+lucasssvaz@users.noreply.github.com>
2024-01-19 17:21:50 +02:00
Jan Procházka
2e5c932aeb
SPI - Allow detaching of some SPI pins without stopping SPI (#9117)
* feature(spi): Allow detach of some SPI pins

* fix(spi): Remove unnecessary check

Co-authored-by: Lucas Saavedra Vaz <32426024+lucasssvaz@users.noreply.github.com>

* feat(spi): Rename CS pin to SS to match Arduino standard

* fix(spi): Remove unnecessary checks

* remove lock from spiAttackMISO

---------

Co-authored-by: Lucas Saavedra Vaz <32426024+lucasssvaz@users.noreply.github.com>
Co-authored-by: Me No Dev <me-no-dev@users.noreply.github.com>
Co-authored-by: me-no-dev <hristo@espressif.com>
2024-01-19 17:21:19 +02:00
Rodrigo Garcia
60395ed6e7
UART: fixes begin() after a previous begin() :: deleting previous RX/TX buffers and its data (#9095)
* UART: fixes begin()

* Typo: fixes typos and some testing left over

* feat: fixes end()

* feat: adjust internal baurate

* feat: Changes CI [HardwareSerial]

 [HardwareSerial]: Changes CI to match new HardwareSerial begin() and end()

* feat: fixes auto_baudrate_test

[uart]: fixes end(void) instead of end(bool)

* feat: adjust copyright year

[fix]: adjust commentary of the copyright year
2024-01-16 15:56:57 +02:00
Dirk-Willem van Gulik
e581717bf3
Web server simplifications and handers (#7429)
* First stab ad simplyfing webserver auth and adding a handler.

* Tweaks after testing against docs and latest Library tree

* Add documentatin for callback handler

* Bodge to allow things to compile without the dependencies

* Remove dependency on sodium to make it compile with 4.4

* Fix hex conversion

* Move some common HEX functions into a static HEX class, remove those from MD5 and add some examples. This allows for the cleanup of various to/from HEX routines elsewhere.

* Remove some duplicated code

* Add simplfiied HEXBuilder under MD5Bulder to CMakefile.

* Update for 3.0.0 and QoL improvements

* Remove examples that depend on external libraries

* Skip H2 testing

* Formatting improvements

* Move builders examples to Utilities folder

* Fix indentation

* Add HashBuilder abstract class

* Add SHA1Builder

* Fix comment

* Fix whitespace

* Fix crashes and improve log messages

* Fix indentation for webserver

---------

Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com>
Co-authored-by: Lucas Saavedra Vaz <32426024+lucasssvaz@users.noreply.github.com>
2024-01-16 15:49:46 +02:00
Me No Dev
768719c68f
This is a continuation on the topic of adding IPv6 Support to ESP32 Arduino (#9016)
* IPv6 for Arduino 3.0.0

* Fix warning in WifiUdp

* remove comment / formating

* Add zone to IPAddress and update WiFiUDP and WiFiGeneric

* Add from ip_addr_t conversion and better toString implementation

* Use constant for IPAddress offset

@sgryphon is this better?

* Combine hostByName to support both IPv6 and IPv4 results

* implement logic to use v6 dns only when global v6 address is assigned and remove IPv6Address

* Rename softAPenableIPv6

* Rename mDNS methods

* fix IPAddress method to work with const address

* Some cleanup and do not print zone in IPAddress

* rename WiFiMulti method

* Fix AP DHCPS not properly working on recent IDF

* Add option to print the zone at the end of IPv6

@TD-er

* remove log prints from hostByName

* Use correct array length for listing IPv6 addresses

* Implement some Tasmota requirements

Added constructor that takes `const ip_addr_t *`.
Added `addr_type()` getter
Organize header to highlight the Espressif additions to IPAddress

* add 'const' to IPAddress::addr_type()

* Fix WiFiUdp not updating mapped v4 address

* Update WiFiServer.cpp

---------

Co-authored-by: Jason2866 <24528715+Jason2866@users.noreply.github.com>
Co-authored-by: s-hadinger <49731213+s-hadinger@users.noreply.github.com>
2024-01-15 15:24:34 +02:00
TANAKA Masayuki
c1a4055869
change(esp32): Added clearing of queue with unTone() (#9055)
unTone() does not stop until the queue is exhausted. Therefore, we added clearing the queue.
2024-01-08 14:59:58 +02:00
Jan Procházka
8a1e4638f7
LEDC - Allow custom channel selection (#9031)
* feat(ledc): Allow custom channel selection

* fix(ledc): Fix check of maximum channel

* docs(ledc): Add ledcAttachChannel to docs

* feat(ledc): Change channel to uint8_t + add log message
2024-01-08 14:36:56 +02:00
Rodrigo Garcia
73dd8a29a3
Fixes EspClass::deepSleep(64 bits) (#9077)
* Fixes EspClass::deepSleep(64 bits)

This will change time in microseconds from 32 bits to 64 bits as defined in IDF.

* updates function declaration
2024-01-08 14:00:04 +02:00
a1ext
f6e12eb7e9
fix(core): fixed String::lastIndexOf bug (#9003)
Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com>
Co-authored-by: Vojtěch Bartoška <76958047+VojtechBartoska@users.noreply.github.com>
2023-12-20 16:54:04 +02:00
Rodrigo Garcia
edf5ecffc8
Fixes ESP32-S2 CDC Debug Logging (#7284) 2023-12-20 16:25:12 +02:00
Rodrigo Garcia
e9ee9c118b
Improve Log Messages in GPIO HAL (#9011)
* Improve Log Messages

* uses pin# in log messages

* Uses IO # in messages
2023-12-19 22:12:40 +02:00
Jan Procházka
c7a109bac4
feat: add functions to enable/disable GPIOs interrupt (#9025) 2023-12-19 22:11:48 +02:00
Sly Gryphon
44f83b0455
Add v6 support to IPAddress to match ArduinoCore-API (#7174)
* feat(ipaddress): add support for ipv6 type, following arduinocore api

* feat(ipaddress): align with latest arduinocore api

---------

Co-authored-by: Me No Dev <me-no-dev@users.noreply.github.com>
2023-12-18 14:19:12 +02:00
David McCurley
02b384a54a
Replace new with malloc for non-class calls (#7868)
* Resolve potential crashes

* Update Esp.cpp

Resolved possible crash in EspClass::getSketchMD5().
2023-12-13 10:22:54 +02:00
Jan Procházka
158bcf692d
Add 120Mhz cpu frequency option to setCpuFrequencyMhz() (#8956)
* Allow setting 120MHz cpu freq

* add 120MHz to C6 frequency menu
2023-12-05 10:59:12 +02:00
RefactorFactory
9a9ec09f63
Make USBHIDKeyboard work at boot (#6964)
1. Like a real keyboard, the USB interface descriptor will have an interface
   subclass of boot and an interface protocol of keyboard. This will cause
   some PC BIOS to send a SET PROTOCOL BOOT request to the device.

2. When the device sends reports to the host, if the host requested boot
   protocol, don't send a report ID because boot protocol does not use report
   IDs.

3. To work with some simple PC BIOS:
   a. Use endpoint address of 1 for input and output.
   b. Use separate reports for the shift key. These extra reports can be
      disabled by calling USBHIDKeyboard::setShiftKeyReports(false).

Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com>
Co-authored-by: Me No Dev <me-no-dev@users.noreply.github.com>
Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com>
2023-11-30 20:53:25 +02:00
Luca Burelli
e97a519032
fix: pin_remap: make periman APIs private and non-remapped (#8940)
Turns out that disabling the periman APIs from remap has a negligible
effect on the source: the core is already excluded from remapping, as
are most of the libraries. It's also expected to be a private API not
exposed by default.
This patch removes it from both esp32-hal.h and io_pin_remap.h,
adjusting the relevant libraries.
2023-11-29 16:46:03 +02:00
Christian Ferbar
dbf0b18d49
Bluetooth-classic: release BLE memory when BT classic only is requested (#8051)
* esp32-hal-bt.c free Bluetooth LE memory if CONFIG_BTDM_CONTROLLER_MODE_BR_EDR_ONLY is set

BLE memory can be released if bluetooth-classic - only is requested

* tStart( add error output

* ble mem_release only for esp32

* disable BLE with BT_MODE define

* BluetoothSerial add begin()+disableBLE; add memrelease

* btStart with BT_MODE parameter

* beautification

* Update BluetoothSerial.cpp fix wrong merges

---------

Co-authored-by: Me No Dev <me-no-dev@users.noreply.github.com>
2023-11-29 12:44:23 +02:00
Luca Burelli
7d26b070d7
Add support for the Arduino Nano ESP32 on 3.x branch (#8909)
* [pin_remap 1/3] platform: define ARDUINO_CORE_BUILD when building core files

* [pin_remap 2/3] core,libs: add pin remap hooks

* platform: remove previous build options if file is missing

"touch" would create the file if not present, but not delete its
contents if a previous run left the file in the build dir.

* platform: make debug_custom.json file customizable by board

* platform: fix default debug prefix

"debug.toolchain.prefix" must end with a dash, since only the tool name is
appended to this string.

The reason this is not a major issue is that the "debug_custom.json" file
(copied in the sketch directory when debugging is enabled) forces its own
prefix. And to make things more interesting, the "toolchainPrefix" entry
in that file should _not_ end with a dash.

* [pin_remap 3/3]: add Arduino Nano ESP32 board

* fix: periman: include it by default, add include guard

* fix: io_pin_remap: adjust for new perimap APIs

* fix: libraries: manually handled pin remapping files

Previously all libraries invoked either high-level APIs (transparently
remapped, like the user sketch) or low-level ESP-IDF calls (where the
remap to GPIO numbers had to be added manually).

Since 3.x, some of these are mixed (for example, periman* APIs are
remapped, while soc* are not). This must be handled by disabling the
automatic API remapping and making sure all calls use GPIO numbers.

* feat: show remapped pins in chip debug reports

---------

Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com>
Co-authored-by: Me No Dev <me-no-dev@users.noreply.github.com>
2023-11-29 12:43:59 +02:00
diplfranzhoepfinger
b303cb4571
Update RMT initialization code (#8927)
* Update RMT initialization code

- Commented out setting interrupt priority for both TX and RX configurations in the RMT initialization code.

* checks IDF version within RMT interrupt priority

---------

Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com>
2023-11-29 12:06:20 +02:00
Jan Procházka
b01775ed17
Fix ADC detach bus calibration handle error when not existing. (#8932)
* Add check if adc calibration habdle exists before deleting

* check also on adc continous detach
2023-11-29 12:05:30 +02:00
Clemens Kirchgatterer
57e8e50e1a
Fix compilation when NO_GLOBAL_SERIAL is defined. (#8933) 2023-11-29 12:04:49 +02:00
Jan Procházka
0d0d27fba8
Extend bus types and structure for Peripheral Manager (#8888)
* Extended bus types for peripheral manager

* add extra_type to peripheral manager

* Fix function call

* Fix check for no extra_type

* Add extra_type for SD and ETH CS pin

* added bus_num and bus_channel to pin structure

* update printPerimanInfo with new fields

* replaced setting bus to INIT with DetachPin call

* add defines for extra attributes

* use new required parameters in perimanSetPinBus

* function rename

* removed duplicate define

* Update print format

---------

Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com>
2023-11-25 21:26:03 +02:00
Jason2866
5d9a7a13b0
Add ESP32-C2 support (#8881)
* add c2

* Fix typo

* changes from code review

* rm hack needed to compile for c2

* rm `DARDUINO_USB_MODE=1` not needed for c2

* log_e message no RMT support

* correct log_e

* Update esp32-hal-rgb-led.c

* Add component test build for ESP32-C2

* Disable most components for ESP32-C2

* Add missing ADC SOC defines for ESP32-C2

* Add hidden board definition and fix LED pin in variant

* Add default empty zigbee libs and mode

* Change SPI default pins

* change rx1 tx1 default gpio

---------

Co-authored-by: Me No Dev <me-no-dev@users.noreply.github.com>
Co-authored-by: me-no-dev <hristo@espressif.com>
Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com>
2023-11-21 15:16:47 +02:00
Ha Thach
93909f7308
fix issue when s3 switch usb from cdc to jtag while reset to bootrom (#8880) 2023-11-17 12:51:54 +02:00
TD-er
82e5fe8a36
Add platform specific flash speed to magicFlashChipSpeed (#8864)
Various ESP32-variants like the C6, H2, etc. differ in their used flash frequencies.

Also the maximum possible flash size wasn't handled in `magicFlashChipSize`

Co-authored-by: Me No Dev <me-no-dev@users.noreply.github.com>
2023-11-13 21:38:01 +02:00
Rodrigo Garcia
de7cac11ae
Neopixel fix (#8845)
* improve neopixel definition for all boards

* Improve NeoPixel definition for all boards

* neopixelWrite uses Peirpheral Manager now

The function can now be used for many GPIOs in the same sketch by using Peripheral Manager attach/detach, not being necesary to worry about initialization.

* improve error message

* check if pin is RGB_BUILTIN

* fixes boards that don't RGB_BUILTIN
2023-11-09 23:15:10 +02:00