diff --git a/CMakeLists.txt b/CMakeLists.txt index 14fcb19b6da..7b3579ed7b4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,9 +26,7 @@ set(CORE_SRCS cores/esp32/base64.cpp cores/esp32/cbuf.cpp cores/esp32/ColorFormat.c - cores/esp32/chip-debug-report.cpp cores/esp32/esp32-hal-adc.c - cores/esp32/esp32-hal-bt.c cores/esp32/esp32-hal-cpu.c cores/esp32/esp32-hal-dac.c cores/esp32/esp32-hal-gpio.c @@ -44,8 +42,7 @@ set(CORE_SRCS cores/esp32/esp32-hal-sigmadelta.c cores/esp32/esp32-hal-spi.c cores/esp32/esp32-hal-time.c - cores/esp32/esp32-hal-timer.c - cores/esp32/esp32-hal-tinyusb.c + cores/esp32/esp32-hal-timer.c cores/esp32/esp32-hal-touch.c cores/esp32/esp32-hal-touch-ng.c cores/esp32/esp32-hal-uart.c @@ -68,9 +65,6 @@ set(CORE_SRCS cores/esp32/StreamString.cpp cores/esp32/Tone.cpp cores/esp32/HWCDC.cpp - cores/esp32/USB.cpp - cores/esp32/USBCDC.cpp - cores/esp32/USBMSC.cpp cores/esp32/FirmwareMSC.cpp cores/esp32/firmware_msc_fat.c cores/esp32/wiring_pulse.c @@ -78,72 +72,51 @@ set(CORE_SRCS cores/esp32/WMath.cpp cores/esp32/WString.cpp ) +if(IDF_TARGET MATCHES "esp32s2|esp32s3|esp32p4" AND CONFIG_TINYUSB_ENABLED) + list(APPEND CORE_SRCS + cores/esp32/esp32-hal-tinyusb.c + cores/esp32/USB.cpp + cores/esp32/USBCDC.cpp + cores/esp32/USBMSC.cpp) +endif() set(ARDUINO_ALL_LIBRARIES ArduinoOTA AsyncUDP - BLE - BluetoothSerial DNSServer EEPROM - ESP_I2S - ESP_NOW - ESP_SR ESPmDNS Ethernet FFat FS HTTPClient HTTPUpdate - Insights LittleFS - Matter NetBIOS Network - OpenThread PPP Preferences - RainMaker SD_MMC SD - SimpleBLE - SPIFFS SPI Ticker Update - USB WebServer - NetworkClientSecure WiFi - WiFiProv Wire - Zigbee ) +if(IDF_TARGET MATCHES "esp32s2|esp32s3|esp32p4" AND CONFIG_TINYUSB_ENABLED) + list(APPEND ARDUINO_ALL_LIBRARIES USB) +endif() set(ARDUINO_LIBRARY_ArduinoOTA_SRCS libraries/ArduinoOTA/src/ArduinoOTA.cpp) set(ARDUINO_LIBRARY_AsyncUDP_SRCS libraries/AsyncUDP/src/AsyncUDP.cpp) -set(ARDUINO_LIBRARY_BluetoothSerial_SRCS - libraries/BluetoothSerial/src/BluetoothSerial.cpp - libraries/BluetoothSerial/src/BTAddress.cpp - libraries/BluetoothSerial/src/BTAdvertisedDeviceSet.cpp - libraries/BluetoothSerial/src/BTScanResultsSet.cpp) - set(ARDUINO_LIBRARY_DNSServer_SRCS libraries/DNSServer/src/DNSServer.cpp) set(ARDUINO_LIBRARY_EEPROM_SRCS libraries/EEPROM/src/EEPROM.cpp) -set(ARDUINO_LIBRARY_ESP_I2S_SRCS libraries/ESP_I2S/src/ESP_I2S.cpp) - -set(ARDUINO_LIBRARY_ESP_NOW_SRCS - libraries/ESP_NOW/src/ESP32_NOW.cpp - libraries/ESP_NOW/src/ESP32_NOW_Serial.cpp) - -set(ARDUINO_LIBRARY_ESP_SR_SRCS - libraries/ESP_SR/src/ESP_SR.cpp - libraries/ESP_SR/src/esp32-hal-sr.c) - set(ARDUINO_LIBRARY_ESPmDNS_SRCS libraries/ESPmDNS/src/ESPmDNS.cpp) set(ARDUINO_LIBRARY_Ethernet_SRCS libraries/Ethernet/src/ETH.cpp) @@ -158,49 +131,16 @@ set(ARDUINO_LIBRARY_HTTPClient_SRCS libraries/HTTPClient/src/HTTPClient.cpp) set(ARDUINO_LIBRARY_HTTPUpdate_SRCS libraries/HTTPUpdate/src/HTTPUpdate.cpp) -set(ARDUINO_LIBRARY_Insights_SRCS libraries/Insights/src/Insights.cpp) - set(ARDUINO_LIBRARY_LittleFS_SRCS libraries/LittleFS/src/LittleFS.cpp) set(ARDUINO_LIBRARY_NetBIOS_SRCS libraries/NetBIOS/src/NetBIOS.cpp) -set(ARDUINO_LIBRARY_OpenThread_SRCS - libraries/OpenThread/src/OThreadCLI.cpp - libraries/OpenThread/src/OThreadCLI_Util.cpp) - -set(ARDUINO_LIBRARY_Matter_SRCS - libraries/Matter/src/MatterEndpoints/MatterGenericSwitch.cpp - libraries/Matter/src/MatterEndpoints/MatterOnOffLight.cpp - libraries/Matter/src/MatterEndpoints/MatterDimmableLight.cpp - libraries/Matter/src/MatterEndpoints/MatterColorTemperatureLight.cpp - libraries/Matter/src/MatterEndpoints/MatterColorLight.cpp - libraries/Matter/src/MatterEndpoints/MatterEnhancedColorLight.cpp - libraries/Matter/src/MatterEndpoints/MatterFan.cpp - libraries/Matter/src/MatterEndpoints/MatterTemperatureSensor.cpp - libraries/Matter/src/MatterEndpoints/MatterHumiditySensor.cpp - libraries/Matter/src/MatterEndpoints/MatterContactSensor.cpp - libraries/Matter/src/MatterEndpoints/MatterPressureSensor.cpp - libraries/Matter/src/MatterEndpoints/MatterOccupancySensor.cpp - libraries/Matter/src/MatterEndpoints/MatterOnOffPlugin.cpp - libraries/Matter/src/MatterEndpoints/MatterThermostat.cpp - libraries/Matter/src/Matter.cpp) - set(ARDUINO_LIBRARY_PPP_SRCS libraries/PPP/src/PPP.cpp libraries/PPP/src/ppp.c) set(ARDUINO_LIBRARY_Preferences_SRCS libraries/Preferences/src/Preferences.cpp) -set(ARDUINO_LIBRARY_RainMaker_SRCS - libraries/RainMaker/src/RMaker.cpp - libraries/RainMaker/src/RMakerNode.cpp - libraries/RainMaker/src/RMakerParam.cpp - libraries/RainMaker/src/RMakerDevice.cpp - libraries/RainMaker/src/RMakerType.cpp - libraries/RainMaker/src/RMakerQR.cpp - libraries/RainMaker/src/RMakerUtils.cpp - libraries/RainMaker/src/AppInsights.cpp) - set(ARDUINO_LIBRARY_SD_MMC_SRCS libraries/SD_MMC/src/SD_MMC.cpp) set(ARDUINO_LIBRARY_SD_SRCS @@ -208,10 +148,6 @@ set(ARDUINO_LIBRARY_SD_SRCS libraries/SD/src/sd_diskio.cpp libraries/SD/src/sd_diskio_crc.c) -set(ARDUINO_LIBRARY_SimpleBLE_SRCS libraries/SimpleBLE/src/SimpleBLE.cpp) - -set(ARDUINO_LIBRARY_SPIFFS_SRCS libraries/SPIFFS/src/SPIFFS.cpp) - set(ARDUINO_LIBRARY_SPI_SRCS libraries/SPI/src/SPI.cpp) set(ARDUINO_LIBRARY_Ticker_SRCS libraries/Ticker/src/Ticker.cpp) @@ -220,26 +156,28 @@ set(ARDUINO_LIBRARY_Update_SRCS libraries/Update/src/Updater.cpp libraries/Update/src/HttpsOTAUpdate.cpp) -set(ARDUINO_LIBRARY_USB_SRCS - libraries/USB/src/USBHID.cpp - libraries/USB/src/USBMIDI.cpp - libraries/USB/src/USBHIDMouse.cpp - libraries/USB/src/USBHIDKeyboard.cpp - libraries/USB/src/keyboardLayout/KeyboardLayout_da_DK.cpp - libraries/USB/src/keyboardLayout/KeyboardLayout_de_DE.cpp - libraries/USB/src/keyboardLayout/KeyboardLayout_en_US.cpp - libraries/USB/src/keyboardLayout/KeyboardLayout_es_ES.cpp - libraries/USB/src/keyboardLayout/KeyboardLayout_fr_FR.cpp - libraries/USB/src/keyboardLayout/KeyboardLayout_hu_HU.cpp - libraries/USB/src/keyboardLayout/KeyboardLayout_it_IT.cpp - libraries/USB/src/keyboardLayout/KeyboardLayout_pt_BR.cpp - libraries/USB/src/keyboardLayout/KeyboardLayout_pt_PT.cpp - libraries/USB/src/keyboardLayout/KeyboardLayout_sv_SE.cpp - libraries/USB/src/USBHIDGamepad.cpp - libraries/USB/src/USBHIDConsumerControl.cpp - libraries/USB/src/USBHIDSystemControl.cpp - libraries/USB/src/USBHIDVendor.cpp - libraries/USB/src/USBVendor.cpp) +if(IDF_TARGET MATCHES "esp32s2|esp32s3|esp32p4" AND CONFIG_TINYUSB_ENABLED) + set(ARDUINO_LIBRARY_USB_SRCS + libraries/USB/src/USBHID.cpp + libraries/USB/src/USBMIDI.cpp + libraries/USB/src/USBHIDMouse.cpp + libraries/USB/src/USBHIDKeyboard.cpp + libraries/USB/src/keyboardLayout/KeyboardLayout_da_DK.cpp + libraries/USB/src/keyboardLayout/KeyboardLayout_de_DE.cpp + libraries/USB/src/keyboardLayout/KeyboardLayout_en_US.cpp + libraries/USB/src/keyboardLayout/KeyboardLayout_es_ES.cpp + libraries/USB/src/keyboardLayout/KeyboardLayout_fr_FR.cpp + libraries/USB/src/keyboardLayout/KeyboardLayout_hu_HU.cpp + libraries/USB/src/keyboardLayout/KeyboardLayout_it_IT.cpp + libraries/USB/src/keyboardLayout/KeyboardLayout_pt_BR.cpp + libraries/USB/src/keyboardLayout/KeyboardLayout_pt_PT.cpp + libraries/USB/src/keyboardLayout/KeyboardLayout_sv_SE.cpp + libraries/USB/src/USBHIDGamepad.cpp + libraries/USB/src/USBHIDConsumerControl.cpp + libraries/USB/src/USBHIDSystemControl.cpp + libraries/USB/src/USBHIDVendor.cpp + libraries/USB/src/USBVendor.cpp) +endif() set(ARDUINO_LIBRARY_WebServer_SRCS libraries/WebServer/src/WebServer.cpp @@ -250,10 +188,6 @@ set(ARDUINO_LIBRARY_WebServer_SRCS libraries/WebServer/src/middleware/CorsMiddleware.cpp libraries/WebServer/src/middleware/LoggingMiddleware.cpp) -set(ARDUINO_LIBRARY_NetworkClientSecure_SRCS - libraries/NetworkClientSecure/src/ssl_client.cpp - libraries/NetworkClientSecure/src/NetworkClientSecure.cpp) - set(ARDUINO_LIBRARY_Network_SRCS libraries/Network/src/NetworkInterface.cpp libraries/Network/src/NetworkEvents.cpp @@ -272,70 +206,8 @@ set(ARDUINO_LIBRARY_WiFi_SRCS libraries/WiFi/src/STA.cpp libraries/WiFi/src/AP.cpp) -set(ARDUINO_LIBRARY_WiFiProv_SRCS libraries/WiFiProv/src/WiFiProv.cpp) - set(ARDUINO_LIBRARY_Wire_SRCS libraries/Wire/src/Wire.cpp) -set(ARDUINO_LIBRARY_Zigbee_SRCS - libraries/Zigbee/src/ZigbeeCore.cpp - libraries/Zigbee/src/ZigbeeEP.cpp - libraries/Zigbee/src/ZigbeeHandlers.cpp - libraries/Zigbee/src/ep/ZigbeeColorDimmableLight.cpp - libraries/Zigbee/src/ep/ZigbeeColorDimmerSwitch.cpp - libraries/Zigbee/src/ep/ZigbeeDimmableLight.cpp - libraries/Zigbee/src/ep/ZigbeeLight.cpp - libraries/Zigbee/src/ep/ZigbeeSwitch.cpp - libraries/Zigbee/src/ep/ZigbeeTempSensor.cpp - libraries/Zigbee/src/ep/ZigbeeThermostat.cpp - libraries/Zigbee/src/ep/ZigbeeFlowSensor.cpp - libraries/Zigbee/src/ep/ZigbeePressureSensor.cpp - libraries/Zigbee/src/ep/ZigbeeOccupancySensor.cpp - libraries/Zigbee/src/ep/ZigbeeCarbonDioxideSensor.cpp - libraries/Zigbee/src/ep/ZigbeeContactSwitch.cpp - libraries/Zigbee/src/ep/ZigbeeDoorWindowHandle.cpp - libraries/Zigbee/src/ep/ZigbeeWindowCovering.cpp - libraries/Zigbee/src/ep/ZigbeeVibrationSensor.cpp - libraries/Zigbee/src/ep/ZigbeeAnalog.cpp - libraries/Zigbee/src/ep/ZigbeeRangeExtender.cpp - libraries/Zigbee/src/ep/ZigbeeGateway.cpp - libraries/Zigbee/src/ep/ZigbeeWindSpeedSensor.cpp - libraries/Zigbee/src/ep/ZigbeeIlluminanceSensor.cpp - libraries/Zigbee/src/ep/ZigbeePM25Sensor.cpp - ) - -set(ARDUINO_LIBRARY_BLE_SRCS - libraries/BLE/src/BLE2901.cpp - libraries/BLE/src/BLE2902.cpp - libraries/BLE/src/BLE2904.cpp - libraries/BLE/src/BLEAddress.cpp - libraries/BLE/src/BLEAdvertisedDevice.cpp - libraries/BLE/src/BLEAdvertising.cpp - libraries/BLE/src/BLEBeacon.cpp - libraries/BLE/src/BLECharacteristic.cpp - libraries/BLE/src/BLECharacteristicMap.cpp - libraries/BLE/src/BLEClient.cpp - libraries/BLE/src/BLEDescriptor.cpp - libraries/BLE/src/BLEDescriptorMap.cpp - libraries/BLE/src/BLEDevice.cpp - libraries/BLE/src/BLEEddystoneTLM.cpp - libraries/BLE/src/BLEEddystoneURL.cpp - libraries/BLE/src/BLEExceptions.cpp - libraries/BLE/src/BLEHIDDevice.cpp - libraries/BLE/src/BLERemoteCharacteristic.cpp - libraries/BLE/src/BLERemoteDescriptor.cpp - libraries/BLE/src/BLERemoteService.cpp - libraries/BLE/src/BLEScan.cpp - libraries/BLE/src/BLESecurity.cpp - libraries/BLE/src/BLEServer.cpp - libraries/BLE/src/BLEService.cpp - libraries/BLE/src/BLEServiceMap.cpp - libraries/BLE/src/BLEUtils.cpp - libraries/BLE/src/BLEUUID.cpp - libraries/BLE/src/BLEValue.cpp - libraries/BLE/src/FreeRTOS.cpp - libraries/BLE/src/GeneralUtils.cpp - ) - set(ARDUINO_LIBRARIES_SRCS) set(ARDUINO_LIBRARIES_REQUIRES) set(ARDUINO_LIBRARIES_INCLUDEDIRS) @@ -357,15 +229,7 @@ set(includedirs variants/${CONFIG_ARDUINO_VARIANT}/ cores/esp32/ ${ARDUINO_LIBRA set(srcs ${CORE_SRCS} ${ARDUINO_LIBRARIES_SRCS}) set(priv_includes cores/esp32/libb64) set(requires spi_flash esp_partition mbedtls wpa_supplicant esp_adc esp_eth http_parser esp_ringbuf esp_driver_gptimer esp_driver_usb_serial_jtag driver) -set(priv_requires fatfs nvs_flash app_update spiffs bootloader_support bt esp_hid usb esp_psram ${ARDUINO_LIBRARIES_REQUIRES}) - -if(NOT CONFIG_ARDUINO_SELECTIVE_COMPILATION OR CONFIG_ARDUINO_SELECTIVE_OpenThread) - #if(CONFIG_SOC_IEEE802154_SUPPORTED) # Does not work! - #if(CONFIG_OPENTHREAD_ENABLED) # Does not work! - if(IDF_TARGET STREQUAL "esp32c6" OR IDF_TARGET STREQUAL "esp32h2") # Sadly only this works - list(APPEND requires openthread) - endif() -endif() +set(priv_requires fatfs nvs_flash app_update bootloader_support bt esp_hid usb esp_psram ${ARDUINO_LIBRARIES_REQUIRES}) if(IDF_TARGET STREQUAL "esp32p4") list(APPEND requires esp_driver_touch_sens) @@ -416,15 +280,6 @@ endif() if(NOT CONFIG_ARDUINO_SELECTIVE_COMPILATION OR CONFIG_ARDUINO_SELECTIVE_ArduinoOTA) maybe_add_component(esp_https_ota) endif() -if(NOT CONFIG_ARDUINO_SELECTIVE_COMPILATION OR CONFIG_ARDUINO_SELECTIVE_ESP_SR) - maybe_add_component(espressif__esp_sr) -endif() -if(NOT CONFIG_ARDUINO_SELECTIVE_COMPILATION OR CONFIG_ARDUINO_SELECTIVE_Matter) - maybe_add_component(espressif__esp_matter) -endif() if(NOT CONFIG_ARDUINO_SELECTIVE_COMPILATION OR CONFIG_ARDUINO_SELECTIVE_LittleFS) maybe_add_component(joltwallet__littlefs) endif() -if(NOT CONFIG_ARDUINO_SELECTIVE_COMPILATION OR CONFIG_ARDUINO_SELECTIVE_WiFiProv) - maybe_add_component(espressif__network_provisioning) -endif() diff --git a/Kconfig.projbuild b/Kconfig.projbuild index 9966463f8c1..9b53fb77e81 100644 --- a/Kconfig.projbuild +++ b/Kconfig.projbuild @@ -266,11 +266,6 @@ config ARDUINO_SELECTIVE_Wire depends on ARDUINO_SELECTIVE_COMPILATION default y -config ARDUINO_SELECTIVE_ESP_SR - bool "Enable ESP-SR" - depends on ARDUINO_SELECTIVE_COMPILATION - default y - config ARDUINO_SELECTIVE_EEPROM bool "Enable EEPROM" depends on ARDUINO_SELECTIVE_COMPILATION @@ -291,11 +286,6 @@ config ARDUINO_SELECTIVE_Update depends on ARDUINO_SELECTIVE_COMPILATION default y -config ARDUINO_SELECTIVE_Zigbee - bool "Enable Zigbee" - depends on ARDUINO_SELECTIVE_COMPILATION - default y - config ARDUINO_SELECTIVE_FS bool "Enable FS" depends on ARDUINO_SELECTIVE_COMPILATION @@ -311,11 +301,6 @@ config ARDUINO_SELECTIVE_SD_MMC depends on ARDUINO_SELECTIVE_COMPILATION && ARDUINO_SELECTIVE_FS default y -config ARDUINO_SELECTIVE_SPIFFS - bool "Enable SPIFFS" - depends on ARDUINO_SELECTIVE_COMPILATION && ARDUINO_SELECTIVE_FS - default y - config ARDUINO_SELECTIVE_FFat bool "Enable FFat" depends on ARDUINO_SELECTIVE_COMPILATION && ARDUINO_SELECTIVE_FS @@ -365,12 +350,6 @@ config ARDUINO_SELECTIVE_ESPmDNS config ARDUINO_SELECTIVE_HTTPClient bool "Enable HTTPClient" depends on ARDUINO_SELECTIVE_COMPILATION && ARDUINO_SELECTIVE_Network - select ARDUINO_SELECTIVE_NetworkClientSecure - default y - -config ARDUINO_SELECTIVE_Matter - bool "Enable Matter" - depends on ARDUINO_SELECTIVE_COMPILATION && ARDUINO_SELECTIVE_Network default y config ARDUINO_SELECTIVE_NetBIOS @@ -389,44 +368,4 @@ config ARDUINO_SELECTIVE_WiFi depends on ARDUINO_SELECTIVE_COMPILATION && ARDUINO_SELECTIVE_Network default y -config ARDUINO_SELECTIVE_NetworkClientSecure - bool "Enable NetworkClientSecure" - depends on ARDUINO_SELECTIVE_COMPILATION && ARDUINO_SELECTIVE_Network - default y - -config ARDUINO_SELECTIVE_WiFiProv - bool "Enable WiFiProv" - depends on ARDUINO_SELECTIVE_COMPILATION && ARDUINO_SELECTIVE_Network && ARDUINO_SELECTIVE_WiFi - default y - -config ARDUINO_SELECTIVE_BLE - bool "Enable BLE" - depends on ARDUINO_SELECTIVE_COMPILATION - default y - -config ARDUINO_SELECTIVE_BluetoothSerial - bool "Enable BluetoothSerial" - depends on ARDUINO_SELECTIVE_COMPILATION - default y - -config ARDUINO_SELECTIVE_SimpleBLE - bool "Enable SimpleBLE" - depends on ARDUINO_SELECTIVE_COMPILATION - default y - -config ARDUINO_SELECTIVE_RainMaker - bool "Enable RainMaker" - depends on ARDUINO_SELECTIVE_COMPILATION - default y - -config ARDUINO_SELECTIVE_OpenThread - bool "Enable OpenThread" - depends on ARDUINO_SELECTIVE_COMPILATION - default y - -config ARDUINO_SELECTIVE_Insights - bool "Enable Insights" - depends on ARDUINO_SELECTIVE_COMPILATION - default y - endmenu diff --git a/README.md b/README.md index f40315c03cc..8ffb180cc44 100644 --- a/README.md +++ b/README.md @@ -1,43 +1,6 @@ -# Arduino core for the ESP32, ESP32-C3, ESP32-C6, ESP32-H2, ESP32-P4, ESP32-S2 and ESP32-S3. +# Tasmota Platformio Arduino for ESP32, ESP32-P4, ESP32-S2, ESP32-S3, ESP32-C2, ESP32-C3, ESP32-C6 and ESP32-H2 -[](https://github.com/espressif/arduino-esp32/actions/workflows/push.yml?query=branch%3Amaster+event%3Apush) -[)](https://github.com/espressif/arduino-esp32/actions/workflows/push.yml?query=branch%3Amaster+event%3Aschedule) -[](https://github.com/espressif/arduino-esp32/blob/gh-pages/LIBRARIES_TEST.md) -[](https://github.com/espressif/arduino-esp32/blob/gh-pages/runtime-tests-results/RUNTIME_TESTS_REPORT.md) - -### Need help or have a question? Join the chat at [Discord](https://discord.gg/8xY6e9crwv) or [open a new Discussion](https://github.com/espressif/arduino-esp32/discussions) - -[](https://discord.gg/8xY6e9crwv) - -## Contents - - - [Development Status](#development-status) - - [Development Planning](#development-planning) - - [Documentation](#documentation) - - [Supported Chips](#supported-chips) - - [Decoding exceptions](#decoding-exceptions) - - [Issue/Bug report template](#issuebug-report-template) - - [Contributing](#contributing) - -### Development Status - -#### Latest Stable Release - -[](https://github.com/espressif/arduino-esp32/releases/latest/) -[](https://github.com/espressif/arduino-esp32/releases/latest/) -[](https://github.com/espressif/arduino-esp32/releases/latest/) - -#### Latest Development Release - -[](https://github.com/espressif/arduino-esp32/releases/) -[](https://github.com/espressif/arduino-esp32/releases/) -[](https://github.com/espressif/arduino-esp32/releases/) - -### Development Planning - -Our Development is fully tracked on this public **[Roadmap 🎉](https://github.com/orgs/espressif/projects/3)** - -For even more information you can join our **[Monthly Community Meetings 🔔](https://github.com/espressif/arduino-esp32/discussions/categories/monthly-community-meetings).** +### [](https://github.com/tasmota/arduino-esp32/releases/latest) ### Documentation @@ -49,57 +12,21 @@ You can use the [Arduino-ESP32 Online Documentation](https://docs.espressif.com/ --- -**APIs compatibility with ESP8266 and Arduino-CORE (Arduino.cc) is explained [here](https://docs.espressif.com/projects/arduino-esp32/en/latest/libraries.html#apis).** - ---- - -* [Getting Started](https://docs.espressif.com/projects/arduino-esp32/en/latest/getting_started.html) -* [Installing (Windows, Linux and macOS)](https://docs.espressif.com/projects/arduino-esp32/en/latest/installing.html) -* [Libraries](https://docs.espressif.com/projects/arduino-esp32/en/latest/libraries.html) -* [Arduino as an ESP-IDF component](https://docs.espressif.com/projects/arduino-esp32/en/latest/esp-idf_component.html) -* [FAQ](https://docs.espressif.com/projects/arduino-esp32/en/latest/faq.html) -* [Troubleshooting](https://docs.espressif.com/projects/arduino-esp32/en/latest/troubleshooting.html) - ### Supported Chips -Here are the ESP32 series supported by the Arduino-ESP32 project: +Here are the ESP32 series supported by the Tasmota Arduino-ESP32 project: | **SoC** | **Stable** | **Development** | **Datasheet** | |----------|:----------:|:---------------:|:-------------------------------------------------------------------------------------------------:| -| ESP32 | Yes | Yes | [ESP32](https://www.espressif.com/sites/default/files/documentation/esp32_datasheet_en.pdf) | +| ESP32 | Yes | Yes | [ESP32](https://www.espressif.com/sites/default/files/documentation/esp32_datasheet_en.pdf) | +| ESP32solo1| Yes | Yes | [ESP32solo1](https://www.espressif.com/sites/default/files/documentation/esp32-solo-1_datasheet_en.pdf) | +| ESP32-S2 | Yes | Yes | [ESP32-S2](https://www.espressif.com/sites/default/files/documentation/esp32-s2_datasheet_en.pdf) | +| ESP32-S3 | Yes | Yes | [ESP32-S3](https://www.espressif.com/sites/default/files/documentation/esp32-s3_datasheet_en.pdf) | +| ESP32-C2 | Yes | Yes | [ESP32-C2](https://www.espressif.com/sites/default/files/documentation/esp8684_datasheet_en.pdf) | | ESP32-C3 | Yes | Yes | [ESP32-C3](https://www.espressif.com/sites/default/files/documentation/esp32-c3_datasheet_en.pdf) | | ESP32-C6 | Yes | Yes | [ESP32-C6](https://www.espressif.com/sites/default/files/documentation/esp32-c6_datasheet_en.pdf) | | ESP32-H2 | Yes | Yes | [ESP32-H2](https://www.espressif.com/sites/default/files/documentation/esp32-h2_datasheet_en.pdf) | | ESP32-P4 | Yes | Yes | [ESP32-P4](https://www.espressif.com/sites/default/files/documentation/esp32-p4_datasheet_en.pdf) | -| ESP32-S2 | Yes | Yes | [ESP32-S2](https://www.espressif.com/sites/default/files/documentation/esp32-s2_datasheet_en.pdf) | -| ESP32-S3 | Yes | Yes | [ESP32-S3](https://www.espressif.com/sites/default/files/documentation/esp32-s3_datasheet_en.pdf) | -> [!NOTE] -> ESP32-C2 is also supported by Arduino-ESP32 but requires using Arduino as an ESP-IDF component or rebuilding the static libraries. -> For more information, see the [Arduino as an ESP-IDF component documentation](https://docs.espressif.com/projects/arduino-esp32/en/latest/esp-idf_component.html) or the -> [Lib Builder documentation](https://docs.espressif.com/projects/arduino-esp32/en/latest/lib_builder.html), respectively. For more details visit the [supported chips](https://docs.espressif.com/projects/arduino-esp32/en/latest/getting_started.html#supported-soc-s) documentation page. - -### Decoding exceptions - -You can use [EspExceptionDecoder](https://github.com/me-no-dev/EspExceptionDecoder) to get meaningful call trace. - -### Issue/Bug report template - -Before reporting an issue, make sure you've searched for similar one that was already created. Also make sure to go through all the issues labeled as [Type: For reference](https://github.com/espressif/arduino-esp32/issues?q=is%3Aissue+label%3A%22Type%3A+For+reference%22+). - -Finally, if you are sure no one else had the issue, follow the **Issue template** or **Feature request template** while reporting any [new Issue](https://github.com/espressif/arduino-esp32/issues/new/choose). - -### External libraries compilation test - -We have set-up CI testing for external libraries for ESP32 Arduino core. You can check test results in the file [LIBRARIES_TEST](https://github.com/espressif/arduino-esp32/blob/gh-pages/LIBRARIES_TEST.md). -For more information and how to add your library to the test see [external library testing](https://docs.espressif.com/projects/arduino-esp32/en/latest/external_libraries_test.html) in the documentation. - -### Contributing - -We welcome contributions to the Arduino ESP32 project! - -See [contributing](https://docs.espressif.com/projects/arduino-esp32/en/latest/contributing.html) in the documentation for more information on how to contribute to the project. - -> We would like to have this repository in a polite and friendly atmosphere, so please be kind and respectful to others. For more details, look at [Code of Conduct](https://github.com/espressif/arduino-esp32/blob/master/CODE_OF_CONDUCT.md). diff --git a/cores/esp32/FirmwareMSC.h b/cores/esp32/FirmwareMSC.h index 3eaa184bcd6..cc428bc69b8 100644 --- a/cores/esp32/FirmwareMSC.h +++ b/cores/esp32/FirmwareMSC.h @@ -14,7 +14,9 @@ #pragma once #include <stdbool.h> +#if defined __has_include && __has_include("USBMSC.h") #include "USBMSC.h" +#endif #if CONFIG_TINYUSB_MSC_ENABLED diff --git a/cores/esp32/HWCDC.cpp b/cores/esp32/HWCDC.cpp index 170e323a035..afbc458e620 100644 --- a/cores/esp32/HWCDC.cpp +++ b/cores/esp32/HWCDC.cpp @@ -11,7 +11,9 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. +#if defined __has_include && __has_include("USB.h") #include "USB.h" +#endif #if SOC_USB_SERIAL_JTAG_SUPPORTED #include "esp32-hal.h" @@ -603,6 +605,7 @@ void HWCDC::setDebugOutput(bool en) { } else { ets_install_putc2(NULL); } + ets_install_putc1(NULL); // closes UART log output } #if ARDUINO_USB_MODE && ARDUINO_USB_CDC_ON_BOOT // Hardware JTAG CDC selected diff --git a/cores/esp32/HardwareSerial.h b/cores/esp32/HardwareSerial.h index e974f112701..7573e88495e 100644 --- a/cores/esp32/HardwareSerial.h +++ b/cores/esp32/HardwareSerial.h @@ -51,7 +51,9 @@ #include "esp32-hal.h" #include "soc/soc_caps.h" #include "HWCDC.h" +#if defined __has_include && __has_include("USBCDC.h") #include "USBCDC.h" +#endif #include "freertos/FreeRTOS.h" #include "freertos/task.h" diff --git a/cores/esp32/USBCDC.cpp b/cores/esp32/USBCDC.cpp index 945021a79e2..c7bb4582d4f 100644 --- a/cores/esp32/USBCDC.cpp +++ b/cores/esp32/USBCDC.cpp @@ -455,6 +455,7 @@ void USBCDC::setDebugOutput(bool en) { } else { ets_install_putc2(NULL); } + ets_install_putc1(NULL); // closes UART log output } USBCDC::operator bool() const { diff --git a/cores/esp32/esp32-hal-bt.c b/cores/esp32/esp32-hal-bt.c index 1e5f73e324c..2eb3ad959f5 100644 --- a/cores/esp32/esp32-hal-bt.c +++ b/cores/esp32/esp32-hal-bt.c @@ -15,108 +15,7 @@ #include "esp32-hal-bt.h" #if SOC_BT_SUPPORTED -#ifdef CONFIG_BT_BLUEDROID_ENABLED -#if CONFIG_IDF_TARGET_ESP32 -bool btInUse() { - return true; -} -#else -// user may want to change it to free resources -__attribute__((weak)) bool btInUse() { - return true; -} -#endif - -#include "esp_bt.h" - -#ifdef CONFIG_BTDM_CONTROLLER_MODE_BTDM -#define BT_MODE ESP_BT_MODE_BTDM -#elif defined(CONFIG_BTDM_CONTROLLER_MODE_BR_EDR_ONLY) -#define BT_MODE ESP_BT_MODE_CLASSIC_BT -#else -#define BT_MODE ESP_BT_MODE_BLE -#endif - -bool btStarted() { - return (esp_bt_controller_get_status() == ESP_BT_CONTROLLER_STATUS_ENABLED); -} - -bool btStart() { - return btStartMode(BT_MODE); -} - -bool btStartMode(bt_mode mode) { - esp_bt_mode_t esp_bt_mode; - esp_bt_controller_config_t cfg = BT_CONTROLLER_INIT_CONFIG_DEFAULT(); -#if CONFIG_IDF_TARGET_ESP32 - switch (mode) { - case BT_MODE_BLE: esp_bt_mode = ESP_BT_MODE_BLE; break; - case BT_MODE_CLASSIC_BT: esp_bt_mode = ESP_BT_MODE_CLASSIC_BT; break; - case BT_MODE_BTDM: esp_bt_mode = ESP_BT_MODE_BTDM; break; - default: esp_bt_mode = BT_MODE; break; - } - // esp_bt_controller_enable(MODE) This mode must be equal as the mode in “cfg” of esp_bt_controller_init(). - cfg.mode = esp_bt_mode; - if (cfg.mode == ESP_BT_MODE_CLASSIC_BT) { - esp_bt_controller_mem_release(ESP_BT_MODE_BLE); - } -#else - // other esp variants dont support BT-classic / DM. - esp_bt_mode = BT_MODE; -#endif - - if (esp_bt_controller_get_status() == ESP_BT_CONTROLLER_STATUS_ENABLED) { - return true; - } - esp_err_t ret; - if (esp_bt_controller_get_status() == ESP_BT_CONTROLLER_STATUS_IDLE) { - if ((ret = esp_bt_controller_init(&cfg)) != ESP_OK) { - log_e("initialize controller failed: %s", esp_err_to_name(ret)); - return false; - } - while (esp_bt_controller_get_status() == ESP_BT_CONTROLLER_STATUS_IDLE) {} - } - if (esp_bt_controller_get_status() == ESP_BT_CONTROLLER_STATUS_INITED) { - if ((ret = esp_bt_controller_enable(esp_bt_mode)) != ESP_OK) { - log_e("BT Enable mode=%d failed %s", BT_MODE, esp_err_to_name(ret)); - return false; - } - } - if (esp_bt_controller_get_status() == ESP_BT_CONTROLLER_STATUS_ENABLED) { - return true; - } - log_e("BT Start failed"); - return false; -} - -bool btStop() { - if (esp_bt_controller_get_status() == ESP_BT_CONTROLLER_STATUS_IDLE) { - return true; - } - if (esp_bt_controller_get_status() == ESP_BT_CONTROLLER_STATUS_ENABLED) { - if (esp_bt_controller_disable()) { - log_e("BT Disable failed"); - return false; - } - while (esp_bt_controller_get_status() == ESP_BT_CONTROLLER_STATUS_ENABLED); - } - if (esp_bt_controller_get_status() == ESP_BT_CONTROLLER_STATUS_INITED) { - if (esp_bt_controller_deinit()) { - log_e("BT deint failed"); - return false; - } - vTaskDelay(1); - if (esp_bt_controller_get_status() != ESP_BT_CONTROLLER_STATUS_IDLE) { - return false; - } - return true; - } - log_e("BT Stop failed"); - return false; -} - -#else // CONFIG_BT_ENABLED bool btStarted() { return false; } @@ -129,6 +28,4 @@ bool btStop() { return false; } -#endif /* CONFIG_BT_ENABLED */ - #endif /* SOC_BT_SUPPORTED */ diff --git a/cores/esp32/esp32-hal-bt.h b/cores/esp32/esp32-hal-bt.h index 8ab03eea904..9758e8ab1fc 100644 --- a/cores/esp32/esp32-hal-bt.h +++ b/cores/esp32/esp32-hal-bt.h @@ -24,16 +24,8 @@ extern "C" { #endif -typedef enum { - BT_MODE_DEFAULT, - BT_MODE_BLE, - BT_MODE_CLASSIC_BT, - BT_MODE_BTDM -} bt_mode; - bool btStarted(); bool btStart(); -bool btStartMode(bt_mode mode); bool btStop(); #ifdef __cplusplus diff --git a/cores/esp32/esp32-hal-misc.c b/cores/esp32/esp32-hal-misc.c index 50e2973d27a..04db0dde879 100644 --- a/cores/esp32/esp32-hal-misc.c +++ b/cores/esp32/esp32-hal-misc.c @@ -25,9 +25,6 @@ #include "esp_ota_ops.h" #endif //CONFIG_APP_ROLLBACK_ENABLE #include "esp_private/startup_internal.h" -#if defined(CONFIG_BT_ENABLED) && SOC_BT_SUPPORTED -#include "esp_bt.h" -#endif //CONFIG_BT_ENABLED #include <sys/time.h> #include "soc/rtc.h" #if !defined(CONFIG_IDF_TARGET_ESP32C2) && !defined(CONFIG_IDF_TARGET_ESP32C6) && !defined(CONFIG_IDF_TARGET_ESP32H2) && !defined(CONFIG_IDF_TARGET_ESP32P4) @@ -243,19 +240,6 @@ bool verifyRollbackLater() { } #endif -#ifdef CONFIG_BT_ENABLED -#if CONFIG_IDF_TARGET_ESP32 -//overwritten in esp32-hal-bt.c -bool btInUse() __attribute__((weak)); -bool btInUse() { - return false; -} -#else -//from esp32-hal-bt.c -extern bool btInUse(); -#endif -#endif - #if CONFIG_SPIRAM_SUPPORT || CONFIG_SPIRAM ESP_SYSTEM_INIT_FN(init_psram_new, CORE, BIT(0), 99) { psramInit(); @@ -305,11 +289,6 @@ void initArduino() { if (err) { log_e("Failed to initialize NVS! Error: %u", err); } -#if defined(CONFIG_BT_ENABLED) && SOC_BT_SUPPORTED - if (!btInUse()) { - esp_bt_controller_mem_release(ESP_BT_MODE_BTDM); - } -#endif init(); initVariant(); } diff --git a/cores/esp32/esp32-hal-uart.c b/cores/esp32/esp32-hal-uart.c index d2e98a2341a..5311aff4f37 100644 --- a/cores/esp32/esp32-hal-uart.c +++ b/cores/esp32/esp32-hal-uart.c @@ -1186,7 +1186,7 @@ int log_printfv(const char *format, va_list arg) { return 0; } } -/* + /* // This causes dead locks with logging in specific cases and also with C++ constructors that may send logs #if !CONFIG_DISABLE_HAL_LOCKS if(s_uart_debug_nr != -1 && _uart_bus_array[s_uart_debug_nr].lock){ @@ -1194,16 +1194,8 @@ int log_printfv(const char *format, va_list arg) { } #endif */ -#if (ARDUINO_USB_CDC_ON_BOOT == 1 && ARDUINO_USB_MODE == 0) || CONFIG_IDF_TARGET_ESP32C3 \ - || ((CONFIG_IDF_TARGET_ESP32H2 || CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32P4) && ARDUINO_USB_CDC_ON_BOOT == 1) vsnprintf(temp, len + 1, format, arg); ets_printf("%s", temp); -#else - int wlen = vsnprintf(temp, len + 1, format, arg); - for (int i = 0; i < wlen; i++) { - ets_write_char_uart(temp[i]); - } -#endif /* // This causes dead locks with logging and also with constructors that may send logs #if !CONFIG_DISABLE_HAL_LOCKS diff --git a/cores/esp32/esp32-hal.h b/cores/esp32/esp32-hal.h index 5ed99aeb205..de98e644c1a 100644 --- a/cores/esp32/esp32-hal.h +++ b/cores/esp32/esp32-hal.h @@ -96,7 +96,6 @@ void yield(void); #include "esp32-hal-rmt.h" #include "esp32-hal-sigmadelta.h" #include "esp32-hal-timer.h" -#include "esp32-hal-bt.h" #include "esp32-hal-psram.h" #include "esp32-hal-rgb-led.h" #include "esp32-hal-cpu.h" diff --git a/cores/esp32/main.cpp b/cores/esp32/main.cpp index 6c4d50a9a84..746d18dc075 100644 --- a/cores/esp32/main.cpp +++ b/cores/esp32/main.cpp @@ -10,7 +10,9 @@ #endif #endif +#if defined __has_include && __has_include("chip-debug-report.h") #include "chip-debug-report.h" +#endif #ifndef ARDUINO_LOOP_STACK_SIZE #ifndef CONFIG_ARDUINO_LOOP_STACK_SIZE @@ -49,20 +51,24 @@ void loopTask(void *pvParameters) { // sets UART0 (default console) RX/TX pins as already configured in boot or as defined in variants/pins_arduino.h Serial0.setPins(gpioNumberToDigitalPin(SOC_RX0), gpioNumberToDigitalPin(SOC_TX0)); #endif +#if defined __has_include && __has_include("chip-debug-report.h") #if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_DEBUG printBeforeSetupInfo(); #else if (shouldPrintChipDebugReport()) { printBeforeSetupInfo(); } +#endif #endif setup(); +#if defined __has_include && __has_include("chip-debug-report.h") #if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_DEBUG printAfterSetupInfo(); #else if (shouldPrintChipDebugReport()) { printAfterSetupInfo(); } +#endif #endif for (;;) { #if CONFIG_FREERTOS_UNICORE diff --git a/idf_component.yml b/idf_component.yml index 967c4ecf0f6..c707f4a74b6 100644 --- a/idf_component.yml +++ b/idf_component.yml @@ -51,57 +51,10 @@ dependencies: require: public espressif/esp_modem: version: "^1.1.0" - espressif/esp-zboss-lib: - version: "==1.6.3" - require: public - rules: - - if: "target not in [esp32c2, esp32p4]" - espressif/esp-zigbee-lib: - version: "==1.6.3" - require: public rules: - - if: "target not in [esp32c2, esp32p4]" + - if: "target in [esp32, esp32s2, esp32s3, esp32h2, esp32p4]" espressif/esp-dsp: - version: "^1.3.4" - rules: - - if: "target != esp32c2" - # RainMaker Start (Fixed versions, because Matter supports only Insights 1.0.1) - espressif/network_provisioning: - version: "1.0.2" - espressif/esp_rainmaker: - version: "1.5.2" - rules: - - if: "target not in [esp32c2, esp32p4]" - espressif/rmaker_common: - version: "1.4.6" - rules: - - if: "target not in [esp32c2, esp32p4]" - espressif/esp_insights: - version: "1.2.2" - rules: - - if: "target not in [esp32c2, esp32p4]" - # New version breaks esp_insights 1.0.1 - espressif/esp_diag_data_store: - version: "1.0.2" - rules: - - if: "target not in [esp32c2, esp32p4]" - espressif/esp_diagnostics: - version: "1.2.1" - rules: - - if: "target not in [esp32c2, esp32p4]" - espressif/cbor: - version: "0.6.0~1" - rules: - - if: "target not in [esp32c2, esp32p4]" - espressif/qrcode: - version: "0.1.0~2" - rules: - - if: "target not in [esp32c2, esp32p4]" - # RainMaker End - espressif/esp-sr: - version: "^1.4.2" - rules: - - if: "target in [esp32s3]" + version: "^1.4.12" espressif/esp_hosted: version: "^0.0.25" rules: @@ -110,18 +63,11 @@ dependencies: version: "^0.4.1" rules: - if: "target == esp32p4" - espressif/libsodium: - version: "^1.0.20~1" - require: public - espressif/esp-modbus: - version: "^1.0.15" - require: public joltwallet/littlefs: - version: "^1.10.2" - chmorgan/esp-libhelix-mp3: - version: "1.0.3" + version: "^1.14.1" + espressif/esp32-camera: + version: "master" + git: https://github.com/espressif/esp32-camera.git require: public -examples: - - path: ./idf_component_examples/hello_world - - path: ./idf_component_examples/hw_cdc_hello_world - - path: ./idf_component_examples/esp_matter_light + rules: + - if: "target in [esp32, esp32s2, esp32s3, esp32p4]" diff --git a/libraries/Ethernet/src/ETH.cpp b/libraries/Ethernet/src/ETH.cpp index 3dfba37c684..27f132a21b5 100644 --- a/libraries/Ethernet/src/ETH.cpp +++ b/libraries/Ethernet/src/ETH.cpp @@ -290,6 +290,7 @@ bool ETHClass::begin(eth_phy_type_t type, int32_t phy_addr, int mdc, int mdio, i case ETH_PHY_TLK110: _phy = esp_eth_phy_new_ip101(&phy_config); break; case ETH_PHY_RTL8201: _phy = esp_eth_phy_new_rtl8201(&phy_config); break; case ETH_PHY_DP83848: _phy = esp_eth_phy_new_dp83848(&phy_config); break; + case ETH_PHY_JL1101: _phy = esp_eth_phy_new_jl1101(&phy_config); break; case ETH_PHY_KSZ8041: _phy = esp_eth_phy_new_ksz80xx(&phy_config); break; case ETH_PHY_KSZ8081: _phy = esp_eth_phy_new_ksz80xx(&phy_config); break; default: log_e("Unsupported PHY %d", type); break; diff --git a/libraries/Ethernet/src/ETH.h b/libraries/Ethernet/src/ETH.h index c52aac6ec6f..0e10c012435 100644 --- a/libraries/Ethernet/src/ETH.h +++ b/libraries/Ethernet/src/ETH.h @@ -130,11 +130,12 @@ typedef enum { #if CONFIG_ETH_USE_ESP32_EMAC #if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 4, 0) ETH_PHY_GENERIC, -#define ETH_PHY_JL1101 ETH_PHY_GENERIC +//#define ETH_PHY_JL1101 ETH_PHY_GENERIC // Tasmota IDF has native JL1101 driver #endif ETH_PHY_LAN8720, ETH_PHY_TLK110, ETH_PHY_RTL8201, + ETH_PHY_JL1101, ETH_PHY_DP83848, ETH_PHY_KSZ8041, ETH_PHY_KSZ8081, diff --git a/libraries/FS/src/vfs_api.cpp b/libraries/FS/src/vfs_api.cpp index 616f37ac611..a57067c1bbb 100644 --- a/libraries/FS/src/vfs_api.cpp +++ b/libraries/FS/src/vfs_api.cpp @@ -96,7 +96,6 @@ FileImplPtr VFSImpl::open(const char *fpath, const char *mode, const bool create return std::make_shared<VFSFileImpl>(this, fpath, mode); } - log_e("%s does not exist, no permits for creation", temp); free(temp); return FileImplPtr(); } diff --git a/libraries/HTTPClient/src/HTTPClient.h b/libraries/HTTPClient/src/HTTPClient.h index 80f6da28599..20d07c723ed 100644 --- a/libraries/HTTPClient/src/HTTPClient.h +++ b/libraries/HTTPClient/src/HTTPClient.h @@ -31,6 +31,10 @@ #define HTTPCLIENT_1_1_COMPATIBLE #endif +#ifndef HTTPCLIENT_NOSECURE +#define HTTPCLIENT_NOSECURE +#endif + #include <memory> #include <Arduino.h> #include <NetworkClient.h> diff --git a/libraries/USB/src/USBHIDConsumerControl.h b/libraries/USB/src/USBHIDConsumerControl.h index a5458df288e..7a59c70b6b1 100644 --- a/libraries/USB/src/USBHIDConsumerControl.h +++ b/libraries/USB/src/USBHIDConsumerControl.h @@ -37,7 +37,6 @@ #define CONSUMER_CONTROL_WIRELESS_RADIO_SLIDER_SWITCH 0x00C8 // Media Control -#define CONSUMER_CONTROL_PLAY_PAUSE 0x00CD #define CONSUMER_CONTROL_RECORD 0x00B2 #define CONSUMER_CONTROL_FAST_FORWARD 0x00B3 #define CONSUMER_CONTROL_REWIND 0x00B4 diff --git a/libraries/Update/src/Update.h b/libraries/Update/src/Update.h index 9a4d3e02489..67189da2f02 100644 --- a/libraries/Update/src/Update.h +++ b/libraries/Update/src/Update.h @@ -7,6 +7,10 @@ #ifndef ESP32UPDATER_H #define ESP32UPDATER_H +#ifndef UPDATE_NOCRYPT +#define UPDATE_NOCRYPT +#endif + #include <Arduino.h> #include <MD5Builder.h> #include <functional> diff --git a/libraries/WebServer/src/WebServer.cpp b/libraries/WebServer/src/WebServer.cpp index 652a86f587f..bdc583e786d 100644 --- a/libraries/WebServer/src/WebServer.cpp +++ b/libraries/WebServer/src/WebServer.cpp @@ -467,7 +467,7 @@ void WebServer::handleClient() { case HC_WAIT_CLOSE: if (_currentClient.isSSE()) { // Never close connection - _statusChange = millis(); + //_statusChange = millis(); } // Wait for client to close the connection if (millis() - _statusChange <= HTTP_MAX_CLOSE_WAIT) { diff --git a/libraries/WiFi/src/WiFiGeneric.cpp b/libraries/WiFi/src/WiFiGeneric.cpp index aa994963514..861467cd524 100644 --- a/libraries/WiFi/src/WiFiGeneric.cpp +++ b/libraries/WiFi/src/WiFiGeneric.cpp @@ -602,9 +602,9 @@ bool WiFiGenericClass::mode(wifi_mode_t m) { #else #define WIFI_PROTOCOL_DEFAULT (WIFI_PROTOCOL_11B | WIFI_PROTOCOL_11G | WIFI_PROTOCOL_11N) #endif - uint8_t current_protocol = 0; + uint32_t current_protocol = 0; if (m & WIFI_MODE_STA) { - err = esp_wifi_get_protocol(WIFI_IF_STA, ¤t_protocol); + err = esp_wifi_get_protocol(WIFI_IF_STA, (uint8_t*)¤t_protocol); if (err == ESP_OK && current_protocol == WIFI_PROTOCOL_LR) { log_v("Disabling long range on STA"); err = esp_wifi_set_protocol(WIFI_IF_STA, WIFI_PROTOCOL_DEFAULT); @@ -614,7 +614,7 @@ bool WiFiGenericClass::mode(wifi_mode_t m) { } } if (m & WIFI_MODE_AP) { - err = esp_wifi_get_protocol(WIFI_IF_AP, ¤t_protocol); + err = esp_wifi_get_protocol(WIFI_IF_AP, (uint8_t*)¤t_protocol); if (err == ESP_OK && current_protocol == WIFI_PROTOCOL_LR) { log_v("Disabling long range on AP"); err = esp_wifi_set_protocol(WIFI_IF_AP, WIFI_PROTOCOL_DEFAULT); diff --git a/tools/pioarduino-build.py b/tools/pioarduino-build.py index 3335a716888..9b688a0cdbe 100644 --- a/tools/pioarduino-build.py +++ b/tools/pioarduino-build.py @@ -22,7 +22,7 @@ http://arduino.cc/en/Reference/HomePage """ -# Extends: https://github.com/pioarduino/platform-espressif32/blob/develop/builder/main.py +# Extends: https://github.com/tasmota/platform-espressif32/blob/develop/builder/main.py from os.path import abspath, basename, isdir, isfile, join from copy import deepcopy @@ -35,7 +35,7 @@ partitions_name = board_config.get("build.partitions", board_config.get("build.arduino.partitions", "")) FRAMEWORK_DIR = platform.get_package_dir("framework-arduinoespressif32") -FRAMEWORK_LIBS_DIR = platform.get_package_dir("framework-arduinoespressif32-libs") +FRAMEWORK_LIBS_DIR = join(FRAMEWORK_DIR, "tools", "esp32-arduino-libs") assert isdir(FRAMEWORK_DIR) @@ -184,9 +184,15 @@ def add_tinyuf2_extra_image(): libs = [] variants_dir = join(FRAMEWORK_DIR, "variants") +try: + build_variants_dir = join(board_config.get("build.variants_dir")) +except Exception: + build_variants_dir = "" if "build.variants_dir" in board_config: - variants_dir = join("$PROJECT_DIR", board_config.get("build.variants_dir")) + if len(build_variants_dir) > 1: + variants_dir = join("$PROJECT_DIR", board_config.get("build.variants_dir")) + if "build.variant" in board_config: env.Append(CPPPATH=[join(variants_dir, board_config.get("build.variant"))]) @@ -209,6 +215,15 @@ def add_tinyuf2_extra_image(): # Process framework extra images # +# Tasmota places extra images "safeboot" in custom variants folder in project directory +build_name = join(board_config.get("name")) +if len(build_variants_dir) > 1: + EXTRA_IMG_DIR = join(variants_dir) +else: + EXTRA_IMG_DIR = FRAMEWORK_DIR + if "tasmota" in build_name.lower(): + EXTRA_IMG_DIR = join(EXTRA_IMG_DIR, "variants", "tasmota") + env.Append( LIBSOURCE_DIRS=[join(FRAMEWORK_DIR, "libraries")], FLASH_EXTRA_IMAGES=[ @@ -219,7 +234,7 @@ def add_tinyuf2_extra_image(): ("0x8000", join(env.subst("$BUILD_DIR"), "partitions.bin")), ("0xe000", join(FRAMEWORK_DIR, "tools", "partitions", "boot_app0.bin")), ] - + [(offset, join(FRAMEWORK_DIR, img)) for offset, img in board_config.get("upload.arduino.flash_extra_images", [])], + + [(offset, join(EXTRA_IMG_DIR, img)) for offset, img in board_config.get("upload.arduino.flash_extra_images", [])], ) # Add an extra UF2 image if the 'TinyUF2' partition is selected diff --git a/variants/esp32p4/pins_arduino.h b/variants/esp32p4/pins_arduino.h index cbb1e871ae5..a7a5568adf3 100644 --- a/variants/esp32p4/pins_arduino.h +++ b/variants/esp32p4/pins_arduino.h @@ -10,8 +10,8 @@ static const uint8_t TX = 37; static const uint8_t RX = 38; -static const uint8_t SDA = 7; -static const uint8_t SCL = 8; +static const uint8_t SDA = 13; +static const uint8_t SCL = 12; // Use GPIOs 36 or lower on the P4 DevKit to avoid LDO power issues with high numbered GPIOs. static const uint8_t SS = 26;