diff --git a/conversions/esp_jpg_decode.c b/conversions/esp_jpg_decode.c index 7d82111..a37878a 100644 --- a/conversions/esp_jpg_decode.c +++ b/conversions/esp_jpg_decode.c @@ -12,7 +12,17 @@ // See the License for the specific language governing permissions and // limitations under the License. #include "esp_jpg_decode.h" + +#include "esp_system.h" +#ifdef ESP_IDF_VERSION_MAJOR // IDF 4+ +#if CONFIG_IDF_TARGET_ESP32 // ESP32/PICO-D4 +#include "esp32/rom/tjpgd.h" +#else +#error Target CONFIG_IDF_TARGET is not supported +#endif +#else // ESP32 Before IDF 4.0 #include "rom/tjpgd.h" +#endif #if defined(ARDUINO_ARCH_ESP32) && defined(CONFIG_ARDUHAL_ESP_LOG) #include "esp32-hal-log.h" diff --git a/conversions/to_jpg.cpp b/conversions/to_jpg.cpp index 8e78316..812ec57 100644 --- a/conversions/to_jpg.cpp +++ b/conversions/to_jpg.cpp @@ -13,7 +13,6 @@ // limitations under the License. #include #include -#include "esp_spiram.h" #include "esp_attr.h" #include "soc/efuse_reg.h" #include "esp_heap_caps.h" @@ -22,6 +21,17 @@ #include "jpge.h" #include "yuv.h" +#include "esp_system.h" +#ifdef ESP_IDF_VERSION_MAJOR // IDF 4+ +#if CONFIG_IDF_TARGET_ESP32 // ESP32/PICO-D4 +#include "esp32/spiram.h" +#else +#error Target CONFIG_IDF_TARGET is not supported +#endif +#else // ESP32 Before IDF 4.0 +#include "esp_spiram.h" +#endif + #if defined(ARDUINO_ARCH_ESP32) && defined(CONFIG_ARDUHAL_ESP_LOG) #include "esp32-hal-log.h" #define TAG "" diff --git a/driver/camera.c b/driver/camera.c index 58c9e25..ab040fd 100755 --- a/driver/camera.c +++ b/driver/camera.c @@ -19,7 +19,6 @@ #include "freertos/FreeRTOS.h" #include "freertos/task.h" #include "freertos/semphr.h" -#include "rom/lldesc.h" #include "soc/soc.h" #include "soc/gpio_sig_map.h" #include "soc/i2s_reg.h" diff --git a/driver/private_include/camera_common.h b/driver/private_include/camera_common.h index e18d04c..f31d045 100755 --- a/driver/private_include/camera_common.h +++ b/driver/private_include/camera_common.h @@ -3,7 +3,6 @@ #include #include #include -#include "rom/lldesc.h" #include "esp_err.h" #include "esp_intr_alloc.h" #include "freertos/FreeRTOS.h" @@ -12,6 +11,17 @@ #include "esp_camera.h" #include "sensor.h" +#include "esp_system.h" +#ifdef ESP_IDF_VERSION_MAJOR // IDF 4+ +#if CONFIG_IDF_TARGET_ESP32 // ESP32/PICO-D4 +#include "esp32/rom/lldesc.h" +#else +#error Target CONFIG_IDF_TARGET is not supported +#endif +#else // ESP32 Before IDF 4.0 +#include "rom/lldesc.h" +#endif + typedef union { struct { uint8_t sample2;