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>