From aa6697e01a4614a8d924d4b13a5be0e49c563f8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franz=20H=C3=B6pfinger?= Date: Sun, 26 Nov 2023 16:19:40 +0100 Subject: [PATCH 1/4] Add CMakeLists.txt for SmartMatrix Library This commit adds the CMakeLists.txt file for the SmartMatrix Library. The file includes the necessary minimum version requirement and component registration with required dependencies. --- CMakeLists.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..8d95922 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,11 @@ +# SmartMatrix Library +# https://github.com/pixelmatix/SmartMatrix +# + +cmake_minimum_required(VERSION 3.5) + +idf_component_register(SRCS + INCLUDE_DIRS "src" + REQUIRES driver arduino Adafruit-GFX-Library Adafruit_BusIO) + +project(SmartMatrix) From 1cbe66dcec69adb79cb26df9174ef9fdea3b599f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franz=20H=C3=B6pfinger?= Date: Sun, 26 Nov 2023 16:31:02 +0100 Subject: [PATCH 2/4] Refactor debug print statements in MatrixEsp32Hub75Refresh_Impl.h - Update printf statements to use PRIx32 format specifier for printing pointers - Improve readability and consistency of debug output --- src/MatrixEsp32Hub75Refresh_Impl.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/MatrixEsp32Hub75Refresh_Impl.h b/src/MatrixEsp32Hub75Refresh_Impl.h index c928875..64de2ae 100644 --- a/src/MatrixEsp32Hub75Refresh_Impl.h +++ b/src/MatrixEsp32Hub75Refresh_Impl.h @@ -132,11 +132,11 @@ void SmartMatrixHub75Refresh Date: Sun, 26 Nov 2023 16:31:36 +0100 Subject: [PATCH 3/4] Refactor I2S setup in MatrixEsp32Hub75Refresh_Impl.h and MatrixEsp32Hub75Refresh_NT_Impl.h - Refactored the I2S setup code in both files to use named parameters for better readability and maintainability. - Replaced direct assignments with named parameter assignments for desccount_a, desccount_b, lldesc_a, and lldesc_b. --- src/MatrixEsp32Hub75Refresh_Impl.h | 8 ++++---- src/MatrixEsp32Hub75Refresh_NT_Impl.h | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/MatrixEsp32Hub75Refresh_Impl.h b/src/MatrixEsp32Hub75Refresh_Impl.h index 64de2ae..dc07941 100644 --- a/src/MatrixEsp32Hub75Refresh_Impl.h +++ b/src/MatrixEsp32Hub75Refresh_Impl.h @@ -454,10 +454,10 @@ void SmartMatrixHub75Refresh::begin(uint32_t dmaRamToKeepFreeBytes) .bits=MATRIX_I2S_MODE, .bufa=0, .bufb=0, - desccount, - desccount, - dmadesc_a, - dmadesc_b + .desccount_a=desccount, + .desccount_b=desccount, + .lldesc_a=dmadesc_a, + .lldesc_b=dmadesc_b }; //Setup I2S From 5f202f740d234d2b5c312411c1c4a3ae5853b392 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franz=20H=C3=B6pfinger?= Date: Sun, 26 Nov 2023 16:40:43 +0100 Subject: [PATCH 4/4] Update CMakeLists.txt and esp32_i2s_parallel.c - In CMakeLists.txt, added "src" as the source directory for the component registration. - In esp32_i2s_parallel.c, included necessary header files and added support for ESP32 target. These changes improve the build configuration and add support for ESP32 target in the code. --- CMakeLists.txt | 2 +- src/esp32_i2s_parallel.c | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8d95922..9f4d08c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.5) -idf_component_register(SRCS +idf_component_register(SRC_DIRS "src" INCLUDE_DIRS "src" REQUIRES driver arduino Adafruit-GFX-Library Adafruit_BusIO) diff --git a/src/esp32_i2s_parallel.c b/src/esp32_i2s_parallel.c index e4db0b1..30312c0 100644 --- a/src/esp32_i2s_parallel.c +++ b/src/esp32_i2s_parallel.c @@ -26,12 +26,20 @@ #include "soc/i2s_struct.h" #include "soc/i2s_reg.h" +#include "soc/gpio_periph.h" #include "driver/periph_ctrl.h" +#include "driver/gpio.h" #include "soc/io_mux_reg.h" #include "rom/lldesc.h" #include "esp_heap_caps.h" #include "esp32_i2s_parallel.h" +#if CONFIG_IDF_TARGET_ESP32 +#include "esp32/rom/gpio.h" +#else +#error Target CONFIG_IDF_TARGET is not supported +#endif + typedef struct { volatile lldesc_t *dmadesc_a, *dmadesc_b; int desccount_a, desccount_b;