From c6ae1bec4e9fc4679c5068657e341d94d81e5dd8 Mon Sep 17 00:00:00 2001 From: suda-morris <362953310@qq.com> Date: Thu, 13 Jul 2023 17:32:29 +0800 Subject: [PATCH] feat(esp_jpeg): specify the target with ROM functions Currently only esp32, esp32c3, esp32s3 and esp32c6 has the ROM code for tjpgd library. Also renamed the example name --- .build-test-rules.yml | 2 +- esp_jpeg/Kconfig | 2 +- .../examples/{tjpgd => get_started}/CMakeLists.txt | 0 esp_jpeg/examples/{tjpgd => get_started}/README.md | 9 +++------ .../{tjpgd => get_started}/main/CMakeLists.txt | 0 .../{tjpgd => get_started}/main/Kconfig.projbuild | 0 .../{tjpgd => get_started}/main/decode_image.c | 0 .../{tjpgd => get_started}/main/decode_image.h | 0 .../{tjpgd => get_started}/main/idf_component.yml | 0 .../examples/{tjpgd => get_started}/main/image.jpg | Bin .../main/lcd_tjpgd_example_main.c | 0 .../{tjpgd => get_started}/main/pretty_effect.c | 0 .../{tjpgd => get_started}/main/pretty_effect.h | 0 13 files changed, 5 insertions(+), 8 deletions(-) rename esp_jpeg/examples/{tjpgd => get_started}/CMakeLists.txt (100%) rename esp_jpeg/examples/{tjpgd => get_started}/README.md (89%) rename esp_jpeg/examples/{tjpgd => get_started}/main/CMakeLists.txt (100%) rename esp_jpeg/examples/{tjpgd => get_started}/main/Kconfig.projbuild (100%) rename esp_jpeg/examples/{tjpgd => get_started}/main/decode_image.c (100%) rename esp_jpeg/examples/{tjpgd => get_started}/main/decode_image.h (100%) rename esp_jpeg/examples/{tjpgd => get_started}/main/idf_component.yml (100%) rename esp_jpeg/examples/{tjpgd => get_started}/main/image.jpg (100%) rename esp_jpeg/examples/{tjpgd => get_started}/main/lcd_tjpgd_example_main.c (100%) rename esp_jpeg/examples/{tjpgd => get_started}/main/pretty_effect.c (100%) rename esp_jpeg/examples/{tjpgd => get_started}/main/pretty_effect.h (100%) diff --git a/.build-test-rules.yml b/.build-test-rules.yml index 83b35fd8d4..c3a6ba60ec 100644 --- a/.build-test-rules.yml +++ b/.build-test-rules.yml @@ -27,7 +27,7 @@ sh2lib/examples/http2_request: - if: IDF_VERSION_MAJOR > 4 and INCLUDE_DEFAULT == 1 reason: Example uses sh2lib component which was introduced in IDF v5.0 -esp_jpeg/examples/tjpgd: +esp_jpeg/examples/get_started: enable: - if: IDF_VERSION_MAJOR > 4 and IDF_TARGET in ["esp32", "esp32s2", "esp32s3"] reason: Example depends on BSP, which is supported only for IDF >= 5.0 and limited targets diff --git a/esp_jpeg/Kconfig b/esp_jpeg/Kconfig index bb909584b5..b6a7cc0ee6 100644 --- a/esp_jpeg/Kconfig +++ b/esp_jpeg/Kconfig @@ -2,7 +2,7 @@ menu "JPEG Decoder" config JD_USE_ROM bool "Use TinyJPG Decoder from ROM" - depends on (!IDF_TARGET_ESP32S2 && !IDF_TARGET_ESP32C2 && !IDF_TARGET_ESP32H2) + depends on IDF_TARGET_ESP32 || IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32C6 || IDF_TARGET_ESP32S3 default y help By default, Espressif SoCs use TJpg decoder implemented in ROM code. diff --git a/esp_jpeg/examples/tjpgd/CMakeLists.txt b/esp_jpeg/examples/get_started/CMakeLists.txt similarity index 100% rename from esp_jpeg/examples/tjpgd/CMakeLists.txt rename to esp_jpeg/examples/get_started/CMakeLists.txt diff --git a/esp_jpeg/examples/tjpgd/README.md b/esp_jpeg/examples/get_started/README.md similarity index 89% rename from esp_jpeg/examples/tjpgd/README.md rename to esp_jpeg/examples/get_started/README.md index 115685b111..03f6b6bda9 100644 --- a/esp_jpeg/examples/tjpgd/README.md +++ b/esp_jpeg/examples/get_started/README.md @@ -1,7 +1,4 @@ -| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-S2 | ESP32-S3 | -| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | - -## LCD tjpgd example +# LCD tjpgd example This example shows how to decode a jpeg image and display it on an SPI-interfaced LCD, and rotates the image periodically. @@ -19,7 +16,7 @@ Example using initialization of the LCD from [ESP-BSP](https://github.com/espres The connection between ESP Board and the LCD is as follows: -``` +```text ESP Board LCD Screen +---------+ +---------------------------------+ | | | | @@ -42,7 +39,7 @@ The connection between ESP Board and the LCD is as follows: +---------+ +---------------------------------+ ``` -The GPIO numbers used by this example is taken from BSP. +The GPIO numbers used by this example is taken from BSP. ### Build and Flash diff --git a/esp_jpeg/examples/tjpgd/main/CMakeLists.txt b/esp_jpeg/examples/get_started/main/CMakeLists.txt similarity index 100% rename from esp_jpeg/examples/tjpgd/main/CMakeLists.txt rename to esp_jpeg/examples/get_started/main/CMakeLists.txt diff --git a/esp_jpeg/examples/tjpgd/main/Kconfig.projbuild b/esp_jpeg/examples/get_started/main/Kconfig.projbuild similarity index 100% rename from esp_jpeg/examples/tjpgd/main/Kconfig.projbuild rename to esp_jpeg/examples/get_started/main/Kconfig.projbuild diff --git a/esp_jpeg/examples/tjpgd/main/decode_image.c b/esp_jpeg/examples/get_started/main/decode_image.c similarity index 100% rename from esp_jpeg/examples/tjpgd/main/decode_image.c rename to esp_jpeg/examples/get_started/main/decode_image.c diff --git a/esp_jpeg/examples/tjpgd/main/decode_image.h b/esp_jpeg/examples/get_started/main/decode_image.h similarity index 100% rename from esp_jpeg/examples/tjpgd/main/decode_image.h rename to esp_jpeg/examples/get_started/main/decode_image.h diff --git a/esp_jpeg/examples/tjpgd/main/idf_component.yml b/esp_jpeg/examples/get_started/main/idf_component.yml similarity index 100% rename from esp_jpeg/examples/tjpgd/main/idf_component.yml rename to esp_jpeg/examples/get_started/main/idf_component.yml diff --git a/esp_jpeg/examples/tjpgd/main/image.jpg b/esp_jpeg/examples/get_started/main/image.jpg similarity index 100% rename from esp_jpeg/examples/tjpgd/main/image.jpg rename to esp_jpeg/examples/get_started/main/image.jpg diff --git a/esp_jpeg/examples/tjpgd/main/lcd_tjpgd_example_main.c b/esp_jpeg/examples/get_started/main/lcd_tjpgd_example_main.c similarity index 100% rename from esp_jpeg/examples/tjpgd/main/lcd_tjpgd_example_main.c rename to esp_jpeg/examples/get_started/main/lcd_tjpgd_example_main.c diff --git a/esp_jpeg/examples/tjpgd/main/pretty_effect.c b/esp_jpeg/examples/get_started/main/pretty_effect.c similarity index 100% rename from esp_jpeg/examples/tjpgd/main/pretty_effect.c rename to esp_jpeg/examples/get_started/main/pretty_effect.c diff --git a/esp_jpeg/examples/tjpgd/main/pretty_effect.h b/esp_jpeg/examples/get_started/main/pretty_effect.h similarity index 100% rename from esp_jpeg/examples/tjpgd/main/pretty_effect.h rename to esp_jpeg/examples/get_started/main/pretty_effect.h