Commit Graph

476 Commits

Author SHA1 Message Date
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
Frank
10258b4cc2
fix double promotions in rmtSetTick() (#5847) 2021-11-04 14:24:14 +02:00
P-R-O-C-H-Y
aabbed0bbc
analogRead() now return value according to value set in analogReadResulotion() (#5776)
Function analogReadResolution set how many bits will analogRead return.

Find out that this functionality was added back 2017 by @me-no-dev in #161.

Related issues:
#5163
2021-10-24 13:01:05 +03:00
Me No Dev
ed53b6c8d4
Merge pull request #5746 from espressif/i2c-slave
I2C Slave Implementation
2021-10-14 12:52:20 +03:00
me-no-dev
2fb2ef54ce Calculate properly Firmware MSC fat table sectors 2021-10-13 15:39:36 +03:00
me-no-dev
b145e65975 API Optimizations
- Support Wire::end() for Slave
- Prevent Master operations when in Slave mode
2021-10-11 14:46:31 +03:00
me-no-dev
f9f70d2f73 I2C Slave Implementation 2021-10-09 14:30:20 +03:00
Me No Dev
00214d5c2a
IDF master 3e370c4296
* Fix build compilation due to changes in the HW_TIMER's structs

* Fix compilation warnings and errors with USB

* Update USBCDC.cpp

* Update CMakeLists.txt

* Update HWCDC.cpp
2021-10-01 17:52:29 +03:00
me-no-dev
381e88ec75 [UART] check if write data is valid 2021-10-01 17:36:59 +03:00
Me No Dev
f87107dedb
Implement Thread-Safe I2C based on ESP-IDF API (#5683)
* Implement Thread-Safe I2C based on ESP-IDF API

* Update esp32-hal.h

* use proper types for size and timeout

* Allow disabling of the HAL locks

* Limit frequency settings to prevent Interrupt WDT
2021-10-01 17:34:20 +03:00
Ha Thach
c5bb8334d7
include pin_arduino.h for variant USB defines (#5719) 2021-10-01 16:15:15 +03:00
Carter Nelson
1688b7c179
Fix analogWidth for ESP32S2 in esp32-hal-adc.c (#5711) 2021-10-01 16:13:24 +03:00
kokke
36ff442698
bugfix: off-by-one error (#5648) 2021-10-01 15:48:35 +03:00
Clemens Kirchgatterer
91bca6c074
Fix compilation of HardwareSerial.cpp (#5677)
Fix compilation in case NO_GLOBAL_INSTANCES || NO_GLOBAL_SERIAL is defined.
2021-10-01 15:06:16 +03:00
Marius Kintel
79d53bdc4c
Update ESP.getChipModel() to support ESP32-S2 (#5598) 2021-10-01 14:37:17 +03:00
Me No Dev
078671d273
[HWCDC] Improve HW CDC Implementation (#5643)
This pull request contains a few fixes and improvements to the HWCDC implementation.
- Rework `HWCDC::write()` to accept unlimited data
- Add Semaphore to guard the TX Ring Buffer
- Add events support
- Remove unnecessary 1200bps touch for flashing over HWCDC
- Fix `HardwareSerial::setDebugOutput()` not resetting `putc` if the port is already selected, causing debug output to also show on HWCDC even when not selected.
2021-09-15 19:37:09 +03:00
Me No Dev
541cef9149
[USB CDC] Fix data might not be transmitted until more is written (#5652)
Depending on `tud_cdc_tx_complete_cb` can cause in some cases the last packet to not be transmitted until more data is written and flushed. It's a rare case, but if the other end is expecting those last bytes, transmission will hang.

This PR also fixes debug output on CDC
2021-09-15 15:23:11 +03:00
rcombs
24b76cbb14
Add string constructor and concat routines taking explicit length args (#5586)
## Summary
Applies the upstream changes here: https://github.com/arduino/ArduinoCore-API/compare/3b88acac8%5E...0d83f1afc3367037dbde5323c2abd0ae1bd2c583

## Impact
Adds new String convenience methods that are now available in the mainline Arduino implementation, simplifying interoperability with C code that uses pointer+length strings rather than 0-termination. Also includes a change to avoid mutating the source string when taking a substring.
2021-08-31 09:12:27 +03:00
Me No Dev
4a55ff970d
Add support for the hardware CDC in ESP32-C3 (#5614)
* Add support for the hardware CDC in ESP32-C3
2021-08-31 08:47:55 +03:00
Rodrigo Garcia
1f59c5abec
Adds HardwareSerial::setRxBufferSize() (#5583)
* Adds rxBufferSize parameter to begin()

* Adds HardwareSerial::setRXBufferSize()
2021-08-24 08:21:20 +03:00
Me No Dev
c45cff5f83
Implement USB HID Device Support for ESP32-S2 (#5538)
* Add support and example for USB HID Devices
* Add support and example for USB Vendor
2021-08-23 17:27:34 +03:00
Rodrigo Garcia
b1d072df9f
Implements UART SerialHardware Refactoring on top of IDF (#5549)
## Summary
This PR is a complete reffactoring of UART Serial Hardware and respective HAL in order to use IDF instead of current Register manipulation approach. 

It  implements Arduino SerialEvent functionality. 

Fix #5287  
Fix #5273 
Fix #5519 
Fix #5247 
Fix #5403
Fix #5429
Fix #5047
Fix #5463
Fix #5362 
Fix #5112  
Fix #5443 

## Impact
It solves many reported issues related to UART.
It was tested and works fine for ESP32, ESP-S2 and ESP32-C3.
2021-08-23 17:25:33 +03:00
Lori
94809ce38b
fix: timerRead() is returning the last read value, not the actual #3434 (#5498) 2021-08-23 17:19:37 +03:00
Me No Dev
90c01dab77
Fix build error in ESP-IDF
Fixes: https://github.com/espressif/arduino-esp32/issues/5562
2021-08-19 13:54:10 +03:00
me-no-dev
b580bb23fd Add log_buf to pretty print buffers
```
/* 0x0000 */ 0x7b, 0x7b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,    // {{..............
/* 0x0010 */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,    // ................
```
2021-08-17 17:01:16 +03:00
Rodrigo Garcia
2af8cc3485
Fixes Touchpad Interrupt (#5527)
Fixes #5493 

## Summary
PR #4996 has broken Touch Interrupt functionality by removing a single line of code used to set a Register.


## Impact
This PR fixes issue #5493 by reverting the removal of necessary code as described above.
2021-08-12 10:05:47 +03:00
Me No Dev
e5bd18d6aa
Fix I2C Scan for S2 and C3 (#5528)
Thanks @chegewara

I2C Scan was failing because i2c_master_write does not accept size of 0. This change checks and skips that call if no length is provided (usually when scanning)
2021-08-12 10:03:33 +03:00
Me No Dev
0b0dfab3cf
Fix race in log_printf (#5523)
Fixes: https://github.com/espressif/arduino-esp32/issues/5513

Can still race if Serial.begin() is not called in setup()
2021-08-11 13:46:08 +03:00
Me No Dev
5fd737925f
Fix wrong attenuation being set to pins (#5522)
Fixes: https://github.com/espressif/arduino-esp32/issues/5503
2021-08-11 13:05:26 +03:00
Me No Dev
5bb8177aa1
Add initial support for USB MSC (#5466)
* Add initial support for USB MSC

* Add Firmware Upload/Download With MSC

Current running firmware is available as file inside the MSC Disk. To update the firmware on the ESP, just copy a regular firmware bin into the drive

* Support overwriting of the firmware file

Overwriting a file is done totally differently on MacOS, Windows and Linux. This change supports it on all of them.

* Allow CDC, FirmwareMSC and DFU to be enabled on boot

* Add example ESP32-S2 USB-ONLY board

* Various device code optimizations

Added `end()` methods to MSC classes
Made begin() methods safe to be called multiple times
Optimized CDC class

* Fix CDC Connect/Disconnect detection in Arduino IDE on Windows

* Rework cdc_write

* Update ESP32-S2 board configs
2021-08-02 15:35:13 +03:00
me-no-dev
023ae75b97 Rework pulseIn to work on ESP32-C3
Fixes: https://github.com/espressif/arduino-esp32/issues/5488
2021-08-02 14:53:11 +03:00
chegewara
9406f8e464
Weaken tinyusb callbacks (#5475) 2021-07-29 14:52:30 +03:00
Rodrigo Garcia
65eafd16b5
Fixes ESP32-S2 LEDC PWM #5375 #5050 (#5452)
Fixes: #5375
Fixes: #5050
2021-07-26 20:37:44 +03:00
rtrbt
3780b5c924
Unbreak integer to string conversion functions. (#5423) (#5438) 2021-07-26 16:06:13 +03:00
vortigont
34125cee1d
Examples update, add a note for configTime() that only one ntp server is supported by lwip (#5343)
lwip lib bundled with esp32 Arduino supports only one ntp server. Any additional servers set are just silently ignored.
This default is different from esp8266 Arduino core and very confusing. Most of the examples provided uses 3 different ntp servers for redundancy while only the first one is used actually.
Addressing issue #4964
2021-07-22 20:09:28 +03:00
Rodrigo Garcia
5458df0a54
Fixes Serial.end() hanging on ESP32-S2 (#5434)
Fixes: #5429
2021-07-21 17:02:06 +03:00
me-no-dev
4ada3f5804 Fix Windows USB issues
- Device will not reset if previous baudrate was not 9600
- CDC Device is not recognized if WebUSB is enabled
2021-07-20 13:36:27 +03:00
Me No Dev
268595c743
Various USB fixes (#5422)
* Fix compile archive arguments for the new toolchain

* Add menu to S2 for picking through which port to upload

Internal USB CDC requires to reset and wait for the new port (because persistence is not yet stable)

* USB CDC should also be started in main

* Fix URL and USB version for WebUSB

* Update vendor callback API

* Update CDC::write to use TX_DONE semaphore

* Update USB_Serial example
2021-07-20 11:59:13 +03:00
Me No Dev
16f4b0f5ba
IDF master d93887f9f (#5336)
* Update toolchain

* Update package_esp32_index.template.json

* add optional component dependencies after Kconfig options are known (#5404)

Until this commit, Kconfig options (e.g. CONFIG_TINYUSB_ENABLED) were
used in conditions preceding idf_component_register to determine which
components need to be added to `arduino` component requirements.
However the Kconfig options aren't known at the early expansion stage,
when the component CMakeLists.txt files are expanded the first time
and requirements are evaluated. So all the conditions evaluated as if
the options were not set.
This commit changes the logic to only add these components as
dependencies when the Kconfig options are known. Dependencies become
"weak", which means that if one of the components isn't included into
the build for some reason, it is not added as a dependency.
This may happen, for example, if the component is not present in the
`components` directory or is excluded by setting `COMPONENTS` variable
in the project CMakeLists.txt file.
This also ensures that if the component is not present, it will not be
added as a dependency, and this will allow the build to proceed.

Follow-up to https://github.com/espressif/arduino-esp32/pull/5391.
Closes https://github.com/espressif/arduino-esp32/issues/5319.

* IDF master d93887f9f

* PlatformIO updates for CI (#5387)

* Update PlatformIO CI build script

- Switch to the latest toolchains 8.4.0 for ESP32, ESP32S2, ESP32C3
- Use PlatformIO from master branch for better robustness

* Update package.json for PlatformIO

Co-authored-by: Ivan Grokhotkov <ivan@espressif.com>
Co-authored-by: Valerii Koval <valeros@users.noreply.github.com>
2021-07-17 01:57:49 +03:00
Ivan Grokhotkov
eac8b2def3
fix port{Input,Output,Mode}Register macros for chips with <=32 pins (#5402)
Closes https://github.com/espressif/arduino-esp32/issues/5378
2021-07-16 23:42:08 +03:00
Me No Dev
a9bd39de66
Fix pin attenuation being overwritten (#5399)
Fixes: #5041
2021-07-16 17:34:25 +03:00
Me No Dev
dd25e2b9d6
Fix some WiFi issues (#5395)
* Add back ARDUINO_EVENT_WIFI_READY

Fixes: https://github.com/espressif/arduino-esp32/issues/5315

* use strncpy and strncmp for WiFi SSID and Password in AP and STA

Fixes: https://github.com/espressif/arduino-esp32/issues/5367

* Implement timeout for waitForConnectResult

Fixes: https://github.com/espressif/arduino-esp32/issues/5330

* Remove old definition of "reverse" from stdlib_noniso

Fixes: https://github.com/espressif/arduino-esp32/issues/5045

* Make "reverse" noniso conditional on ESP_DSP
2021-07-16 14:48:57 +03:00
Rodrigo Garcia
676f5cfe30
fix UART FIFO test for being full (#5390)
Fixes #5362
2021-07-16 03:21:49 +03:00
Rodrigo Garcia
f4f1c8956b
pinMatrixInDetach() has wrong parameter (#5385)
Fixes #5112
Call to pinMatrixInDetach() was changed from version 1.0.6 in version 2.0.0 injecting a bug as seen in cores/esp32/esp32-hal-uart.c
80418fadcf

Co-authored-by: Me No Dev <me-no-dev@users.noreply.github.com>
2021-07-15 02:07:43 +03:00
me-no-dev
cbcba53dff Improve error message when ADC2 can not be used because WiFi is On
reference: https://github.com/espressif/arduino-esp32/issues/102
2021-07-08 13:58:17 +03:00
me-no-dev
8f46bade7a Fix hardware timers
Fixes: https://github.com/espressif/arduino-esp32/issues/5337
Fixes: https://github.com/espressif/arduino-esp32/issues/4743

Thanks to @maxgerhardt
2021-06-28 15:44:30 +03:00
Clemens Kirchgatterer
21947ebe76
Make String::concat() faster for some types. (#5307)
* Make String::concat() faster for some types.

This patch removes the unneeded call to `strlen()` when concatenating some types to a `String`. Additionally it fixes some whitespace for consistency.

* Update WString.cpp
2021-06-18 13:10:40 +03:00
Jason2866
ea236e28e5
Fix incorrect Flash Size in Esp32c3 (#5279)
original PR #5278 from @s-hadinger, which is not accepted because of failure of CLAassistant

`ESP.getFlashChipSize()` always returns `0` on Esp32c3 due to a change in the Flash layout. It looks like to Espressif documentation was not updated accordingly.

https://docs.espressif.com/projects/esp-idf/en/latest/esp32c3/api-reference/storage/spi_flash.html#spi-flash-size

- Esp32 and Esp32s3 have the flash information update by esptool.py
and decribed here
- https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/storage/spi_flash.html
Esp32c3 has no image information at 0x0000 and contrary to the docu
this information is at offset 0x0000
2021-06-11 13:46:14 +03:00
lbernstone
b5ee7ddeed
Convert hall read to use hal/idf (#5268)
Fixes #4866
2021-06-10 11:58:08 +03:00
Dirk O. Kaar
77f504453f
WMath.cpp doesn't include Arduino.h, where makeWord(h, l) is declared, common denominator type therefore is uint8_t, which is in use already in Arduino.h, too. (#5230)
Fixes #5229
2021-06-09 12:40:08 +03:00
Me No Dev
a618fc1361
IDF master c13afea63 (#5214)
esp-dsp: master 7cc5073
esp-face: master 420fc7e
esp-rainmaker: f1b82c7
esp32-camera: master 6f8489e
esp_littlefs: master b58f00c
2021-05-31 16:32:51 +03:00
Ato Araki
a1d8b959b0
Fix length typo (#5189) 2021-05-18 14:01:20 +03:00