Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: espressif/arduino-esp32
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: nmaitland/arduino-esp32
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: idf-4.0-prep
Choose a head ref
  • 7 commits
  • 51 files changed
  • 1 contributor

Commits on Jan 25, 2020

  1. Initial IDF-4.0 port

    SmartConfig and ETH need some work to adapt to the new API
    me-no-dev committed Jan 25, 2020
    Copy the full SHA
    8c723be View commit details
  2. Update CMakeLists.txt

    me-no-dev committed Jan 25, 2020
    Copy the full SHA
    251d5ef View commit details

Commits on Jan 27, 2020

  1. Copy the full SHA
    4bb60f6 View commit details
  2. make ETH work

    me-no-dev committed Jan 27, 2020
    Copy the full SHA
    1c49665 View commit details
  3. Copy the full SHA
    354e485 View commit details
  4. Copy the full SHA
    856e596 View commit details

Commits on Apr 6, 2020

  1. Add fixes

    me-no-dev committed Apr 6, 2020
    Copy the full SHA
    93d7785 View commit details
Showing with 614 additions and 287 deletions.
  1. +2 −2 .github/scripts/install-arduino-core-esp32.sh
  2. +2 −5 .github/scripts/on-push.sh
  3. +0 −3 .gitmodules
  4. +2 −68 CMakeLists.txt
  5. +2 −0 cores/esp32/Arduino.h
  6. +11 −1 cores/esp32/Esp.cpp
  7. +10 −0 cores/esp32/MD5Builder.h
  8. +13 −2 cores/esp32/esp32-hal-adc.c
  9. +11 −1 cores/esp32/esp32-hal-cpu.c
  10. +13 −2 cores/esp32/esp32-hal-dac.c
  11. +15 −3 cores/esp32/esp32-hal-gpio.c
  12. +13 −1 cores/esp32/esp32-hal-i2c.c
  13. +11 −1 cores/esp32/esp32-hal-ledc.c
  14. +10 −0 cores/esp32/esp32-hal-matrix.c
  15. +11 −1 cores/esp32/esp32-hal-misc.c
  16. +24 −1 cores/esp32/esp32-hal-psram.c
  17. +0 −1 cores/esp32/esp32-hal-rmt.c
  18. +11 −1 cores/esp32/esp32-hal-sigmadelta.c
  19. +21 −9 cores/esp32/esp32-hal-spi.c
  20. +12 −1 cores/esp32/esp32-hal-timer.c
  21. +13 −2 cores/esp32/esp32-hal-touch.c
  22. +15 −4 cores/esp32/esp32-hal-uart.c
  23. +1 −0 cores/esp32/esp32-hal.h
  24. +0 −1 libraries/AzureIoT
  25. +1 −1 libraries/BLE/src/BLEAdvertisedDevice.cpp
  26. +10 −2 libraries/BLE/src/BLEDevice.cpp
  27. +2 −2 libraries/BLE/src/BLERemoteService.cpp
  28. +1 −1 libraries/BLE/src/BLERemoteService.h
  29. +6 −1 libraries/BLE/src/FreeRTOS.cpp
  30. +5 −1 libraries/BLE/src/FreeRTOS.h
  31. +1 −1 libraries/BluetoothSerial/examples/SerialToSerialBTM/SerialToSerialBTM.ino
  32. +13 −1 libraries/BluetoothSerial/src/BluetoothSerial.cpp
  33. +2 −2 libraries/EEPROM/examples/eeprom_class/eeprom_class.ino
  34. +2 −2 libraries/ESP32/examples/Camera/CameraWebServer/app_httpd.cpp
  35. +9 −1 libraries/ESP32/examples/ResetReason/ResetReason.ino
  36. +1 −2 libraries/HTTPClient/examples/HTTPClientEnterprise/HTTPClientEnterprise.ino
  37. +5 −2 libraries/SD/src/sd_diskio.cpp
  38. +0 −103 libraries/WiFi/examples/ETH_LAN8720_internal_clock/ETH_LAN8720_internal_clock.ino
  39. +0 −1 libraries/WiFi/examples/WPS/WPS.ino
  40. +1 −2 libraries/WiFi/examples/WiFiClientEnterprise/WiFiClientEnterprise.ino
  41. +187 −10 libraries/WiFi/src/ETH.cpp
  42. +19 −3 libraries/WiFi/src/ETH.h
  43. +8 −0 libraries/WiFi/src/WiFiClient.cpp
  44. +7 −0 libraries/WiFi/src/WiFiGeneric.cpp
  45. +48 −8 libraries/WiFi/src/WiFiSTA.cpp
  46. +7 −0 libraries/WiFi/src/WiFiSTA.h
  47. +12 −0 libraries/WiFi/src/WiFiServer.cpp
  48. +1 −2 libraries/WiFiClientSecure/examples/WiFiClientSecureEnterprise/WiFiClientSecureEnterprise.ino
  49. +21 −21 package/package_esp32_index.template.json
  50. +3 −3 platform.txt
  51. +19 −5 tools/platformio-build.py
