Commit Graph

627 Commits

Author SHA1 Message Date
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
Rodrigo Garcia
2b2c5df2fe
Fixes uart attach/detach (#8820)
* Fixes uart attach/detach

* Fixes uart logging locks

* enforces Serial0 setPins
2023-11-08 13:07:38 +02:00
Lucas Saavedra Vaz
322ba37bec
PeriMan: Improve log messages (#8812)
* Improve log messages

* Add name function

---------

Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com>
2023-11-08 13:07:04 +02:00
Lucas Saavedra Vaz
6d9ebea500
RMT: Fix RMT TX interrupt level (#8813) 2023-10-27 15:52:33 +03:00
Lucas Saavedra Vaz
49644c1c5a
CI: Add UART test (#8801) 2023-10-25 14:58:49 +03:00
Lucas Saavedra Vaz
b9fdae7b7a
UART: Change default Serial1/2 pins and move definition to header (#8800) 2023-10-25 10:52:05 +03:00
Rodrigo Garcia
9dd9bde682
Serial as a #define (#8798)
* Serial as a #define

* Typo

* fixes USBCDC declaration

* Fixes Examples

* simplifies examples

* Adds USB Serial Events

* adds error msg when ESP32 is used with USB
2023-10-25 10:50:51 +03:00
Me No Dev
730d827553
Fix RMT fail to start due to bad ISR priority
The RMT config structure was missing initializer for the ISR priority, which was causing RMT to fail to initialize.
2023-10-23 11:45:42 +03:00
Jan Procházka
819aae4061
I2S fix missing perimanSetBusDeinit() (#8782)
* add missing perimanSetBusDeinit

* fix printPerimanInfo
2023-10-20 16:36:06 +03:00
Rodrigo Garcia
a8622c4f91
HardwareSerial::end(bool) review + Baud Rate detection review and example (#8762)
* removes pin detaching from end(false)

* adds UART0 baud rate detection example

* fixes baud rate messages
2023-10-16 23:45:09 +03:00
Me No Dev
93a118c8e4
Fix Wire.setClock() causing assert (#8777)
* Fix Wire.setClock() causing assert

When Wire.setClock() is called after Wire.begin() an assert is triggered due to changes in clock calculations

* Fix typo
2023-10-16 17:50:45 +03:00
Lucas Saavedra Vaz
826a426905
Add printf method with FlashStringHelper argument (#8677) 2023-10-06 13:56:56 +03:00
Rodrigo Garcia
ab6a25ed8d
Master5.1 s3 gpio48 and platform txt review (#8726)
* variants + S3 GPIO48

* fixes unphone8.build.flash_type

* fixes unphone8.build.flash_type

* heltec board name issue step 1

* heltec board name issue step 2

* fixes defines and new boards

* final review
2023-10-06 13:50:15 +03:00
Me No Dev
9a28c93bca
Add support for custom panic handler (#8711)
* Add support for custom panic handler

* Resolve comments
2023-10-06 13:48:17 +03:00
Jan Procházka
352af86478
Analog Continuous mode API (#8715)
* Adds Analog Continuous mode API

* fix when stopping/starting ADC data are not complete

* Added example

* fix size check

* update frequency in example

* set buffer to NULL if error occurs

* add docs

* set buffer to null on error

* fix example

* update docs

* fix example

* change return value to bool type

* updated adc modes description in docs

* Add empty line at the end of sketch
2023-10-06 13:47:08 +03:00
Rodrigo Garcia
b98b52a1a8
Reorganize RS485 Mode - FlowCtrl (#8718) 2023-10-06 13:46:40 +03:00
Rodrigo Garcia
6b1933b3f2
3.0.0 - UART Peripheral Manager + Detach UART pins on begin()/setPins() (#8719)
* detach UART pins

* fixes uartEnd() call
2023-10-06 13:45:56 +03:00
Jason2866
9e52647709
include ctime needed for newest GCC (#8722) 2023-10-06 13:45:06 +03:00
Me No Dev
6f7a1ca76a
ESP-IDF v5.1 (#7733)
* Initial changes to compile under ESP-IDF v5.1

* Initial import for ESP-IDF v5.1 libs

* Update toolchain

* Update esp32-hal-psram.c

* Add missing LDs

* Update platform.txt

* Stop some CI jobs, because they will always fail

* Fix examples

* Update app_httpd.cpp

* Update ResetReason.ino

* Warnings fixes

* Added the example guideline and template (#7665)

* Added the example guideline and template

* PR review changes with some typos and grammar fixes

* Changes according to the PR review

* Added ESP32-S3 link to the datasheet (#7738)

* Update HiFreq_ADC.ino

* Replace periph_ctrl.h use because of deprecation

* Replace esp_spi_flash.h use because of deprecation

* Add includes to male mDNS::enableWorkstation compile

* Fix ssl_client mbedtls_pk_parse_key callback

* Update temperature sensor driver

* Allow sketch_utils to compile with arduino-cli

* Run CI with arduino-cli

* Fix arduino-cli CI build on Windows

* Refactor platform.txt to not use components installed through the board manager when running from git

* Initial Peripheral Manager Implementation

* Update SigmaDelta driver to use the new ESP-IDF driver API

* Small improvements to peripheral manager and SigmaDelta

* Remove deleted function from SigmaDelta header

* Update DAC driver to use the new ESP-IDF driver API

* Adds softAp(String) to make it compatible with ESP8266 (#7801)

* Fix commentary (#7800)

Minor fix based on observation done in https://github.com/espressif/arduino-esp32/issues/7795#issuecomment-1416868611

* add adafruit new board feather esp32s2 reserve tft (#7794)

* bugfix: add <stdint.h> for uint8_t to avoid compilation failure (GCC 11.2.0) (#7744)

* Adding 3rd party boards for VALTRACK-V4-VTS-ESP32-C3 & VALTRACK-V4-MFW-ESP32-C3 (#7735)

* Added VALTRACK-V4-VTS-ESP32-C3 board definition

Created pins_arduino.h & made changes to boards.txt with necessary changes

* Modified the URL

* Renamed json

* renamed all auRL

* Adding VALTRACK-V4 series board definitions

Added VALTRACK-V4-VTS-ESP32C3 & VALTRACK-V4-MFW-ESP32-C3 board variants

* Adding VALTRACK-V4 series board definitions

Added VALTRACK-V4-VTS-ESP32C3 & VALTRACK-V4-MFW-ESP32-C3 board variants

* Reverted package_esp32_index.template.json

restored package_esp32_index.template.json from edits

* Reverted package_esp32_index.template.json

Added new line to package_esp32_index.template.json

* Update Platformio CI (#7725)

* WiFiClient example fix (#7711)

* Modified WiFiClient example to use thingspeak instead of non-functionig sparkfun

* Moved instructions to README

* Fixed spelling

* Added link to S3 datasheet

---------

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

* Mirror update from Heltec repository (#7709)

Heltec updated the I2C pins in b10f4bf85d

* Fixes BLE data printing (#7699)

* Fixes BLE data printing

BLE data has no '\0' terminator, therefore it can't be printed as a regular C string.
This fix just prints the BLE data based on its length.

* Simplify printing to a single call

* split menu options + lora_32_V3 fix (#7697)

* Change header gaurd name (#7696)

* Fix Name (#7691)

Wrong name in definitions.

* Fix error in WiFiClient.cpp where the connect function fails for timeouts below 1 second (#7686)

* Update WiFiClient.cpp

This change will allow specifying connect timeouts below 1 second. Without this change, if connect timeouts under 1 second are given, the connect defaults to 0ms and fails. 
This will also allow timeouts in fractions of seconds, e.g. 1500ms. Without this change, connect timeouts are truncated to full second increments.

* Make parameter timeout_ms clear

* Change connection timeout_ms name for clarity

---------

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

* fixed the function header (#7674)

* fixed the function header

* fixed function name and paramaters

---------

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

* Ticker fix solving #6155 (#7664)

* Wrapped Ticker functions with #pragma disabling -Wcast-function-type

* Revert "Wrapped Ticker functions with #pragma disabling -Wcast-function-type"

This reverts commit 160be7e67a.

* Fixed Ticker example

* Modified Ticker example

* Fixed LED_BUILTIN err for ESP32

---------

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

* setPins fix ESP32 "specified pins are not supported by this chip." (#7646)

[ESP32: SDMMCFS::begin hardcodes the usage of slot 1, only check if the pins match slot 1 pins.]

setPins() was testing pins D1, D2 and D3 all against D1 ... fine in 1 pin mode when all are -1 not so much if you're trying to get 4 pin mode working.
I now see this function doesn't really do anything on the ESP32...accept now correctly checks that you are trying to use the slot 1 pins.

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

* Allow passing IP as connect method parameter in WiFiClientSecure and skip unnecessary host-ip conversions (#7643)

* Add LED_BUILTIN* definitions and initialization for LEDs to stop them floating. (#7636)

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

* Expand path to tinuf2 image when checking existence in platformio-build.py (#7631)

* Expand path to tinuf2 image when checking existence

* More isFiles fixed

* Remove (useless) trailing semicolon from Print.cpp (#7622)

* ADD: New variant Edgebox-ESP-100 (#7771)

* ADD: New variant Edgebox-ESP-100

* FIX: Edgebox-ESP-100 Board.txt usb mode option change back to default value as ESP32S3

* Add Crabik Slot ESP32-S3 board (#7790)

* Added Crabik Slot ESP32-S3

* Adding CPU frequency settings and removing excess from partition scheme settings

* new variant LilyGO T-Display-S3 (#7763)

* new variant LilyGO T-Display-S3

https://github.com/Xinyuan-LilyGO/T-Display-S3

* Add boards.txt definition

---------

Co-authored-by: Me No Dev <me-no-dev@users.noreply.github.com>

* Update get.py to support Apple ARM64

* Update package_esp32_index.template.json

* WString Return bool (#7774)

* Add Roboheart Hercules development board to the esp32-core (#7672)

* added Roboheart Hercules pin definitions and board.txt entries

* added package_roboheat.json for prototyping

* Roboheart Hercules pins

* Updated the pins

* Delete package_roboheart.json

* Requested changes

---------

Co-authored-by: renebohne <rene.bohne@gmail.com>

* Reword "ESP-IDF as Component" (#7812)

I think "Arduino as an ESP-IDF component" or just "As ESP-IDF component" instead of  "ESP-IDF as Component" is more correct way to name the link.

1. "ESP-IDF as Component" would imply that ESP-IDF is some sort of library for Arduino, which is (IMO) misleading, because it's true the other way around.
2. It's written as "Arduino as an ESP-IDF component" on the webpage it points to as well.

- Also I removed the capitalization from "Component" as I have not found a reason why is it capitalized.

* add new board Adafruit Feather ESP32-S3 Reverse TFT (#7811)

* Multi threading examples (tasks, queues, semaphores, mutexes) (#7660)

* Moved and renamed example ESP32/FreeRTOS to MultiThreading/BasicMultiThreading

* Added dummy files

* Modified original example

* Fixed BasicMultiThreading.ino

* Added Example demonstrating use of queues

* Extended info in BasicMultiThreading

* Renamed Queues to singular Queue

* Added Mutex example

* Added Semaphore example

* Moved info from example to README

* Moved doc from Mutex to README

* Added Queue README

* Removed unecesary text

* Fixed grammar

* Increased stack size for Sempahore example

* Added headers into .ino files

* Added word Example at the end of title in README

* removed unused line

* Added forgotten README

* Modified BasicMultiThreading example

* Added missing S3 entry in README

* moved location

* Update ESP-IDF libs

* Update CMakeLists.txt

* Update esptool to v4.4

* Add function timerAttachInterruptFlag (#7809)

* Update esptool to v4.5

* ADC refactoring (#7827)

* Adc refactored + periman implementation

Peripheral manager still needs to be checked if the implementation is right.

* switched to working solution for milivolts read

* Periman detachbus fix

* coding style

* fix CI warnings

* fix FreeRTOS example

* Update ETH.cpp

* Update FunctionalInterruptStruct.ino

* Update package_esp32_index.template.json

* Update package_esp32_index.template.json

* Fixes for the latest IDF v5.1

* update esp-idf libs and toolchain

* Turn OFF auto crystal frequency for ESP32 (needed by TWAI)

* Update examples

* Switch build to mostly use flags from files

Includes can not be done this way

* Reorganize flag files

* Optimize chip build flags further

* Revert defines from file. MBEDTLS_CONFIG_FILE does not properly expand

* Add support for includes and defines from file

* Replace old sdk path references in platform.txt

* use gcc-ar (#8013)

* Makes F_CPU generic for all SoC (#8007)

Based on CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ that is correctly defined in the sdkconfig file for each SoC.

* TIMER refactoring (#7904)

* refactor using GPtimer

* Updated timer HW test

* fix examples

* Add v2.0.7 in issue template (#7871)

* refactor using GPtimer

* Updated timer HW test

* fix examples

* Revert "Add v2.0.7 in issue template (#7871)"

This reverts commit fcc3b17d62.

* Update upload-artifact to v3 in HW CI

* Revert "Update upload-artifact to v3 in HW CI"

This reverts commit 1ba2280717.

* replace resolution with frequency

* remove count_down option

* countup removed from examples + header

* Refactored timer object

* code cleanup + examples and tests fixes

* TimerAlarm fix

---------

Co-authored-by: Vojtěch Bartoška <76958047+VojtechBartoska@users.noreply.github.com>

* [Docs] ADC and Timer API Update (+some docs fixes) (#7906)

* updated docs

* remove hall sensor docs

Removed Hall sensor documentation as its no longer supported in IDF-5

* Fixed ESPNow examples location in docs

* Last timer refactored API + gpio small fix

* AlarmWrite fix

* Fixes APLL/PLL with RTC Frequency (#8025)

log_d() was displaying APLL for any SoC, but S3 and C3 has not such option, causing compilation errors.

* Update IDF libs and fix OPI PSRAM on S3

* Add setMode function HardwareSerial.c to set the esp32 uart mode for use with RS485 auto RTS (#7935)

* Added setMode function to set the esp32 uart mode

Used to set the esp32 uart mode for use with RS485 Half Duplex and the auto RTS pin mode. This will set/clear the RTS pin output to control the RE/DE pin on most RS485 chips.

* Add Success (bool) return in some functions

* Add Success (bool) return code to some functions

* Add Success (bool) return to some functions

* Add Success (bool) return to some functions

* Fix uartSetRxTimeout return type

---------

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

* Add support for esp-elf-gdb

* WFG Crashfix (#8044)

* Update component libs

* IDF release/v5.1 (#8061)

* IDF release/v5.1 bb9200acec

* Update Esp.cpp

* IDF release/v5.1 420ebd208a

* Update esp32-hal-psram.c

* Switch SDK to be an external package

* fix path (#8096)

* Makes UART work at any APB Frequency (#8097)

Fixes HardwareSerial to work with IDF 5.1 on any CPU/APB Frequency (240MHz to 10MHZ), including user created low power modes.

* Add required callbacks for TinyUSB DFU

* Update version to 3.0.0

* Add ESP.getCoreVersion() and update ESP.getChipModel()

* Update timer hal for the latest 5.1

* Use separate RX and TX buffer sizes in HTTP client

optimizes download by allowing up to 4K packets to be received

* Rename clock tree enum name in latest 5.1

* ESP32-H4 support was removed in ESP-IDF v5.1

* IDF release/v5.1 2004bf4e11 (#8165)

* Deinit previous bus first (#8180)

* TIMER - add timer_started flag, fix timerEnd() + timer HW test (#8135)

* Add timer_started flag and stop before disable

* Fix timer HW test

* TOUCH - Peripheral manager implementation (#8129)

* Touch periman implemented

* Deinit previous bus first

* LEDC Refactoring - Peripheral manager implemented (#8126)

* LEDC periman implementation

* Fix examples

* Rework tone

* Update ledc docs

* fix missing bracket

* Update analog funtions esp32-hal.h

* Update CameraWebServer example

* Fix HiFreq_ADC example

* minor fixes - typos

* Avoid calling tone/notone when tone already runs on dif. pin

* Remove unused channels_resolution

* GPIO - Peripheral manager implementation (#8179)

* periman-implementation

* fix RGB_BUILTIN and remove space

* Enforces more consistency into Peripheral Manager (#8188)

* Avoid log_i() message the first time a bus is assigned

* Prevent operation with ESP32_BUS_TYPE_INIT

* keeps coding style

* do not print messages on INIT bus type

* [Arduino Core 3.0.0] RMT IDF5.1 Refactoring (#7994)

* RMT IDF5.1 refactoring

* Fixes initial value setting

* removed rmtRead() with user callback

* simplify/remove Read data structure

* Deep API simplification

* fixes the examples

* fix rmt.h

* adds support to APB different frequencies

* fixes CI and not defined RGB_BUILTIN

* new RMT API and examples

* fixing commentaties

* Update esp32-hal-rgb-led.c

* changes Filter API

* Fixes example with Filter API

* Update PlatformIO scripts for the upcoming 3.0 core (#8183)

* Update PlatformIO scripts for the upcoming 3.0 core

* Dynamically select proper framework-arduinoespressif32-libs package

With this change the dev-platform will be dynamically configured to
pull the latest .zip package with precompiled libraries from extracted from
package_esp32_index.template.json

* free memory on detach (#8264)

* SPI - Peripheral manager implementation  (#8255)

* spi periman implementation

* fix header file

* remove unused struct

* fix missing braces

* Update esp32-hal-rmt.c (#8216)

Optimizing Peripheral Manager Test

* I2C - Peripheral manager implementation (#8220)

* i2c-master periman initial commit

* i2c-master make detachbus static + comment remove

* i2c-slave periman implementation

* SetPinBus to INIT on i2cDeinits

* Fix slave pins deinit

* remove dbg logs

* set ret to ESP_FAIL instead of returning

* Fix warnings in hal-spi caused by pariman transition

* Update esptool.py to version 4.6

* Add platform support for ESP_SR

* Add USB Type and valid pin check to periman

* replace bus with spi->num+1 (#8279)

* Remove default pins from SPI HAL

* Add commented out handlers for esptool.js in TinyUSB CDC

For future use

* Add build defines for host os and fqbn (for debug purposes)

* Provide proper memory caps total size

* Update Esp.cpp

* SDMMC - Peripheral manager implementation (#8289)

* sdmmc periman implemented

* save pins when SOC_SDMMC_USE_IOMUX

* IDF release/v5.1 4bc762621d (#8292)

* Adds missing pinMode (#8312)

* Adds missing pinMode

The example code lacks a pinMode() to initialize the GPIO 0 (button). In Arduino Core 3.0.0, it prints an error message when trying to read a not initialized GPIO.

* Update KeyboardLogout.ino

Adds <buttonPin> to keep code standard

* Update KeyboardReprogram.ino

Adds <buttonPin> to keep code standard

* LEDC Fade implementation (#8338)

* fade API + pointer fixes

* Add fade api

* Add fade example

* update ledc docs

* remove unused variables

* fix path to example

* Adds USB to Peripheral Manager - Arduino Core 3.0.0 (#8335)

* ETHERNET - Peripheral manager implementation (#8297)

* Peripheral manager implemented

* remove unused variable

* Add all RMII pins

* fix typo

* Adds HardwareSerial to Peripheral Manager Arduino 3.0.0 (#8328)

* Do not limit ETHERNET in periman to only ESP32. SPI is also an option

* Initial support for ESP32-C6 (#8337)

* Add checks for SOC defines (#8351)

* Add checks for SOC defines

* Add SoC checks to BLE library

* fix i2c compilation error

* fix wrong placement of include

* add check to SPI library

* add check to USB library

* add checks to Wire library

* Feature/esp32h2 support (#8373)

* Initial support for ESP32H2

* Additional changes for ESP32H2

* Update libs for ESP32H2

* Fix flashing on ESP32-H2

* Fix GPIO Configs for ESP32-C6 and ESP32-H2

* Update Timer test sketch

* Fix upload flash parameters

* Use ets_write_char_uart instead of ets_printf in log_printfv

* Print full chip report when log level is sufficient (#8282)

* ESP32-C3 does not have ets_write_char_uart

* Fix BLE gap event name

* HW Testing - Pytest update (#8389)

* update tests requirements

* remove already handled components

* Update version of pytest

* Add missing ESP32-H2 to hil.yml

* Updated FreeRTOS names (#8418)

* HW Testing -  ESP32-C6 + ESP32-H2 fixes (#8404)

* add C6/H2 to tests cfg.json

* remove ,

* workflow runs-on runner by matrix

* Add need for arduino tag to select runner

* Add cryptography to requirements.txt

* Removed duplicate TX1 define for H2 (#8402)

* Fix broken examples

* Fixes RMT filter & idle timing and setup (#8359)

* Fixes Filter and Idle parameter to uint32

* Fixes Filter and Idle setup

* Fixes it to 5.1Libs branch

* fix RMT CLK source and Filter API

* fixes missing ;

* fixes missing ;

* fixes RMT example

* IDF release/v5.1 a7b62bbcaf (#8438)

* Add workflow to build executables from python scripts (#8290)

* Add workflow to build executables from python scripts

* Push binary to tools

* Enable executable signing on Windows

* Update get.py

* Push binary to tools

* Try with multiple files

* Try more actions

* Try powershell

* Restore tools so they do not get rebuilt

* Finalize scripts

* Push binary to tools

* App rollback should be after PSRAM is initialized

* Correcting RX1 to GPIO4 and TX1 to GPIO5 to be consistent with documentation. Previous pin use works but is inconsistent with C6 docs.

* Fixes Memory Leak (#8486)

* fixes preprocessor test (#8485)

* fixes preprocessor test

When using `#define USE_SOFT_AP` 
Change
`&& not USE_SOFT_AP` ==> `&& !defined(USE_SOFT_AP)`

* Adds any BLE capable device in WiFiProv.ino

Removing ESP32 restriction for BLE Provisioning.

* fix flash mode read out for C6

* Add option for custom partitions without restrictions

* SD_MMC update (#8298)

* Updated SD_MMC lib and examples

* Removed getter implementation and commented usage in examples

* squashed updates

* IDF release/v5.1 f0437b945f (#8599)

* Update package_esp32_index.template.json

* Fix printf format build error in BTAdvertisedDeviceSet.cpp

---------

Co-authored-by: Pedro Minatel <pedro.minatel@espressif.com>
Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com>
Co-authored-by: Ha Thach <thach@tinyusb.org>
Co-authored-by: Martin Turski <quiret@vfemail.net>
Co-authored-by: raviypujar <raviypujar@gmail.com>
Co-authored-by: Jason2866 <24528715+Jason2866@users.noreply.github.com>
Co-authored-by: Tomáš Pilný <34927466+PilnyTomas@users.noreply.github.com>
Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com>
Co-authored-by: Daniel Berlin <dberlin@dberlin.org>
Co-authored-by: Nima Askari (نیما عسکری) <nimaltd@yahoo.com>
Co-authored-by: rtpmsys <106180646+rtpmsys@users.noreply.github.com>
Co-authored-by: bytiful <55647551+bytiful@users.noreply.github.com>
Co-authored-by: tmfarrington <tmfarrington@users.noreply.github.com>
Co-authored-by: Krzysiek S <chris.streh@gmail.com>
Co-authored-by: surt <carl.olsson@gmail.com>
Co-authored-by: Max Scheffler <max.scheffler@pm.me>
Co-authored-by: Clemens Kirchgatterer <clemens@1541.org>
Co-authored-by: Peter Pan's Techland <twinkle-pirate@hotmail.com>
Co-authored-by: Roman <programmeofficemilkyway@gmail.com>
Co-authored-by: Eistee <Eistee82@users.noreply.github.com>
Co-authored-by: David McCurley <44048235+mrengineer7777@users.noreply.github.com>
Co-authored-by: Gaya3N25 <30388176+Gaya3N25@users.noreply.github.com>
Co-authored-by: renebohne <rene.bohne@gmail.com>
Co-authored-by: Olivér Remény <25034625+remenyo@users.noreply.github.com>
Co-authored-by: davidk88 <david.kotar@gmail.com>
Co-authored-by: Vojtěch Bartoška <76958047+VojtechBartoska@users.noreply.github.com>
Co-authored-by: James Armstrong <jamesarmstrong3@me.com>
Co-authored-by: Valerii Koval <valeros@users.noreply.github.com>
Co-authored-by: Peter G. Jensen <root@petergjoel.dk>
2023-10-05 14:54:25 +03:00
Rodrigo Garcia
cd409b2168
removes delay(10) from HardwareSerial::end() (#8634) 2023-09-15 12:18:26 +03:00
Jan Procházka
c7c975fc3f
make output_open_drain pin readable (#8592) 2023-09-01 12:20:21 +03:00
Ricardo Lipas Augusto
2173373dcc
ledc.c: Fix analogWrite() last channel available verification (#8509)
* Fix analogWrite channel available verification

The last channel allocated is number 0, which conflicted with the value given to an uninitialized pin, giving the "No more analogWrite channels available!" error when trying to use it
Pins are now given the value -1 to indicate that they are not used so channel 0 can be used without errors.

* Fix incorrect array initialization

Keeping array of zeros for `pin_to_channel` and shifting stored channel
values by +1 to keep the pin with channel 0 from being interpreted as unused.

ref: https://github.com/espressif/arduino-esp32/pull/8509#issuecomment-1676103452
2023-08-29 14:16:54 +03:00
Rodrigo Garcia
6d1706cd70 allows setting buffer size after or before begin() 2023-08-23 20:31:29 -03:00
Rodrigo Garcia
c783918289 Fixes ESP32 BT Memory Releasing 2023-08-22 21:33:25 -03:00
colincross
289c2a1405
Use SDK macros for matrix detach constants (#8345)
The constants that need to be passed to gpio_matrix_in and gpio_matrix_out
to detach an input or output pin from a peripheral vary by platform.  Use
SIG_GPIO_OUT_IDX to detach an output, and GPIO_MATRIX_CONST_ONE_INPUT
and GPIO_MATRIX_CONST_ZERO_INPUT to detach an input.  ESP32 before IDF 4.0
didn't define GPIO_MATRIX_CONST_*_INPUT, so add compatibility #defines
for GPIO_FUNC_IN_LOW/HIGH.  GPIO_FUNC_IN_LOW/HIGH exist in IDF 4.0+, but
can't be used because they have the wrong values for ESP32-C3 at least
in IDF 4.4.3 (https://github.com/espressif/esp-idf/issues/11737).
2023-07-17 13:10:23 +03:00
Rodrigo Garcia
18164e6f02
Fixes crash when calling twice end() (#8332) 2023-06-29 23:13:05 +03:00
Rodrigo Garcia
5548fbe02d
fixes ESP32-C3 WiFiProv and btInUse() (#8243) 2023-05-31 14:30:11 +03:00
Rodrigo Garcia
083db166a1
Fixes HWCDC::end() (#8247)
* Fixes HWCDC::end()

There is a missing `tx_lock = NULL;`

* Update HWCDC.cpp

Initialize rx_data_buf[] with zeros.
2023-05-31 14:11:17 +03:00
Luca Burelli
3ec5f4efa1
HardwareSerial: fix begin() lock issue on error path (#8182)
* HardwareSerial: fix begin() lock issue on error path

If the user supplied a wrong UART number, the begin() method would
return without releasing the lock. Add missing unlock call.

* removing unsed Case test

---------

Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com>
2023-05-11 16:13:36 +03:00
Dirk O. Kaar
628b668c5c
Add overloads to support __FlashStringHelper like ESP8266 has them. (#8111)
Co-authored-by: Me No Dev <me-no-dev@users.noreply.github.com>
2023-05-03 20:28:18 +03:00
David McCurley
5c92a0231b
BugFix FlashStringHelper Macros (#8147)
Revert to previous definition of `FPSTR` and `F` macros.
2023-05-03 19:49:04 +03:00
Rodrigo Garcia
a7bd6c9bc5
Fixes analogWrite (#8137)
* Fixes analogWrite

* sets cnt_channel index

* fixes TAB alligment
2023-05-03 19:46:12 +03:00
Rodrigo Garcia
85d179c63c
Apply this change to 2.0.9 (#8131)
* Fix the F_CPU frequency for the ESP32-S3

Hello, I was using the FastLED library and it was complaining about F_CPU not being defined. So, I just noticed that it is not defined for the ESP32-S3 module. So I made this change in the header file and it compiled. Therefore I wanted to propose this change to the HAL library to improve compatibility. Thank you for your time.

* Makes F_CPU generic based on the SoC frequency

Works for ESP32, ESP32C3, ESP32S2, ESP32S3

* Includes ESP32C3 in the F_CPU definition

Necessary for ESP32 Arduino Core 2.0.x based on IDF 4.4

---------

Co-authored-by: Ali Devrim OGUZ <11381547+devrim-oguz@users.noreply.github.com>
2023-05-03 19:42:55 +03:00
Dirk O. Kaar
b98255d8d1
Completely inline the helper pure abstract __FlashStringHelper class (#7941)
* Remove __FlashStringHelper from ESP32, it's not needed - all the files using it are different from their ESP8266 counterparts anyway.

* Revert removal of class __FlashStringHelper forward for continued compatibility with external libs

* Improved fix, works for libs that return const __FlashStringHelper*

* Inline all wrappers using const __FlashStringHelper*.
2023-04-06 13:32:21 +03:00
pswid
57b951a182
missing ESP32-D0WDR2-V3 added to getChipModel() (#7958)
* missing ESP32-D0WDR2-V3 added to getChipModel()

* added ESP32-D0WD-V3 variants to getChipModel()

* renamed ESP32-D2WDQ5 to ESP32-D2WD
2023-03-31 14:50:38 +03:00
Dirk O. Kaar
f275ce5563
Use enum for C++ to avoid macro pitfalls (#7926) 2023-03-31 14:32:48 +03:00
David McCurley
345e3c637a
WString Fix int64_t (#7765)
WString Fix int64_t

Fixed int64_t String support. Resolves issue #7760.

Background:
sprintf on esp32 doesn't support "%lld" parameter.  It's possible to recompile the underlying libraries to add that option, but I have an easier solution.
This has already been solved in ESP8266 version of WString by replacing sprintf() with itoa/ltoa/lltoa.

This PR does the following:
Fixes integer print issues by replacing sprintf() with itoa/ltoa/lltoa
Moves concat(long long num), concat(unsigned long long num) location (match ESP8266)
Cleans up code formatting (matches ESP8266)

Co-authored-by: Me No Dev <me-no-dev@users.noreply.github.com>
2023-02-15 14:22:30 +02:00
Rodrigo Garcia
1e3717bcdf
Adds pseudo random numbers generation (#7848) 2023-02-15 13:26:18 +02:00
Rodrigo Garcia
8873adb1a9
Sets correct code for UART baud rate detection (#7838) 2023-02-14 17:08:07 +02:00
Ha Thach
f69bbfeead
fix usb_switch_to_cdc_jtag() not re-enable USB D+ before reset (#7828) 2023-02-13 12:39:22 +02:00
davidk88
b31c9361ec
Add function timerAttachInterruptFlag (#7809) 2023-02-10 01:03:14 +02:00
David McCurley
0fa667226c
WString Return bool (#7774) 2023-02-08 11:54:32 +02:00
Clemens Kirchgatterer
d228da4a27
Remove (useless) trailing semicolon from Print.cpp (#7622) 2023-02-06 21:13:52 +02:00
Martin Turski
0c6222c0a3
bugfix: add <stdint.h> for uint8_t to avoid compilation failure (GCC 11.2.0) (#7744) 2023-02-06 14:43:22 +02:00
me-no-dev
94fd529e36 Update version prior to release 2022-12-21 18:54:30 +02:00
Rodrigo Garcia
2333df5ac6
Removes a few Warnings and fixes Math rand() to work like Arduino mainstream (#7613)
* fixes warnings and rand function

* removes extra space - style
2022-12-21 18:48:10 +02:00
Rodrigo Garcia
5dff15ce9d
Fixes inconsistencies and adds extended HardwareSerial examples (#7412)
* adds extended HardwareSerial examples

* Adds new example with Serial RxTimeout

* adds and improves Serial onReceive expamples

* adjust includes CMake - UART example

* adjust includes CMake - UART example

* fixes CMake and CI

* adds ESP/Serial to CMakeList

* adds ESP/Serial to CMakeList

* fixes demo include

* fixes BREAK demo

* fixes onReceive demo

* Changes FIFO Full criteria

Changed the "1-by-1" Serial only when baud rate is 57600 or lower.

* example code replacement

* replaces functions in hal
2022-12-21 18:47:17 +02:00
Rodrigo Garcia
1d595fd35c
Workaround for when USB CDC is unplugged (#7583)
* Workaround for when USB CDC is unplugged

* Considers default TX timeout

Sets back default TX timeout whenever USB is plugged, otherwise it is kept as zero.

* fixed left over code
2022-12-14 12:47:29 +02:00
Linar Yusupov
12038cb555
apply the same USB descriptor's iSerialNumber logic for ESP32-S2 as t… (#7563)
* apply the same USB descriptor's iSerialNumber logic for ESP32-S2 as the ESP32-S3 already has

* response on request from code reviewer
2022-12-13 12:33:49 +02:00
Rodrigo Garcia
7cbd0371e4
Improves UART reading performance (#7525)
* Improves UART reading performance

* overrides Stream::readBytes()

* fixes override signature

* adds some IDF error return  conditions
2022-12-13 11:54:07 +02:00
Rodrigo Garcia
99f66d3f87
fixes UART at lower than 80MHz | S3 C3 (#7496) 2022-12-13 11:49:59 +02:00
Sanket Wadekar
165d62472a
log_printf: Restructured log_printf for wrapping (#7567) 2022-12-12 15:01:55 +02:00
Linar Yusupov
9b880929df
do not use 'colon' sign in the iSerialNumber field of USB descriptor (#7225) 2022-12-08 11:04:21 -03:00
Jan Procházka
dbeae9480d
AnalogWrite - frequency and resolution log errors + returns (#7471)
* Added log errors + returns
* Update LEDC docs
2022-12-08 10:25:31 -03:00
Jan Procházka
9762b2392a
LEDC - AnalogWrite new API + ledcAttachPin duty fix (#7346) 2022-11-11 08:54:02 -03:00
Jan Procházka
7a76aded54
Add touch sleep wakeup API (#7439) 2022-11-09 14:17:46 -03:00
Jan Procházka
3c033236f7
[DOCS] Add TOUCH peripheral API (#7421)
* add touch.rst

* update touchRead comment in header file

* Edited examples

* typo changes + updates

* about edit
2022-11-04 09:12:52 +00:00
Rodrigo Garcia
2cebee4a40
fixes UART pin detach on end() (#7402) 2022-11-02 12:30:02 +02:00
me-no-dev
2d6ca351a3 Update Arduino version to 2.0.5 2022-09-17 08:39:27 +03:00
David McCurley
b473fc6976
Fix corrupt debug message in esp32-hal-cpu.c (#7264)
Issue: Serial data sent during frequency change is corrupted.
Fixes corrupt debug message by printing the message after the frequency change is completed.
2022-09-16 21:34:55 +03:00
Rodrigo Garcia
55d608e322
Adds noInterrupt() and interrupt() functionality (#7226)
* Adds noInterrupt() and interrupt() functionality

* Adds sei/cli

Adds back sei()/cli() macros

Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com>
2022-09-15 15:48:07 +03:00
Rodrigo Garcia
dca1a1e6b3
Changes UART ISR to only trigger on RX FIFO Full and timeout (#6930)
* Changes UART ISR to only trigger on RX FIFO Full and timeout

* changes initial RX timeout

* Eliminates extra testing for _uart != NULL

* reconfiguration with "uartSetFastReading()"

* Adds new function "uartSetFastReading()"

* changed default onReceive() behaviour

* forces User callback in case of error

* Error Code Order

Set NO_ERROR as first error code, same as ESP_OK = 0
2022-09-15 15:12:40 +03:00
Jason2866
d4d145897a
Real flash chip mode (#7239) 2022-09-14 11:54:27 +03:00
Jason2866
37cbaeccb7
Get real Flash Chip Size (#7159)
Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com>
2022-09-07 15:04:24 +02:00
Rodrigo Garcia
0130856b2a
Improves time for setting touch interrupt (#7099)
* Improves time for setting touch interrupt

* Fixes Interrupt Touchpad initialization

Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com>
2022-08-11 10:18:36 +02:00
Jan Procházka
285e898604
fixed 1bit mode duty (#7079) 2022-08-08 12:26:41 -03:00
Rodrigo Garcia
054e6b3d56
Fixes HardwareSerial::availableForWrite + setTxBufferSize (#6998) 2022-08-08 10:29:09 -03:00
Rodrigo Garcia
c996036e61
Adds an error message to HardwareSerial::setPins() (#7040)
* Adds an error message to HardwareSerial::setPins() 
In order to avoid problems if the user tries to setPins() before initializing the Serial port with begin()
2022-07-26 10:41:04 -03:00
Rodrigo Garcia
45f4bef989
Fixes Arduino Wire::begin overload (#7000)
Makes Wire::begin() fully compatible with Arduino mainstream (Master/Slave)
2022-07-26 06:53:47 -03:00
Vasko
cc8f4e5af6
Allow access to the PWM channel assigned to the Pin. Opportunity to change PWM configurations (#6992)
* Get channel assigned to the pin with analogWrite

* Respect coding standard in LEDC source file

Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com>
Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com>
2022-07-20 14:15:16 +02:00
santaimpersonator
05ae83a051
Improve RGB driver in pull #6808; solves #6968 (#6979)
* Improve RGB LED Driver

Replaces the use of the `LED_BUILTIN` variable by creating a new variable called `RGB_BUILTIN`. On boards with both a regular LED and RGB LED, this change provides functionality to control either LED.

The `LED_BRIGHTNESS` variable is changed to `RGB_BRIGHTNESS`, which aligns more closely with the `RGB_BUILTIN` variable name.

`BOARD_HAS_NEOPIXEL` is no longer necessary; it is replaced by `RGB_BUILTIN`.

* Update BlinkRGB example

Update example code for changes with the RGB driver:
- Replace `LED_BUILTIN` and `BOARD_HAS_NEOPIXEL` with `RGB_BUILTIN`
- Replace `LED_BRIGHTNESS` with `RGB_BRIGHTNESS`

* Update board variants

Update board variants for changes with the RGB driver:
- Remove `BOARD_HAS_NEOPIXEL`
- Define `RGB_BUILTIN` pin
- Replace `LED_BRIGHTNESS` with `RGB_BRIGHTNESS` to align with `RGB_BUILTIN` name

Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com>
Co-authored-by: Vojtěch Bartoška <76958047+VojtechBartoska@users.noreply.github.com>
2022-07-18 15:34:01 +02:00
Tomáš Pilný
097ff8b1f5
Implement simple RGB driver via digitalWrite; solving #6783 (#6808)
* Initial implementation of RGB driver via digitalWrite

* Moved constants to pins_arduino.h

* Changed pin definition + added example

* Wrapped BlinkRGB in #ifdef BOARD_HAS_NEOPIXEL

* Removed forgotten log from example

* Moved RGBLedWrite to new file esp32-hal-rgb-led and created pinMode in variatn.cpp

* Updated example - lowered single channel brightness to LED_BRIGHTNESS

* Changed function name from RGBLedWrite to neopixelWrite + code polishing

* Moved pinSetup portion related to RGB back to common file
2022-06-24 14:04:03 +03:00
Tomáš Pilný
29b8c873c0
Fixing Tone (#6898) 2022-06-24 13:52:29 +03:00
Me No Dev
99520f66f6
Fix fail to set single byte that contains the slave address (#6840)
Checking here really does not work when called from within `onRequest`
2022-06-07 04:50:33 +03:00
Michael Ammann
548412952b
CTS / RTS pins were swapped in this API (#6816)
espressif/esp-idf / components/driver/include/driver/uart.h defines the API:
esp_err_t uart_set_pin(uart_port_t uart_num, int tx_io_num, int rx_io_num, int **rts_io_num**, int **cts_io_num**);
uartSetPins uses that api but alls it with swapped CTS/RTS pins as its API uses a different pin ordering: 
uart_set_pin(uart->num, txPin, rxPin, **ctsPin**, **rtsPin**); 

This fixes the wrong order in the function uartSetPins
2022-05-28 01:15:53 +03:00
Earle F. Philhower, III
99ba0e1cc5
Remove -Wextra warnings (#6782)
When building the core with `-Wextra` a few locations have `case:`
fall throughs or skipped field initializers.

Add proper comments for B64 cases to avoid GCC warnings

Initialized unused fields in Tone and WiFiGeneric to avoid missing
field initializer warnings.

````
2022-05-19T17:40:42.2280300Z /home/runner/arduino_ide/hardware/espressif/esp32/cores/esp32/libb64/cdecode.c: In function 'base64_decode_block_signed':
2022-05-19T17:40:42.2282122Z /home/runner/arduino_ide/hardware/espressif/esp32/cores/esp32/libb64/cdecode.c:42:23: warning: this statement may fall through [-Wimplicit-fallthrough=]
2022-05-19T17:40:42.2283247Z          *plainchar    = (fragment & 0x03f) << 2;
2022-05-19T17:40:42.2284240Z          ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
2022-05-19T17:40:42.2285087Z /home/runner/arduino_ide/hardware/espressif/esp32/cores/esp32/libb64/cdecode.c:43:7: note: here
2022-05-19T17:40:42.2285435Z        case step_b:
2022-05-19T17:40:42.2285691Z        ^~~~
2022-05-19T17:40:42.2286515Z /home/runner/arduino_ide/hardware/espressif/esp32/cores/esp32/libb64/cdecode.c:53:23: warning: this statement may fall through [-Wimplicit-fallthrough=]
2022-05-19T17:40:42.2286932Z          *plainchar    = (fragment & 0x00f) << 4;
2022-05-19T17:40:42.2287219Z          ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
2022-05-19T17:40:42.2287609Z /home/runner/arduino_ide/hardware/espressif/esp32/cores/esp32/libb64/cdecode.c:54:7: note: here
2022-05-19T17:40:42.2287909Z        case step_c:
2022-05-19T17:40:42.2288200Z        ^~~~
2022-05-19T17:40:42.2288972Z /home/runner/arduino_ide/hardware/espressif/esp32/cores/esp32/libb64/cdecode.c:64:23: warning: this statement may fall through [-Wimplicit-fallthrough=]
2022-05-19T17:40:42.2289491Z          *plainchar    = (fragment & 0x003) << 6;
2022-05-19T17:40:42.2289745Z          ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
2022-05-19T17:40:42.2290162Z /home/runner/arduino_ide/hardware/espressif/esp32/cores/esp32/libb64/cdecode.c:65:7: note: here
2022-05-19T17:40:42.2290509Z        case step_d:
2022-05-19T17:40:42.2290714Z        ^~~~
2022-05-19T17:40:42.2482744Z /home/runner/arduino_ide/hardware/espressif/esp32/cores/esp32/libb64/cencode.c: In function 'base64_encode_block':
2022-05-19T17:40:42.2484713Z /home/runner/arduino_ide/hardware/espressif/esp32/cores/esp32/libb64/cencode.c:46:20: warning: this statement may fall through [-Wimplicit-fallthrough=]
2022-05-19T17:40:42.2485415Z              result = (fragment & 0x003) << 4;
2022-05-19T17:40:42.2486713Z              ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
2022-05-19T17:40:42.2487696Z /home/runner/arduino_ide/hardware/espressif/esp32/cores/esp32/libb64/cencode.c:47:9: note: here
2022-05-19T17:40:42.2488519Z          case step_B:
2022-05-19T17:40:42.2489175Z          ^~~~
2022-05-19T17:40:42.2492458Z /home/runner/arduino_ide/hardware/espressif/esp32/cores/esp32/libb64/cencode.c:56:20: warning: this statement may fall through [-Wimplicit-fallthrough=]
2022-05-19T17:40:42.2493351Z              result = (fragment & 0x00f) << 2;
2022-05-19T17:40:42.2494227Z              ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
2022-05-19T17:40:42.2496324Z /home/runner/arduino_ide/hardware/espressif/esp32/cores/esp32/libb64/cencode.c:57:9: note: here
2022-05-19T17:40:42.2496937Z          case step_C:
2022-05-19T17:40:42.2497261Z          ^~~~
2022-05-19T17:40:44.6354962Z /home/runner/arduino_ide/hardware/espressif/esp32/cores/esp32/Tone.cpp: In function 'void setToneChannel(uint8_t)':
2022-05-19T17:40:44.6356417Z /home/runner/arduino_ide/hardware/espressif/esp32/cores/esp32/Tone.cpp:99:5: warning: missing initializer for member 'tone_msg_t::pin' [-Wmissing-field-initializers]
2022-05-19T17:40:44.6357120Z      };
2022-05-19T17:40:44.6358732Z      ^
2022-05-19T17:40:44.6364470Z /home/runner/arduino_ide/hardware/espressif/esp32/cores/esp32/Tone.cpp:99:5: warning: missing initializer for member 'tone_msg_t::frequency' [-Wmissing-field-initializers]
2022-05-19T17:40:44.6367914Z /home/runner/arduino_ide/hardware/espressif/esp32/cores/esp32/Tone.cpp:99:5: warning: missing initializer for member 'tone_msg_t::duration' [-Wmissing-field-initializers]
2022-05-19T17:40:44.6372875Z /home/runner/arduino_ide/hardware/espressif/esp32/cores/esp32/Tone.cpp: In function 'void noTone(uint8_t)':
2022-05-19T17:40:44.6373943Z /home/runner/arduino_ide/hardware/espressif/esp32/cores/esp32/Tone.cpp:110:5: warning: missing initializer for member 'tone_msg_t::frequency' [-Wmissing-field-initializers]
2022-05-19T17:40:44.6375154Z      };
2022-05-19T17:40:44.6375825Z      ^
2022-05-19T17:40:44.6379852Z /home/runner/arduino_ide/hardware/espressif/esp32/cores/esp32/Tone.cpp:110:5: warning: missing initializer for member 'tone_msg_t::duration' [-Wmissing-field-initializers]
2022-05-19T17:40:44.6383291Z /home/runner/arduino_ide/hardware/espressif/esp32/cores/esp32/Tone.cpp:110:5: warning: missing initializer for member 'tone_msg_t::channel' [-Wmissing-field-initializers]
2022-05-19T17:40:44.6388688Z /home/runner/arduino_ide/hardware/espressif/esp32/cores/esp32/Tone.cpp: In function 'void tone(uint8_t, unsigned int, long unsigned int)':
2022-05-19T17:40:44.6389829Z /home/runner/arduino_ide/hardware/espressif/esp32/cores/esp32/Tone.cpp:128:5: warning: missing initializer for member 'tone_msg_t::channel' [-Wmissing-field-initializers]
2022-05-19T17:40:44.6390677Z      };
2022-05-19T17:40:44.6391420Z      ^
2022-05-19T17:42:00.6768353Z /home/runner/arduino_ide/hardware/espressif/esp32/libraries/WiFi/src/WiFiGeneric.cpp: In static member function 'static bool WiFiGenericClass::setDualAntennaConfig(uint8_t, uint8_t, wifi_rx_ant_t, wifi_tx_ant_t)':
2022-05-19T17:42:00.6769293Z /home/runner/arduino_ide/hardware/espressif/esp32/libraries/WiFi/src/WiFiGeneric.cpp:1333:5: warning: missing initializer for member 'wifi_ant_config_t::rx_ant_default' [-Wmissing-field-initializers]
2022-05-19T17:42:00.6769658Z      };
2022-05-19T17:42:00.6769824Z      ^
````
2022-05-27 12:39:00 +03:00
sweetlilmre
f9423ab83f
Fix timerAttachInterrupt() and timerDetachInterrupt() in esp32-hal-timer.c (#6763)
* Fix timerAttachInterrupt() and timerDetachInterrupt() for migration to IDF 4.4

* Fixing log messages as per request
2022-05-27 12:31:16 +03:00
Jan Procházka
2cb664eeec
adc fixes and improvements (#6799)
Fixed channel / unit selection for ESP32C3 (has only 5 channels on 1 adc unit).

Removed unnecessary includes.

Fixed different attenuation on channels to be taken in care in __analogReadMilliVolt.

All chips in __analogReadMilliVolts now use adc characteristics + calculation from raw to voltage as ESP32 does.
2022-05-27 12:17:51 +03:00
Me No Dev
1a7962ece8
Add option to skip image verification after OTA (#6779)
Fixes: https://github.com/espressif/arduino-esp32/issues/5871
2022-05-19 15:52:13 +03:00
Rodrigo Garcia
722c4641c4
Extends String to print 64-bit integers (#6768) 2022-05-18 11:24:03 +03:00
Gonzalo Brusco
ed33e15752
Adjustable Serial Event Task Stack Size And Priority (#6685)
* Adjustable Serial Event Task Stack Size And Priority

* Added options to Kconfig

* Added Core Affinity

* Added CONFIG_FREERTOS_UNICORE

* Removed _CONFIG from FREERTOS_UNICORE

* Fixing Core choice for OnReceive() 

Makes it alligned to changes in #6718
Also eliminates conflict with #6718 for merging

Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com>
Co-authored-by: Me No Dev <me-no-dev@users.noreply.github.com>
2022-05-13 13:57:13 +03:00
Rodrigo Garcia
1fed09bc74
Adds Arduino standard macro-functions (#6726)
* Adds Arduino standard functions

* Fixes round()

Adds Arduino basic math Macros with '_' prefix.
2022-05-11 12:57:50 +03:00
Kostis Anagnostopoulos
709029996f
fix: compiler warnings about printf-format for pointers in esp32-hal-cpu.c (#6705)
* fix(hal.cpu) compiler warn about printf-format for pointers >

warning was:
```
framework-arduinoespressif32/cores/esp32/esp32-hal-cpu.c:132:9: note: in expansion of macro 'log_e'
         log_e("not found func=%08X arg=%08X",cb,arg);
         ^~~~~
framework-arduinoespressif32/tools/sdk/esp32/include/log/include/esp_log.h:276:27: warning: format '%X' expects argument of type 'unsigned int', but argument 7 has type 'void *' [-Wformat=]

```

* fix(tone.cpp) compiler warn about printf-format for pointers >

format-str expected plain uint while `duration` is long-uint.

Warning was:
```
.../cores/esp32/esp32-hal-log.h:115:32: note: in expansion of macro 'ESP_LOG_LEVEL_LOCAL'
 #define log_d(format, ...) do {ESP_LOG_LEVEL_LOCAL(ESP_LOG_DEBUG, TAG, format, ##__VA_ARGS__);}while(0)
                                ^~~~~~~~~~~~~~~~~~~
.../cores/esp32/Tone.cpp:31:9: note: in expansion of macro 'log_d'
         log_d("Task received from queue TONE_START: _pin=%d, frequency=%u Hz, duration=%u ms", tone_msg.pin, tone_msg.frequency, tone_msg.duration);
         ^~~~~
.../tools/sdk/esp32/include/log/include/esp_log.h:276:27: warning: format '%u' expects argument of type 'unsigned int', but argument 8 has type 'long unsigned int' [-Wformat=]
```
2022-05-09 23:40:44 +03:00
Tomáš Pilný
ca77502ceb
Added compiler.warning_flags to platform.txt; fixing #6118 (#6596)
Summary

Added compiler.warning_flags to all chips in platform.txt to reflect users setting of warning level output during compilation (set up in Arduino IDE preferences)

Impact

When a warning is set to none the compilation will no longer display warnings

Related links

Solves issue #6118
2022-05-09 23:17:12 +03:00
Jan Procházka
d302091267
Changed pinMode() default interrupt type DISABLED to previously set (#6695)
* Changed in pinMode() default  intr_type

pins default configuration has intr_type =  GPIO_INTR_DISABLE
With this implementation, it will set the intr_type to previously set intr_type. It will no longer disable interrupt, when pinmode is called multiple times on same pin with interrupt enabled.
2022-05-09 23:14:59 +03:00
Jan Procházka
85ec66a4e0
fixed timer_dev definition (#6716) 2022-05-09 16:00:09 +03:00
me-no-dev
0b3f1a9fa9 Update core version 2022-05-04 18:55:21 +03:00
Rodrigo Garcia
ce2cd111a1
Fixes INADDR_NONE (#6659)
Description of Change

Fixes IPAddress INADDR_NONE declaration when using Arduino WiFi or ETH.
This symbol was defined as 0xffffffff by lwip /inet.h, making it impossible to use INADDR_NONE correctly.

This PR only works when <wifi-provisioning/wifi_config.h> has a modification to include <lwip/ip4_addr.h> instead of <lwip/inet.h>. This will be done directly to the sdk folder in the github structure and it has been fixed in IDF by a separated Merge Request. This will be reflected in the future, for good.

Tests scenarios

This PR was tested with all Arduino WiFi examples, including AsyncUDP. Also with ETH examples.
It was also tested for #6610 test cases.
Testing done for ESP32, ESP32-S2, ESP32-C3 and ESP32-S3.

Related links

fixes #6610
fixes #6247
fixes #4732
2022-04-29 11:13:07 +03:00
Me No Dev
51bf1832b8
Fix onRequest being called for every slave address (#6649)
Fixes: https://github.com/espressif/arduino-esp32/issues/5907
2022-04-28 02:31:32 +03:00
Kostis Anagnostopoulos
0dd517dc9f
enh(log) salvage TAG from ESP_IDF log-statements > (#6567)
by converting result log-rows from the 1st line to the 2nd (`NET` is the tag):
```
[ 73419][D][telelogger.cpp:915] telemetry(): state: 33C

[ 73419][D][telelogger.cpp:915] telemetry(): [NET] state: 33C
```

Co-authored-by: Me No Dev <me-no-dev@users.noreply.github.com>
2022-04-26 14:46:42 +03:00
Paul
a9d33de70e
Call i2c_set_timeout in i2cSetClock (#6537) 2022-04-26 14:45:14 +03:00
Jan Procházka
f3bdfb31f9
Touch change to init only selected GPIO. (#6609)
* Separated init for touch / channel called by touchRead()

* compile error

* Fixed touch_V2 + ISR
2022-04-26 14:34:50 +03:00
Jan Procházka
e1c9606531
Changed type of LEDC frequency from double to uint32_t (#6570) 2022-04-21 17:50:55 +03:00
Jan Procházka
fb60efd592
Change pinMode OUTPUT to INPUT_OUTPUT (#6602)
* Change OUTPUT to INPUT_OUTPUT

To match the official Arduino API.
2022-04-21 17:49:54 +03:00
Dirk O. Kaar
6cfe4613e4
Amend "GPIO refactoring (#6259)" (#6527) 2022-04-05 11:28:59 +03:00
Rodrigo Garcia
aa783e6ac4
Reordering - HardwareSerial Constructor (#6492) 2022-03-28 17:04:38 +03:00
Gonzalo Brusco
c26e3f4299
Adds HardwareSerial::setRxTimeout() (#6397)
* Adds HardwareSerial::onReceiveTimeout()

* Fixed typo

* Changes requested

* Fix eventQueueReset

* Changed _onReceiveTimeout to _rxTimeout for consistency

* Uniform uart_set_rx_timeout condition

* test _uart not NULL in eventQueueReset()

check if _uart is not NULL before using it.

* revert last commit - no need for it

reverting last change made - it is not necessary.

* adds onReceive() parameter 

In order to allow the user to choose if onReceive() call back will be called only when UART Rx timeout happens or also when UART FIFO gets 120 bytes, 
a new parameter has been added to onReceive() with the default behavior based on timeout.

    void onReceive(OnReceiveCb function, bool onlyOnTimeout = true);

   onReceive will setup a callback that will be called whenever an UART interruption occurs (UART_INTR_RXFIFO_FULL or UART_INTR_RXFIFO_TOUT)
   UART_INTR_RXFIFO_FULL interrupt triggers at UART_FULL_THRESH_DEFAULT bytes received (defined as 120 bytes by default in IDF)
   UART_INTR_RXFIFO_TOUT interrupt triggers at UART_TOUT_THRESH_DEFAULT symbols passed without any reception (defined as 10 symbos by default in IDF)
   onlyOnTimeout parameter will define how onReceive will behave:
   Default: true -- The callback will only be called when RX Timeout happens. 
                           Whole stream of bytes will be ready for being read on the callback function at once.
                           This option may lead to Rx Overflow depending on the Rx Buffer Size and number of bytes received in the streaming
            false --    The callback will be called when FIFO reaches 120 bytes and also on RX Timeout.
                           The stream of incommig bytes will be "split" into blocks of 120 bytes on each callback.
                           This option avoid any sort of Rx Overflow, but leaves the UART packet reassembling work to the Application.

* Adds onReceive() parameter for timeout only

* Adds back setRxTimeout()

* Adds setRxTimeout()

* CI Syntax error - "," missing

Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com>
2022-03-28 14:18:30 +03:00
Me No Dev
8ee5f0a11e
Esp32 s3 support (#6341)
Co-authored-by: Jason2866 <24528715+Jason2866@users.noreply.github.com>
Co-authored-by: Unexpected Maker <seon@unexpectedmaker.com>
Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com>
Co-authored-by: Tomáš Pilný <34927466+PilnyTomas@users.noreply.github.com>
Co-authored-by: Pedro Minatel <pedro.minatel@espressif.com>
Co-authored-by: Ivan Grokhotkov <ivan@espressif.com>
Co-authored-by: Jan Procházka <90197375+P-R-O-C-H-Y@users.noreply.github.com>
Co-authored-by: Limor "Ladyada" Fried <limor@ladyada.net>
2022-03-28 12:09:41 +03:00
Rodrigo Garcia
6014ff433f
Fixes USB CDC setRxBufferSize(), begin(), _onRX() (#6413)
* Fixes USB CDC setRxBufferSize(), begin(), _onRX()

* Fixes SetRxBufferSize(0) with end()

* Fixes reset when 2x call to end()

* Adds RX_OVERFLOW_EVENT and Queue Copy in setBufferSize

* changed event name to ARDUINO_USB_CDC_RX_OVERFLOW_EVENT
2022-03-28 11:40:02 +03:00
Gonzalo Brusco
77e95311e0
Adds HardwareSerial::setTxBufferSize() (#6383)
* Adds HardwareSerial::setTxBufferSize()

* uartBegin def fix

* checks TXBufferSize  as defined in IDF

Makes sure that the buffer size will not cause a reset to the board.

* Removes double value in Rx/Tx Buffer Size 

Keeps Rx/Tx buffer size as set, not doubling it. It makes the process more clear.

Co-authored-by: Rodrigo Garcia <rodrigo.garcia@espressif.com>
2022-03-28 11:37:12 +03:00
s-hadinger
8fe0efe8c0
Fix boot freeze when trying to init PSRAM on Pico D4 (#6434)
* Fix boot freeze when trying to init PSRAM on Pico D4

* Don't deconfigure GPIO16/17 in Pico D4
2022-03-23 13:10:21 +02:00
Tomáš Pilný
68daea4a4a
Implemented tone and noTone; fixes #980 (#6402)
* Implemented tone
* Tone uses queue; implemented setToneChannel
2022-03-10 17:26:30 +02:00
Rodrigo Garcia
883241229e
Allows setting only one pin (rx or tx) in the first begin() (#6394) 2022-03-10 15:33:27 +02:00
P-R-O-C-H-Y
66596fa581
Fix ledc panic’ed when wrong setup of frequency and bit width (#6371)
* Fixed LEDC panic when wrong bit widht / frequency set.

* Fixed ledc example to be working on all SOCs
2022-03-10 15:30:57 +02:00
Rodrigo Garcia
3a7dfa14db
Fixes rmtDeinit() and tests RX/TX before operations (#6369)
* Fixes rmtDeinit() and tests RX/TX before operations

* Optimizes final binary size

* Typo
2022-03-10 15:19:15 +02:00
Andreas Merkle
4da1051266
Bugfix of the following problems: Invalid variable argument list used to retrieve length. If length is greater or equal than the available buffer, a memory leak will happen because va_end() is missing. (#6360) 2022-03-02 15:25:59 +02:00
Rodrigo Garcia
7d4992a811
Adds C++ std::function to Serial.onReceive() (#6364)
* Adds C++ std::function to Serial.onReceive()

* fixes LOCK macro when disabled
2022-03-02 15:20:43 +02:00
Verkehrsrot
c2e5957f35
Update esp32-hal-log.h (#6358)
#ifdef added, to avoid compiler redefinition warnings for LOG_LOCAL_LEVEL if defined by application, and we USE_ESP_IDF_LOG
2022-02-28 16:50:07 +02:00
Verkehrsrot
4f7e88a177
Fixes build error if TAG is const (#6351) 2022-02-28 14:30:33 +02:00
P-R-O-C-H-Y
a57cac63e4
Timer API docs + esp32-hal-timer.h edit (#6335) 2022-02-23 15:59:20 +02:00
Rodrigo Garcia
50e9772ecf
Fixes UART pin setting + adds CTS/RTS HW Flow Control (#6272)
* fixes setPins and begin to keep rx/tx unmodified

* adds Hardware Flow Control mode and CTS/RTS pin setting

* adds Hardware Flow Control mode and CTS/RTS pin setting

* adds Hardware Flow Control mode and CTS/RTS pin setting

* adds Hardware Flow Control mode and CTS/RTS pin setting

* Code Review
2022-02-17 03:28:46 +02:00
P-R-O-C-H-Y
01303b700d
ADC esp32s2 attenuation fix for DAC pins (#6282)
* ADC esp32s2 attenuation fix for DAC pins

* Use soc define instead config target
2022-02-16 15:45:06 +02:00
P-R-O-C-H-Y
c7cc5c90eb
GPIO refactoring (#6259)
* GPIO refactoring

GPIO now using ESP-IDF API on all chips.
LEDC interrupt fix removed - no longer needed.
Edited pins_arduino.h in variants according to changes in gpio.

* Edited analog channels functions
2022-02-16 14:43:38 +02:00
Rodrigo Garcia
7eec41dcb5
Fixes Touch Sensor for ESP32-S3 and any future SoC (#6234)
* Fixes digitalPinToTouchChannel() for ESP32-S3
2022-02-05 11:54:01 +02:00
P-R-O-C-H-Y
9dbc908784
FIX ledc on ESP32C3 (#6229) 2022-02-04 15:55:28 +02:00
s-hadinger
6591f5bd4c
Fix replace() failing (#6224) 2022-02-03 20:07:34 +02:00
Rodrigo Garcia
0ea485e518
Touch Sensor IDF Refactoring (#6194)
Summary

Touch Sensor refactoring to be based on IDF 4.4.
Adds support to ESP32S2 and future ESP32S3.

Adds some new APIs:

For all chips:

void touchAttachInterruptArg(uint8_t pin, void (*userFunc)(void*), void *arg, uint32_t threshold);
This function allows the user to add and pass a void* parameter to the ISR user callback.

void touchDetachInterrupt(uint8_t pin);
This function detaches ISR call back for the touch pad pin.

Only ESP32 chip

void touchInterruptSetThresholdDirection(bool mustbeLower);
This function allows the user to set if the ISR callback will be activated when the touch sensor readings are lower or higher than the threshold defined. See example TouchButton.ino.

Only ESP32-S2 and ESP32-S3 chips

bool touchInterruptGetLastStatus(uint8_t pin);
This function reports if the touch pad pin is touched or untouched. It can be used with ISR to identify when it is touched and untouched (released). See example TouchButtonV2.ino.

Impact

None. ll original APIs and examples now run on ESP32 and ESP32-S2.

Related links

Fix #6095
Fix #6034
Fix #5799
Fix #5745
Fix #5527
Fix #5493
Fix #4321
Fix #4044
Fix #2722
Fix #2625
2022-02-03 19:06:12 +02:00
IanSC
5be3ff74ea
Unnecessary operation removed from map() in WMath.cpp (#6218)
* Unneccesary Operation Removed

(A) extra operation not needed and incorrect:
      wrong by 0.5 but happens to be thrown out

     ( delta * dividend + (divisor / 2) ) / divisor

        delta * dividend     divisor
    = ---------------- + -----------
        divisor                    2 * divisor

    = delta * dividend / divisor + 1/2

(B) check first before doing other computations

(C) changed to rise/run, easier for future maintainer
      since it's closer to equation of a line

(D) before: mult, shift, add, div, add
      now: mult, div, add

(E) error message easier to trace where thrown

* Update WMath.cpp

forgot to change variable name
2022-02-01 13:26:52 +02:00
mrengineer7777
9fe34f6553
Resolve WString TODO (#6190)
Resolve TODO (XXX) by logging warning message.
2022-01-31 13:07:37 +02:00
Rodrigo Garcia
39a2080922
Fixes onReceive deadlock (#6201) 2022-01-31 13:03:43 +02:00
Rodrigo Garcia
ce68d72157
Fixes UART1 and UART2 default pins for ESP32-S3 (#6202)
Summary

This PR fixes an issue with UART1 default pins.
When using pins RX_1 = 18 and TX_1 = 17, UART1 will display a Break Error on those pins when they are floting (not connected).

It also defines RX_2 = 19 and TX_2 = 20 as default pins for UART2.

Impact

The deaulf pins may look different from the original pinout diagram.
2022-01-31 12:46:09 +02:00
P-R-O-C-H-Y
a5932064f9
Fixing interrupts in LEDC (#6160)
Fixes: #6140
2022-01-20 13:09:25 +02:00
mrengineer7777
460af2e1a5
Fix I2C Slave Compile (#6108)
I2C Slave currently doesn't compile for projects where Arduino is an IDF component.  This adds missing conditionals.

Co-authored-by: Me No Dev <me-no-dev@users.noreply.github.com>
2022-01-17 16:29:50 +02:00
Juraj Andrássy
e84e9c153e
Print.flush() - Arduino API conformance (#6084) 2022-01-17 16:12:22 +02:00
vortigont
b3b3403296
NTP Examples: revert obsolete comment and updated Time example (#6073)
* Revert "Examples update, add a note for configTime() that only one ntp server is supported by lwip",
fixed in espressif/esp32-arduino-lib-builder#51

This reverts commit 6b1020967a.

* SimpleTime: add NTPoDHCP option and TimeZone env variable
2022-01-17 16:09:58 +02:00
Rodrigo Garcia
c014eaf352
Adds UART RX IRQ Callback with onReceive() (#6134)
* Adds UART RX IRQ Callback with onReceive()
2022-01-17 16:04:12 +02:00
Rodrigo Garcia
5ae3886c66
Fixes UART MODBUS and Loopback issue (#6133) 2022-01-17 14:54:13 +02:00
Rodrigo Garcia
1bbe61ab6f
Allows user to bypass PSRAM test and boot faster with WROVER (#6135)
Fixes #5737
2022-01-17 14:47:08 +02:00
Rodrigo Garcia
841599c248
Fixes String(float) issue with Stack Smashing (#6138)
Fixes #5873
2022-01-17 14:44:49 +02:00
P-R-O-C-H-Y
caef4006af
Implement SigmaDelta based on ESP-IDF API (#6053)
Summary

This PR is refactoring of SigmaDelta HAL in order to use IDF instead of current Register manipulation approach.

Impact

Change in API:

uint32_t sigmaDeltaSetup(uint8_t channel, uint32_t freq);
changed to -->
uint32_t sigmaDeltaSetup(uint8_t pin, uint8_t channel, uint32_t freq);

void sigmaDeltaAttachPin(uint8_t pin); removed, no longer needed. Pin is attached in sigmaDeltaSetup()
2021-12-22 16:41:52 +02:00
Rodrigo Garcia
44fbde0189
Fixes Lib Builder compiling errors (#6052) 2021-12-22 14:37:40 +02:00
NiklasVoigt
8c88ecbf77
add GPIO defines for C3 (#6005) 2021-12-22 14:36:54 +02:00
Rodrigo Garcia
7cf162346a
RMT refactoring based on IDF (#6024)
Summary

RMT HAL refactoring based on IDF.

Impact

Improves RMT by adding IDF v4.4 support.
Receiving RMT can handle any size of data.
rmtInit() has a new parameter - RxBufferSize - to hold any number of data when receiving RMT.
rmtWrite() has a new parameter - wait_tx_done - to block writing until sending all data.

Related links

fix #5905
2021-12-21 15:02:40 +02:00
Rodrigo Garcia
c3d41c9b54
Fixes baudrate with CPU Freq < 80MHz (#6037)
This PR fixes an issue with UART when CPUFreq is lower than 80MHz (APB Freq)
2021-12-21 10:10:31 +02:00
P-R-O-C-H-Y
d6934a5289
Implement LEDC based on ESP-IDF API (#6045)
This PR is refactoring of LEDC HAL in order to use IDF instead of current Register manipulation approach.
Fixing duty -> if all bits in resolution are set -> FULL ON
2021-12-20 14:58:49 +02:00
Rodrigo Garcia
82ec74a072
Adds support to change LoopTask Stack size (#6025)
## Summary
Arduino ```setup()``` and ```loop()``` run under a Task with a fixed Stack size of 8KB.
Users may want to change this size.

This PR adds this possibility by just adding a line of code, as for example:
``` dart
ESP_LOOP_TASK_STACK_SIZE(16384);

void setup() { 
}

void loop() { 
}
```
## Impact
None. It adds a new functionality to ESP32 Arduino.
If ```ESP_LOOP_TASK_STACK_SIZE(newSize);``` is not declared/used, it will compile the sketch with the default stack size of 8KB.

## Related links
fix #6010 

https://github.com/espressif/arduino-esp32/issues/6010#issuecomment-992701658
Thanks @igrr for the suggestion!
2021-12-20 13:10:36 +02:00
Rodrigo Garcia
c2c8d18992
Forces UART Flush() to wait until all bits are sent (#6026)
HardwareSerial flush() was returning before all data was sent out through serial port.
This is a problem to some RS485 libraries that depend on it to signaling.

This PR solves the issue by forcing it to block flush() until all data is sent.
2021-12-15 11:08:49 +02:00
P-R-O-C-H-Y
39b9e1e533
Implement DAC based on ESP-IDF API (#5959)
This PR is refactoring of DAC HAL in order to use IDF instead of current Register manipulation approach.

Edited dacWrite() to use ESP-IDF api.
Added dacDisable() so there is an option to disable dac channel.

Co-authored-by: Me No Dev <me-no-dev@users.noreply.github.com>
2021-12-14 21:10:30 +02:00
Mike Dunston
794de50bf4
Migrate MD5Builder to use esp_rom functions directly rather than rely on wrappers that can be omitted from compilation based on sdkconfig. (#5941) 2021-12-14 15:49:43 +02:00
P-R-O-C-H-Y
5e7db8dfac
Timer based od ESP-IDF (#5931) 2021-12-14 15:46:39 +02:00
Abdelatif Guettouche
26dddc5f94
Fix the execute bit of some files. (#5986)
- Remove the execute bit from source and text files.
- on-pages.sh script needs the execute bit to be set.

Signed-off-by: Abdelatif Guettouche <abdelatif.guettouche@espressif.com>
2021-12-14 14:24:44 +02:00
Me No Dev
c9916c463f
Fix I2C clock stretching issue with ESP32 (#5910)
It was found that when I2C device is holding the clock LOW, ESP32 master is failing to wait for the clock to be released.

Fixes: #5875
Fixes: sparkfun/SparkFun_u-blox_GNSS_Arduino_Library#77
2021-11-19 18:43:59 +02:00
Frank
bd2be80b54
cbuf: allow inheritance (#5883)
changes "private" vars to "protected" so that descendants are allowed to access them.
2021-11-18 14:25:04 +02:00
Me No Dev
96c184d213
Add basic analogWrite support based on LEDC (#5861) 2021-11-09 10:26:41 +02:00
Frank
79e0889a16
Allow use of log_x() in if (#5844)
if (1) log_e("error") produces a warning ("missing braces") and probably wrong code if no log level is defined.
This fixes that.
2021-11-04 14:25:44 +02:00
Frank
bb50046540
Fix double promotion in Stream::parseFloat() (#5846) 2021-11-04 14:24:28 +02:00