* 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=]
```
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
* 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.
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#6610fixes#6247fixes#4732
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>
* 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>
* 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
* 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>
* 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
* 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
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#6095Fix#6034Fix#5799Fix#5745Fix#5527Fix#5493Fix#4321Fix#4044Fix#2722Fix#2625
* 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
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.
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>
* 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
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()