4 changes: 2 additions & 2 deletions .github/scripts/install-arduino-core-esp32.sh
Original file line number Diff line number Diff line change
@@ -23,9 +23,9 @@ if [ ! -d "$ARDUINO_ESP32_PATH" ]; then
git clone https://github.com/espressif/arduino-esp32.git esp32 > /dev/null 2>&1
fi

echo "Updating Submodules ..."
#echo "Updating Submodules ..."
cd esp32
git submodule update --init --recursive > /dev/null 2>&1
#git submodule update --init --recursive > /dev/null 2>&1

echo "Installing Platform Tools ..."
cd tools && python get.py
7 changes: 2 additions & 5 deletions .github/scripts/on-push.sh
Original file line number Diff line number Diff line change
@@ -30,8 +30,8 @@ elif [ "$CHUNK_INDEX" -eq "$CHUNKS_CNT" ]; then
BUILD_PIO=1
fi

echo "Updating submodules ..."
git -C "$GITHUB_WORKSPACE" submodule update --init --recursive > /dev/null 2>&1
#echo "Updating submodules ..."
#git -C "$GITHUB_WORKSPACE" submodule update --init --recursive > /dev/null 2>&1

if [ "$BUILD_PIO" -eq 0 ]; then
# ArduinoIDE Test
@@ -41,14 +41,12 @@ if [ "$BUILD_PIO" -eq 0 ]; then
if [ "$OS_IS_WINDOWS" == "1" ]; then
build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/WiFiClientSecure/examples/WiFiClientSecure/WiFiClientSecure.ino" && \
build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/BLE/examples/BLE_server/BLE_server.ino" && \
build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/AzureIoT/examples/GetStarted/GetStarted.ino" && \
build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/ESP32/examples/Camera/CameraWebServer/CameraWebServer.ino"
elif [ "$OS_IS_MACOS" == "1" ]; then
build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/WiFi/examples/WiFiClient/WiFiClient.ino" && \
build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/WiFiClientSecure/examples/WiFiClientSecure/WiFiClientSecure.ino" && \
build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/BluetoothSerial/examples/SerialToSerialBT/SerialToSerialBT.ino" && \
build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/BLE/examples/BLE_server/BLE_server.ino" && \
build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/AzureIoT/examples/GetStarted/GetStarted.ino" && \
build_sketch "$FQBN" "$ARDUINO_ESP32_PATH/libraries/ESP32/examples/Camera/CameraWebServer/CameraWebServer.ino"
else
# CMake Test
@@ -65,7 +63,6 @@ else
build_pio_sketch "$BOARD" "$PLATFORMIO_ESP32_PATH/libraries/WiFiClientSecure/examples/WiFiClientSecure/WiFiClientSecure.ino" && \
build_pio_sketch "$BOARD" "$PLATFORMIO_ESP32_PATH/libraries/BluetoothSerial/examples/SerialToSerialBT/SerialToSerialBT.ino" && \
build_pio_sketch "$BOARD" "$PLATFORMIO_ESP32_PATH/libraries/BLE/examples/BLE_server/BLE_server.ino" && \
build_pio_sketch "$BOARD" "$PLATFORMIO_ESP32_PATH/libraries/AzureIoT/examples/GetStarted/GetStarted.ino" && \
build_pio_sketch "$BOARD" "$PLATFORMIO_ESP32_PATH/libraries/ESP32/examples/Camera/CameraWebServer/CameraWebServer.ino"
#build_pio_sketches esp32dev "$PLATFORMIO_ESP32_PATH/libraries"
fi
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
[submodule "libraries/AzureIoT"]
path = libraries/AzureIoT
url = https://github.com/VSChina/ESP32_AzureIoT_Arduino
70 changes: 2 additions & 68 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -78,66 +78,6 @@ set(LIBRARY_SRCS
libraries/Wire/src/Wire.cpp
)

