Commit 0773dd7619 from PR #10841 broke pin
remapping by moving its application too early in the definition process.
This commit restores the original order of includes, ensuring that pin
remapping is applied correctly.
Signed-off-by: Luca Burelli <l.burelli@arduino.cc>
Co-authored-by: Sugar Glider <rodrigo.garcia@espressif.com>
* Add files via upload
* Add files via upload
* Update SPI.h
* Update esp32-hal-spi.c
renamed invert_out to ss_invert to be more intuitive
* Update esp32-hal-spi.h
Removed the out from the function name spiSSInvertout.
* Update SPI.cpp
Removed the out from the function name spiSSInvertout.
* Update cores/esp32/esp32-hal-spi.c
Co-authored-by: Lucas Saavedra Vaz <32426024+lucasssvaz@users.noreply.github.com>
* ci(pre-commit): Apply automatic fixes
---------
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>
* feat(logging): Arduino log redirection
* fix(uart): log will only use ets_printf() for uart and cdc
* feat(uart_cdc): when CDC is logging, UART is silent
* feat(uart_cdc): when CDC is logging, UART is silent
* ci(pre-commit): Apply automatic fixes
---------
Co-authored-by: Sugar Glider <rodrigo.garcia@espressif.com>
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
* Add an option to force IDF's default UART clock source
* feat(uart): adds function to set clock source
* feat(uart): add uart clock source selection method
* feat(uart): add uart hall function to set the uart clock source
* feat(uart): add function to set the uart clock source
* feat(uart): set clock source as necessary
* fix(uart): missing class qualifier declaration
* fix(uart): fixing a typo and non LP UART SoC clk src setting
* fix(uart): variable name, typo error
* fix(uart): retores previous identation reducing diff load
* feat(uart): apply CONFIG_ARDUINO_SERIAL_FORCE_IDF_DEFAULT_CLOCK_SOURCE to LP UART
* feat(uart): adds option for UART_CLK_SRC_DEFAULT
* feat(uart): adds option for setting default uart clock source from IDF
* feat(uart): documents UART_CLK_SRC_DEFAULT as option in header file
* feat(uart): documents using the IDF default uart clock source
* fix(uart): type missmatch may cause error
* fix(uart): type missmatch may cause error, test for -1
* feat(uart): considering both HP and LP default uart clock source
* feat(uart): improve the defined value for UART_CLK_SRC_DEFAULT
* fix(uart): using uart_sclk_t as hal level parameter
* feat(uart): apply default LP uart clock source
* fix(uart): considers that it may set the LP UART as well
* feat(uart): using UART SCLK enum for uart clock source values
* fix(uart): using UART_CLK_SRC_RTC now
* fix(uart): documentation using UART_CLK_SRC_RTC now
* fix(uart): fix old commentary that is not correct anymore
* fix(uart): wrong identation in code line
* fix(uart): using uart number as argument instead
* fix(uart): using uart number as argument in setClockSource()
* fix(uart): using uart number as parameter in uartSetClockSource()
* feat(uart): update Kconfig.projbuild to reflect functionality
* feat(uart): removing Kconfig.projbuild option to force default clk src
* feat(uart): removes kconfig option to force uart default clk src
* fix(uart): replacing #if #endif by #if #elif #endif for the same enum
* ci(pre-commit): Apply automatic fixes
---------
Co-authored-by: Sugar Glider <rodrigo.garcia@espressif.com>
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
* feat(uart): adds a function to calculate maximum valid rx timeout
* fix(uart): check uart rx timeout value and log an error msg
* fix(uart): changes log message to a more clear one
* ci(pre-commit): Apply automatic fixes
---------
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
* fix(uart): uart begin does not set the clock source when baudrate changes
* fix(uart): returns success on baud rate change operation
* fix(code): uart typo - missing ( in the code
* fix(uart): replacing mutex lock to avoid double lock
* ci(pre-commit): Apply automatic fixes
---------
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>
* feat(gpio): allows mixing digital and analog read/write operations
* fix(gpio): simple mistake in calling __pinMode() fnuction
* fix(gpio): simple mistake in calling __pinMode() fnuction
* feat(gpio): update the log message to tell the solution for the error.
* feat(gpio): warn user about digitalRead() used with non GPIO pin
* fix(gpio): wrong peripheral manager test case
* feat(uart): adds low power uart peripheral into hardware serial class
* feat(lp_uart): pin setting for lp uart plus esp32p4 fixes
* fix(uart): keeps the test as it was before.
* fix(uart): updates the copyright year reference
* fix(uart): updates the copyright year reference
* feat(lp_uart): supports any number of lp uart port for the future
* ci(pre-commit): Apply automatic fixes
---------
Co-authored-by: Me No Dev <me-no-dev@users.noreply.github.com>
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
* feat(i2c): Add support for the new I2C driver in IDF v5.4
* fix(build): Add the new driver to CMakeLists.txt
* fix(i2c): Guard sleep retention
Not all chips can restore I2C bus after light sleep
* ci(pre-commit): Apply automatic fixes
---------
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
Fixes: #10938
Keep allocated memory when rhs fits
Use case: Appending to a String with pre-allocated memory (e.g. from `reserve()`)
No need to move 0-termination char in String::move
Simplify calls to String::copy
A lot of the same checks were done before calling `copy()` which should be done in the `copy()` function itself.
String::copy() Should not copy more than given length
Fix potential out of range in String::concat
There is no prerequisite the given array has to be a 0-terminated char array.
So we should only copy the length that has been given.
The `setLen()` function will make sure the internal string is 0-terminated.
So no need to dangerously assume there will be 1 more byte to copy
Allow String::concat(const String &s) with s.buffer() == nullptr
When constructing a String object, the internal buffer is a nullptr.
However concatenating this to another String would return `false` while this is perfectly fine to do.
* feat(cdc): Add support for two CDC ports at once
* ci(pre-commit): Apply automatic fixes
---------
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
* feat(chip): Add definition for BOOT_PIN for all chips
For use in sketches as default button
* fix(core): Make BOOT_PIN static
* fix(hal): BOOT_PIN should always be defined
* 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>
* 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>
* 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>
* 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>
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.
* 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>
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.
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.
Fixesespressif/arduino-esp32#10367.
* 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>
* 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
* 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>