mirror of
https://github.com/espressif/esp32-camera.git
synced 2025-07-02 23:22:23 +08:00
Better handling of unsupported chips (#398)
This commit is contained in:
@ -1,3 +1,6 @@
|
||||
# get IDF version for comparison
|
||||
set(idf_version "${IDF_VERSION_MAJOR}.${IDF_VERSION_MINOR}")
|
||||
|
||||
# set conversion sources
|
||||
set(COMPONENT_SRCS
|
||||
conversions/yuv.c
|
||||
@ -16,6 +19,8 @@ set(COMPONENT_ADD_INCLUDEDIRS
|
||||
conversions/include
|
||||
)
|
||||
|
||||
set(COMPONENT_REQUIRES driver)
|
||||
|
||||
# set driver sources only for supported platforms
|
||||
if(IDF_TARGET STREQUAL "esp32" OR IDF_TARGET STREQUAL "esp32s2" OR IDF_TARGET STREQUAL "esp32s3")
|
||||
list(APPEND COMPONENT_SRCS
|
||||
@ -68,14 +73,11 @@ if(IDF_TARGET STREQUAL "esp32" OR IDF_TARGET STREQUAL "esp32s2" OR IDF_TARGET ST
|
||||
)
|
||||
endif()
|
||||
|
||||
set(COMPONENT_REQUIRES driver)
|
||||
set(COMPONENT_PRIV_REQUIRES freertos nvs_flash)
|
||||
|
||||
set(min_supported_idf_version "4.2")
|
||||
set(idf_version "${IDF_VERSION_MAJOR}.${IDF_VERSION_MINOR}")
|
||||
if (idf_version VERSION_GREATER_EQUAL min_supported_idf_version)
|
||||
set(min_version_for_esp_timer "4.2")
|
||||
if (idf_version VERSION_GREATER_EQUAL min_version_for_esp_timer)
|
||||
list(APPEND COMPONENT_PRIV_REQUIRES esp_timer)
|
||||
message(WARNING "ESP-IDF version detected: '${idf_version}'.")
|
||||
endif()
|
||||
|
||||
endif()
|
||||
|
@ -61,7 +61,7 @@ static const char * jd_errors[] = {
|
||||
"Not supported JPEG standard"
|
||||
};
|
||||
|
||||
static uint32_t _jpg_write(JDEC *decoder, void *bitmap, JRECT *rect)
|
||||
static unsigned int _jpg_write(JDEC *decoder, void *bitmap, JRECT *rect)
|
||||
{
|
||||
uint16_t x = rect->left;
|
||||
uint16_t y = rect->top;
|
||||
@ -77,7 +77,7 @@ static uint32_t _jpg_write(JDEC *decoder, void *bitmap, JRECT *rect)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static uint32_t _jpg_read(JDEC *decoder, uint8_t *buf, uint32_t len)
|
||||
static unsigned int _jpg_read(JDEC *decoder, uint8_t *buf, unsigned int len)
|
||||
{
|
||||
esp_jpg_decoder_t * jpeg = (esp_jpg_decoder_t *)decoder->device;
|
||||
if (jpeg->len && len > (jpeg->len - jpeg->index)) {
|
||||
|
@ -160,7 +160,7 @@ static bool _rgb565_write(void * arg, uint16_t x, uint16_t y, uint16_t w, uint16
|
||||
}
|
||||
|
||||
//input buffer
|
||||
static uint32_t _jpg_read(void * arg, size_t index, uint8_t *buf, size_t len)
|
||||
static unsigned int _jpg_read(void * arg, size_t index, uint8_t *buf, size_t len)
|
||||
{
|
||||
rgb_jpg_decoder * jpeg = (rgb_jpg_decoder *)arg;
|
||||
if(buf) {
|
||||
|
Reference in New Issue
Block a user