set(AZURE_SRCS
libraries/AzureIoT/src/az_iot/azureiotcerts.c
libraries/AzureIoT/src/az_iot/c-utility/pal/agenttime.c
libraries/AzureIoT/src/az_iot/c-utility/pal/dns_async.c
libraries/AzureIoT/src/az_iot/c-utility/pal/freertos/lock.c
libraries/AzureIoT/src/az_iot/c-utility/pal/freertos/threadapi.c
libraries/AzureIoT/src/az_iot/c-utility/pal/freertos/tickcounter.c
libraries/AzureIoT/src/az_iot/c-utility/pal/lwip/sntp_lwip.c
libraries/AzureIoT/src/az_iot/c-utility/pal/socket_async.c
libraries/AzureIoT/src/az_iot/c-utility/pal/src/platform_openssl_compact.c
libraries/AzureIoT/src/az_iot/c-utility/pal/src/tlsio_openssl_compact.c
libraries/AzureIoT/src/az_iot/c-utility/pal/tlsio_options.c
libraries/AzureIoT/src/az_iot/c-utility/src/base64.c
libraries/AzureIoT/src/az_iot/c-utility/src/buffer.c
libraries/AzureIoT/src/az_iot/c-utility/src/connection_string_parser.c
libraries/AzureIoT/src/az_iot/c-utility/src/consolelogger.c
libraries/AzureIoT/src/az_iot/c-utility/src/constbuffer.c
libraries/AzureIoT/src/az_iot/c-utility/src/constmap.c
libraries/AzureIoT/src/az_iot/c-utility/src/crt_abstractions.c
libraries/AzureIoT/src/az_iot/c-utility/src/doublylinkedlist.c
libraries/AzureIoT/src/az_iot/c-utility/src/gballoc.c
libraries/AzureIoT/src/az_iot/c-utility/src/gb_stdio.c
libraries/AzureIoT/src/az_iot/c-utility/src/gb_time.c
libraries/AzureIoT/src/az_iot/c-utility/src/hmac.c
libraries/AzureIoT/src/az_iot/c-utility/src/hmacsha256.c
libraries/AzureIoT/src/az_iot/c-utility/src/httpapiex.c
libraries/AzureIoT/src/az_iot/c-utility/src/httpapiexsas.c
libraries/AzureIoT/src/az_iot/c-utility/src/httpheaders.c
libraries/AzureIoT/src/az_iot/c-utility/src/http_proxy_io.c
libraries/AzureIoT/src/az_iot/c-utility/src/map.c
libraries/AzureIoT/src/az_iot/c-utility/src/optionhandler.c
libraries/AzureIoT/src/az_iot/c-utility/src/sastoken.c
libraries/AzureIoT/src/az_iot/c-utility/src/sha1.c
libraries/AzureIoT/src/az_iot/c-utility/src/sha224.c
libraries/AzureIoT/src/az_iot/c-utility/src/sha384-512.c
libraries/AzureIoT/src/az_iot/c-utility/src/singlylinkedlist.c
libraries/AzureIoT/src/az_iot/c-utility/src/strings.c
libraries/AzureIoT/src/az_iot/c-utility/src/string_tokenizer.c
libraries/AzureIoT/src/az_iot/c-utility/src/urlencode.c
libraries/AzureIoT/src/az_iot/c-utility/src/usha.c
libraries/AzureIoT/src/az_iot/c-utility/src/vector.c
libraries/AzureIoT/src/az_iot/c-utility/src/xio.c
libraries/AzureIoT/src/az_iot/c-utility/src/xlogging.c
libraries/AzureIoT/src/az_iot/iothub_client/src/blob.c
libraries/AzureIoT/src/az_iot/iothub_client/src/iothub_client_authorization.c
libraries/AzureIoT/src/az_iot/iothub_client/src/iothub_client.c
libraries/AzureIoT/src/az_iot/iothub_client/src/iothub_client_ll.c
libraries/AzureIoT/src/az_iot/iothub_client/src/iothub_client_retry_control.c
libraries/AzureIoT/src/az_iot/iothub_client/src/iothub_message.c
libraries/AzureIoT/src/az_iot/iothub_client/src/iothubtransport.c
libraries/AzureIoT/src/az_iot/iothub_client/src/iothubtransportmqtt.c
libraries/AzureIoT/src/az_iot/iothub_client/src/iothubtransport_mqtt_common.c
libraries/AzureIoT/src/az_iot/iothub_client/src/version.c
libraries/AzureIoT/src/az_iot/umqtt/src/mqtt_client.c
libraries/AzureIoT/src/az_iot/umqtt/src/mqtt_codec.c
libraries/AzureIoT/src/az_iot/umqtt/src/mqtt_message.c
libraries/AzureIoT/src/AzureIotHub.cpp
libraries/AzureIoT/src/Esp32MQTTClient.cpp
)

