From dafdc0524965be5d89eafe4cc40cb3e3028b7711 Mon Sep 17 00:00:00 2001 From: Pedro Minatel Date: Tue, 1 Feb 2022 09:24:06 +0000 Subject: [PATCH 1/3] Docs cleanup and version updated to 2.0.2 (#6213) * Docs cleanup and version updated to 2.0.2 * Removed issue template information * Removed issue template file * Added referecnces for the issue and feature request form --- docs/ISSUE_TEMPLATE.md | 47 -------------------------------- docs/source/api/i2c.rst | 2 +- docs/source/boards/boards.rst | 9 ++---- docs/source/boards/generic.rst | 7 +---- docs/source/common/datasheet.inc | 13 +++++++++ docs/source/conf.py | 4 +-- docs/source/getting_started.rst | 19 +++++++------ docs/source/index.rst | 2 +- docs/source/libraries.rst | 18 ++---------- docs/source/tutorials/io_mux.rst | 14 ++++------ 10 files changed, 39 insertions(+), 96 deletions(-) delete mode 100644 docs/ISSUE_TEMPLATE.md create mode 100644 docs/source/common/datasheet.inc diff --git a/docs/ISSUE_TEMPLATE.md b/docs/ISSUE_TEMPLATE.md deleted file mode 100644 index 5cf96ef213b..00000000000 --- a/docs/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,47 +0,0 @@ -Make your question, not a Statement, inclusive. Include all pertinent information: - -What you are trying to do -Describe your system (Hardware, computer, O/S, core version, environment) -Describe what is failing -Show the shortest possible code that will duplicate the error -Show the EXACT error message (it doesn't work is not enough) -Then if someone is interested and knowledgeable you might get a answer. All of this work on your part shows us that you have worked to solve YOUR problem. The more complete your issue posting is, the more likely someone will volunteer their time to help you. - -If you have a Guru Meditation Error or Backtrace, ***please decode it***: -[ExceptionDecoder](https://github.com/me-no-dev/EspExceptionDecoder) - ------------------------------ Remove above ----------------------------- - - -### Hardware: -||||||| -|:---|---|---|---|---|---| -|Board|ESP32 Dev Module|node32|ttgo_lora|ESP32-S2-Saola|Custom w/ ESP32-S2-WROVER 16MB| -|Version/Date|1.0.4|2.0.0|0badbeef|11/jul/2017|today's master| -|IDE name|Arduino IDE|Atom + Platform.io|IDF component|VSCode| -|Flash Frequency|40Mhz|80Mhz| -|PSRAM enabled|yes|no| -|Upload Speed|115200| -|Computer OS|Windows 10|Mac OSX|Ubuntu| - -### Description: -Describe your problem here - - -### Sketch: (leave the backquotes for [code formatting](https://help.github.com/articles/creating-and-highlighting-code-blocks/)) -```cpp - -//Change the code below by your sketch -#include - -void setup() { -} - -void loop() { -} -``` - -### Debug Messages: -``` -Enable Core debug level: Debug on tools menu of Arduino IDE, then put the serial output here -``` diff --git a/docs/source/api/i2c.rst b/docs/source/api/i2c.rst index 4c690488e28..f53d8f27a3c 100644 --- a/docs/source/api/i2c.rst +++ b/docs/source/api/i2c.rst @@ -381,4 +381,4 @@ Here is an example of how to use the I2C in Slave Mode. .. literalinclude:: ../../../libraries/Wire/examples/WireSlave/WireSlave.ino :language: arduino -.. _Arduino Wire Library: https://www.arduino.cc/en/reference/wire \ No newline at end of file +.. _Arduino Wire Library: https://www.arduino.cc/en/reference/wire diff --git a/docs/source/boards/boards.rst b/docs/source/boards/boards.rst index 12dbe4b175d..b0376f9c398 100644 --- a/docs/source/boards/boards.rst +++ b/docs/source/boards/boards.rst @@ -98,18 +98,13 @@ Generic Vendor .. note:: Create one file per board or one file with multiple boards. Do not add board information/description on this file. +.. include:: ../common/datasheet.inc + Resources --------- -* `ESP32 Datasheet`_ (Datasheet) -* `ESP32-S2 Datasheet`_ (Datasheet) -* `ESP32-C3 Datasheet`_ (Datasheet) - .. _Espressif Systems: https://www.espressif.com .. _Espressif Product Selector: https://products.espressif.com/ -.. _ESP32 Datasheet: https://www.espressif.com/sites/default/files/documentation/esp32_datasheet_en.pdf -.. _ESP32-S2 Datasheet: https://www.espressif.com/sites/default/files/documentation/esp32-s2_datasheet_en.pdf -.. _ESP32-C3 Datasheet: https://www.espressif.com/sites/default/files/documentation/esp32-c3_datasheet_en.pdf .. |board_lolin_d32| raw:: html diff --git a/docs/source/boards/generic.rst b/docs/source/boards/generic.rst index 95bbcbeda4f..8ca4a79eace 100644 --- a/docs/source/boards/generic.rst +++ b/docs/source/boards/generic.rst @@ -26,9 +26,4 @@ Pin Layout Add here the pin layout image (not required). -Resources ---------- - -* `ESP32`_ (Datasheet) - -.. _ESP32: https://www.espressif.com/sites/default/files/documentation/esp32_datasheet_en.pdf +.. include:: ../common/datasheet.inc diff --git a/docs/source/common/datasheet.inc b/docs/source/common/datasheet.inc new file mode 100644 index 00000000000..5f68b0115ff --- /dev/null +++ b/docs/source/common/datasheet.inc @@ -0,0 +1,13 @@ +Datasheet +--------- + +* `ESP32`_ (Datasheet) +* `ESP32-S2`_ (Datasheet) +* `ESP32-C3`_ (Datasheet) +* `ESP32-S3`_ (Datasheet) + +.. _Espressif Product Selector: https://products.espressif.com/ +.. _ESP32: https://www.espressif.com/sites/default/files/documentation/esp32_datasheet_en.pdf +.. _ESP32-S2: https://www.espressif.com/sites/default/files/documentation/esp32-s2_datasheet_en.pdf +.. _ESP32-C3: https://www.espressif.com/sites/default/files/documentation/esp32-c3_datasheet_en.pdf +.. _ESP32-S3: https://www.espressif.com/sites/default/files/documentation/esp32-s3_datasheet_en.pdf diff --git a/docs/source/conf.py b/docs/source/conf.py index 33b42328007..36d9fbf4286 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -18,11 +18,11 @@ # -- Project information ----------------------------------------------------- project = 'Arduino-ESP32' -copyright = '2021, Espressif' +copyright = '2022, Espressif' author = 'Espressif' # The full version, including alpha/beta/rc tags -release = '2.0.0' +release = '2.0.2' # -- General configuration --------------------------------------------------- diff --git a/docs/source/getting_started.rst b/docs/source/getting_started.rst index 91b66b343a3..66c917283ad 100644 --- a/docs/source/getting_started.rst +++ b/docs/source/getting_started.rst @@ -34,10 +34,10 @@ Here are the ESP32 series supported by the Arduino-ESP32 project: ======== ====== =========== =================================== SoC Stable Development Datasheet ======== ====== =========== =================================== -ESP32 Yes Yes `ESP32 Datasheet`_ -ESP32-S2 Yes Yes `ESP32-S2 Datasheet`_ -ESP32-C3 Yes Yes `ESP32-C3 Datasheet`_ -ESP32-S3 No No `ESP32-S3 Datasheet`_ +ESP32 Yes Yes `ESP32`_ +ESP32-S2 Yes Yes `ESP32-S2`_ +ESP32-C3 Yes Yes `ESP32-C3`_ +ESP32-S3 No Yes `ESP32-S3`_ ======== ====== =========== =================================== See `Boards `_ for more details about ESP32 development boards. @@ -91,7 +91,9 @@ Before opening a new issue, please read this: Be sure to search for a similar reported issue. This avoids duplicating or creating noise in the GitHub Issues reporting. We also have the troubleshooting guide to save your time on the most common issues reported by users. -For more details, see the `Issue Template `_. +For more details about creating new Issue, see the `Issue Template `_. + +If you have any new idea, see the `Feature request Template `_. First Steps ----------- @@ -114,15 +116,14 @@ in the examples menu or inside each library folder. https://github.com/espressif/arduino-esp32/tree/master/libraries + +.. include:: common/datasheet.inc + Resources --------- .. _Espressif Systems: https://www.espressif.com .. _Espressif Product Selector: https://products.espressif.com/ -.. _ESP32 Datasheet: https://www.espressif.com/sites/default/files/documentation/esp32_datasheet_en.pdf -.. _ESP32-S2 Datasheet: https://www.espressif.com/sites/default/files/documentation/esp32-s2_datasheet_en.pdf -.. _ESP32-C3 Datasheet: https://www.espressif.com/sites/default/files/documentation/esp32-c3_datasheet_en.pdf -.. _ESP32-S3 Datasheet: https://www.espressif.com/sites/default/files/documentation/esp32-s3_datasheet_en.pdf .. _Arduino.cc: https://www.arduino.cc/en/Main/Software .. _Arduino Reference: https://www.arduino.cc/reference/en/ .. _ESP32 Forum: https://esp32.com diff --git a/docs/source/index.rst b/docs/source/index.rst index 60d39d8442a..02f62c30290 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -8,7 +8,7 @@ Here you will find all the relevant information about the project. This is a work in progress documentation and we will appreciate your help! We are looking for contributors! .. toctree:: - :maxdepth: 2 + :maxdepth: 1 :caption: Contents: Getting Started diff --git a/docs/source/libraries.rst b/docs/source/libraries.rst index 12dd8cfd37f..a6f37644dbd 100644 --- a/docs/source/libraries.rst +++ b/docs/source/libraries.rst @@ -64,12 +64,7 @@ Notes .. note:: Some peripherals are not available for all ESP32 families. To see more details about it, see the corresponding SoC at `Product Selector `_ page. -Datasheet -^^^^^^^^^ - -* `ESP32 `_ -* `ESP32-S2 `_ -* `ESP32-C3 `_ +.. include:: common/datasheet.inc APIs ---- @@ -78,13 +73,6 @@ The Arduino ESP32 offers some unique APIs, described in this section: .. toctree:: :maxdepth: 1 + :glob: - Bluetooth - Deep Sleep - ESPNOW - GPIO - I2C - RainMaker - Reset Reason - USB - Wi-Fi + api/* diff --git a/docs/source/tutorials/io_mux.rst b/docs/source/tutorials/io_mux.rst index 547be0e184b..8bdbb0799c3 100644 --- a/docs/source/tutorials/io_mux.rst +++ b/docs/source/tutorials/io_mux.rst @@ -62,7 +62,7 @@ JTAG Dedicated GPIOs SD/SDIO/MMC HostController Dedicated GPIOs Motor PWM Any GPIO SDIO/SPI SlaveController Dedicated GPIOs -UART Any GPIO +UART Any GPIO[1] I2C Any GPIO I2S Any GPIO LED PWM Any GPIO @@ -72,8 +72,11 @@ Parallel QSPI Dedicated GPIOs EMAC Dedicated GPIOs Pulse Counter Any GPIO TWAI Any GPIO +USB Dedicated GPIOs ============================== =================================== +[1] except for the download/programming mode decided by the bootloader. + This table is present on each datasheet provided by Espressif. Usage Examples @@ -106,16 +109,11 @@ To change the pins, we must call the ``Wire.setPins(int sda, int scl);`` functio A similar approach also applies for the other peripherals. +.. include:: ../common/datasheet.inc + Resources --------- -* `ESP32`_ (Datasheet) -* `ESP32-S2`_ (Datasheet) -* `ESP32-C3`_ (Datasheet) - .. _Espressif Systems: https://www.espressif.com .. _Espressif Product Selector: https://products.espressif.com/ -.. _ESP32: https://www.espressif.com/sites/default/files/documentation/esp32_datasheet_en.pdf -.. _ESP32-S2: https://www.espressif.com/sites/default/files/documentation/esp32-s2_datasheet_en.pdf -.. _ESP32-C3: https://www.espressif.com/sites/default/files/documentation/esp32-c3_datasheet_en.pdf .. _IO MUX GPIO: https://www.espressif.com/sites/default/files/documentation/esp32_technical_reference_manual_en.pdf#iomuxgpio From 5be3ff74ea6057c7ee35fcc0cd60defb82786ec3 Mon Sep 17 00:00:00 2001 From: IanSC <8453489+IanSC@users.noreply.github.com> Date: Tue, 1 Feb 2022 19:26:52 +0800 Subject: [PATCH 2/3] 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 --- cores/esp32/WMath.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/cores/esp32/WMath.cpp b/cores/esp32/WMath.cpp index bb75fc8a2f6..931ac96637b 100644 --- a/cores/esp32/WMath.cpp +++ b/cores/esp32/WMath.cpp @@ -67,14 +67,14 @@ long random(long howsmall, long howbig) } long map(long x, long in_min, long in_max, long out_min, long out_max) { - const long dividend = out_max - out_min; - const long divisor = in_max - in_min; - const long delta = x - in_min; - if(divisor == 0){ - log_e("Invalid map input range, min == max"); - return -1; //AVR returns -1, SAM returns 0 + const long run = in_max - in_min; + if(run == 0){ + log_e("map(): Invalid input range, min == max"); + return -1; // AVR returns -1, SAM returns 0 } - return (delta * dividend + (divisor / 2)) / divisor + out_min; + const long rise = out_max - out_min; + const long delta = x - in_min; + return (delta * rise) / run + out_min; } uint16_t makeWord(uint16_t w) From 3a96fc0e4a166a9221f4a4ab259747d484f19499 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Bohne?= Date: Tue, 1 Feb 2022 12:59:32 +0100 Subject: [PATCH 3/3] framebuffer location for no-psram boards (#6219) If board has no PSRAM, we need to set the framebuffer location to DRAM: config.fb_location = CAMERA_FB_IN_DRAM; --- .../ESP32/examples/Camera/CameraWebServer/CameraWebServer.ino | 1 + 1 file changed, 1 insertion(+) diff --git a/libraries/ESP32/examples/Camera/CameraWebServer/CameraWebServer.ino b/libraries/ESP32/examples/Camera/CameraWebServer/CameraWebServer.ino index 44ff625bf05..515391c9785 100644 --- a/libraries/ESP32/examples/Camera/CameraWebServer/CameraWebServer.ino +++ b/libraries/ESP32/examples/Camera/CameraWebServer/CameraWebServer.ino @@ -62,6 +62,7 @@ void setup() { config.frame_size = FRAMESIZE_SVGA; config.jpeg_quality = 12; config.fb_count = 1; + config.fb_location = CAMERA_FB_IN_DRAM; } #if defined(CAMERA_MODEL_ESP_EYE)