set(BLE_SRCS
libraries/BLE/src/BLE2902.cpp
libraries/BLE/src/BLE2904.cpp
@@ -170,14 +110,13 @@ set(BLE_SRCS
libraries/BLE/src/GeneralUtils.cpp
)

set(COMPONENT_SRCS ${CORE_SRCS} ${LIBRARY_SRCS} ${AZURE_SRCS} ${BLE_SRCS})
set(COMPONENT_SRCS ${CORE_SRCS} ${LIBRARY_SRCS} ${BLE_SRCS})

set(COMPONENT_ADD_INCLUDEDIRS
variants/esp32/
cores/esp32/
libraries/ArduinoOTA/src
libraries/AsyncUDP/src
libraries/AzureIoT/src
libraries/BLE/src
libraries/BluetoothSerial/src
libraries/DNSServer/src
@@ -205,12 +144,7 @@ set(COMPONENT_ADD_INCLUDEDIRS

set(COMPONENT_PRIV_INCLUDEDIRS cores/esp32/libb64)

set(COMPONENT_REQUIRES spi_flash mbedtls mdns ethernet esp_adc_cal)
set(COMPONENT_REQUIRES spi_flash mbedtls mdns esp_adc_cal)
set(COMPONENT_PRIV_REQUIRES fatfs nvs_flash app_update spiffs bootloader_support openssl bt)

register_component()

set_source_files_properties(libraries/AzureIoT/src/az_iot/iothub_client/src/iothubtransport_mqtt_common.c
PROPERTIES COMPILE_FLAGS
-Wno-maybe-uninitialized
)
2 changes: 2 additions & 0 deletions cores/esp32/Arduino.h
Original file line number Diff line number Diff line change
@@ -118,7 +118,9 @@ typedef unsigned int word;
void setup(void);
void loop(void);

#ifdef __cplusplus
long random(long, long);
#endif
void randomSeed(unsigned long);
long map(long, long, long, long, long);

12 changes: 11 additions & 1 deletion cores/esp32/Esp.cpp
Original file line number Diff line number Diff line change
@@ -19,7 +19,6 @@

#include "Arduino.h"
#include "Esp.h"
#include "rom/spi_flash.h"
#include "esp_sleep.h"
#include "esp_spi_flash.h"
#include <memory>
@@ -32,6 +31,17 @@ extern "C" {
}
#include <MD5Builder.h>

#include "esp_system.h"
#ifdef ESP_IDF_VERSION_MAJOR // IDF 4+
#if CONFIG_IDF_TARGET_ESP32 // ESP32/PICO-D4
#include "esp32/rom/spi_flash.h"
#else
#error Target CONFIG_IDF_TARGET is not supported
#endif
#else // ESP32 Before IDF 4.0
#include "rom/spi_flash.h"
#endif

/**
* User-defined Literals
* usage:
10 changes: 10 additions & 0 deletions cores/esp32/MD5Builder.h
Original file line number Diff line number Diff line change
@@ -21,7 +21,17 @@

#include <WString.h>
#include <Stream.h>

#include "esp_system.h"
#ifdef ESP_IDF_VERSION_MAJOR // IDF 4+
#if CONFIG_IDF_TARGET_ESP32 // ESP32/PICO-D4
#include "esp32/rom/md5_hash.h"
#else
#error Target CONFIG_IDF_TARGET is not supported
#endif
#else // ESP32 Before IDF 4.0
#include "rom/md5_hash.h"
#endif

class MD5Builder
{
15 changes: 13 additions & 2 deletions cores/esp32/esp32-hal-adc.c
Original file line number Diff line number Diff line change
@@ -15,16 +15,27 @@
#include "esp32-hal-adc.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "rom/ets_sys.h"
#include "esp_attr.h"
#include "esp_intr.h"
#include "soc/rtc_io_reg.h"
#include "soc/rtc_cntl_reg.h"
#include "soc/sens_reg.h"

#include "driver/adc.h"
#include "esp_adc_cal.h"

#include "esp_system.h"
#ifdef ESP_IDF_VERSION_MAJOR // IDF 4+
#if CONFIG_IDF_TARGET_ESP32 // ESP32/PICO-D4
#include "esp32/rom/ets_sys.h"
#include "esp_intr_alloc.h"
#else
#error Target CONFIG_IDF_TARGET is not supported
#endif
#else // ESP32 Before IDF 4.0
#include "rom/ets_sys.h"
#include "esp_intr.h"
#endif

#define DEFAULT_VREF 1100
static esp_adc_cal_characteristics_t *__analogCharacteristics[2] = {NULL, NULL};
static uint8_t __analogAttenuation = 3;//11db
12 changes: 11 additions & 1 deletion cores/esp32/esp32-hal-cpu.c
Original file line number Diff line number Diff line change
@@ -21,12 +21,22 @@
#include "esp_log.h"
#include "soc/rtc.h"
#include "soc/rtc_cntl_reg.h"
#include "rom/rtc.h"
#include "soc/apb_ctrl_reg.h"
#include "soc/efuse_reg.h"
#include "esp32-hal.h"
#include "esp32-hal-cpu.h"

#include "esp_system.h"
#ifdef ESP_IDF_VERSION_MAJOR // IDF 4+
#if CONFIG_IDF_TARGET_ESP32 // ESP32/PICO-D4
#include "esp32/rom/rtc.h"
#else
#error Target CONFIG_IDF_TARGET is not supported
#endif
#else // ESP32 Before IDF 4.0
#include "rom/rtc.h"
#endif

typedef struct apb_change_cb_s {
struct apb_change_cb_s * prev;
struct apb_change_cb_s * next;
15 changes: 13 additions & 2 deletions cores/esp32/esp32-hal-dac.c
Original file line number Diff line number Diff line change
@@ -15,13 +15,24 @@
#include "esp32-hal-dac.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "rom/ets_sys.h"
#include "esp_attr.h"
#include "esp_intr.h"
#include "soc/rtc_io_reg.h"
#include "soc/rtc_cntl_reg.h"
#include "soc/sens_reg.h"

#include "esp_system.h"
#ifdef ESP_IDF_VERSION_MAJOR // IDF 4+
#if CONFIG_IDF_TARGET_ESP32 // ESP32/PICO-D4
#include "esp32/rom/ets_sys.h"
#include "esp_intr_alloc.h"
#else
#error Target CONFIG_IDF_TARGET is not supported
#endif
#else // ESP32 Before IDF 4.0
#include "rom/ets_sys.h"
#include "esp_intr.h"
#endif

void IRAM_ATTR __dacWrite(uint8_t pin, uint8_t value)
{
if(pin < 25 || pin > 26){
18 changes: 15 additions & 3 deletions cores/esp32/esp32-hal-gpio.c
Original file line number Diff line number Diff line change
@@ -15,15 +15,27 @@
#include "esp32-hal-gpio.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "rom/ets_sys.h"
#include "esp_attr.h"
#include "esp_intr.h"
#include "rom/gpio.h"
#include "soc/gpio_reg.h"
#include "soc/io_mux_reg.h"
#include "soc/gpio_struct.h"
#include "soc/rtc_io_reg.h"

#include "esp_system.h"
#ifdef ESP_IDF_VERSION_MAJOR // IDF 4+
#if CONFIG_IDF_TARGET_ESP32 // ESP32/PICO-D4
#include "esp32/rom/ets_sys.h"
#include "esp32/rom/gpio.h"
#include "esp_intr_alloc.h"
#else
#error Target CONFIG_IDF_TARGET is not supported
#endif
#else // ESP32 Before IDF 4.0
#include "rom/ets_sys.h"
#include "rom/gpio.h"
#include "esp_intr.h"
#endif

const int8_t esp32_adc2gpio[20] = {36, 37, 38, 39, 32, 33, 34, 35, -1, -1, 4, 0, 2, 15, 13, 12, 14, 27, 25, 26};

const DRAM_ATTR esp32_gpioMux_t esp32_gpioMux[GPIO_PIN_COUNT]={
14 changes: 13 additions & 1 deletion cores/esp32/esp32-hal-i2c.c
Original file line number Diff line number Diff line change
@@ -18,13 +18,25 @@
#include "freertos/task.h"
#include "freertos/semphr.h"
#include "freertos/event_groups.h"
#include "rom/ets_sys.h"
#include "driver/periph_ctrl.h"
#include "soc/i2c_reg.h"
#include "soc/i2c_struct.h"
#include "soc/dport_reg.h"
#include "esp_attr.h"
#include "esp32-hal-cpu.h" // cpu clock change support 31DEC2018

#include "esp_system.h"
#ifdef ESP_IDF_VERSION_MAJOR // IDF 4+
#if CONFIG_IDF_TARGET_ESP32 // ESP32/PICO-D4
#include "esp32/rom/ets_sys.h"
#else
#error Target CONFIG_IDF_TARGET is not supported
#endif
#else // ESP32 Before IDF 4.0
#include "rom/ets_sys.h"
#endif


//#define I2C_DEV(i) (volatile i2c_dev_t *)((i)?DR_REG_I2C1_EXT_BASE:DR_REG_I2C_EXT_BASE)
//#define I2C_DEV(i) ((i2c_dev_t *)(REG_I2C_BASE(i)))
#define I2C_SCL_IDX(p) ((p==0)?I2CEXT0_SCL_OUT_IDX:((p==1)?I2CEXT1_SCL_OUT_IDX:0))
12 changes: 11 additions & 1 deletion cores/esp32/esp32-hal-ledc.c
Original file line number Diff line number Diff line change
@@ -16,12 +16,22 @@
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/semphr.h"
#include "rom/ets_sys.h"
#include "esp32-hal-matrix.h"
#include "soc/dport_reg.h"
#include "soc/ledc_reg.h"
#include "soc/ledc_struct.h"

#include "esp_system.h"
#ifdef ESP_IDF_VERSION_MAJOR // IDF 4+
#if CONFIG_IDF_TARGET_ESP32 // ESP32/PICO-D4
#include "esp32/rom/ets_sys.h"
#else
#error Target CONFIG_IDF_TARGET is not supported
#endif
#else // ESP32 Before IDF 4.0
#include "rom/ets_sys.h"
#endif

#if CONFIG_DISABLE_HAL_LOCKS
#define LEDC_MUTEX_LOCK()
#define LEDC_MUTEX_UNLOCK()
10 changes: 10 additions & 0 deletions cores/esp32/esp32-hal-matrix.c
Original file line number Diff line number Diff line change
@@ -14,7 +14,17 @@

#include "esp32-hal-matrix.h"
#include "esp_attr.h"

#include "esp_system.h"
#ifdef ESP_IDF_VERSION_MAJOR // IDF 4+
#if CONFIG_IDF_TARGET_ESP32 // ESP32/PICO-D4
#include "esp32/rom/gpio.h"
#else
#error Target CONFIG_IDF_TARGET is not supported
#endif
#else // ESP32 Before IDF 4.0
#include "rom/gpio.h"
#endif

#define MATRIX_DETACH_OUT_SIG 0x100
#define MATRIX_DETACH_IN_LOW_PIN 0x30
Loading