Skip to content

Commit 9a7ee24

Browse files
authored
Merge branch 'master' into feat/hm1055
2 parents 3591f25 + 4d418f1 commit 9a7ee24

File tree

13 files changed

+110
-1427
lines changed

13 files changed

+110
-1427
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
**/build
44
**/sdkconfig
55
**/sdkconfig.old
6-
**/dependencies.lock
6+
**/dependencies.lock
7+
**/managed_components/**

CMakeLists.txt

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ set(srcs
77
conversions/to_jpg.cpp
88
conversions/to_bmp.c
99
conversions/jpge.cpp
10-
conversions/esp_jpg_decode.c
1110
)
1211

1312
set(priv_include_dirs
@@ -63,7 +62,6 @@ if(IDF_TARGET STREQUAL "esp32" OR IDF_TARGET STREQUAL "esp32s2" OR IDF_TARGET ST
6362
list(APPEND srcs
6463
target/xclk.c
6564
target/esp32s2/ll_cam.c
66-
target/tjpgd.c
6765
)
6866

6967
list(APPEND priv_include_dirs
@@ -85,27 +83,16 @@ if(IDF_TARGET STREQUAL "esp32" OR IDF_TARGET STREQUAL "esp32s2" OR IDF_TARGET ST
8583
endif()
8684

8785
# include the SCCB I2C driver
88-
# this uses either the legacy I2C API or the newwer version from IDF v5.4
86+
# this uses either the legacy I2C API or the newer version from IDF v5.4
8987
# as this features a method to obtain the I2C driver from a port number
90-
if (idf_version VERSION_GREATER_EQUAL "5.4")
88+
if (idf_version VERSION_GREATER_EQUAL "5.4" AND NOT CONFIG_SCCB_HARDWARE_I2C_DRIVER_LEGACY)
9189
list(APPEND srcs driver/sccb-ng.c)
9290
else()
9391
list(APPEND srcs driver/sccb.c)
9492
endif()
9593

9694
endif()
9795

98-
# CONFIG_ESP_ROM_HAS_JPEG_DECODE is available from IDF v4.4 but
99-
# previous IDF supported chips already support JPEG decoder, hence okay to use this
100-
if(idf_version VERSION_GREATER_EQUAL "4.4" AND NOT CONFIG_ESP_ROM_HAS_JPEG_DECODE)
101-
list(APPEND srcs
102-
target/tjpgd.c
103-
)
104-
list(APPEND priv_include_dirs
105-
target/jpeg_include/
106-
)
107-
endif()
108-
10996
idf_component_register(
11097
SRCS ${srcs}
11198
INCLUDE_DIRS ${include_dirs}

Kconfig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,20 @@ menu "Camera configuration"
140140
Enable this option if you want to use the MEGA CCM.
141141
Disable this option to save memory.
142142

143+
choice SCCB_HARDWARE_I2C_DRIVER_SELECTION
144+
prompt "I2C driver selection for SCCB"
145+
default SCCB_HARDWARE_I2C_DRIVER_NEW
146+
help
147+
Select the I2C driver to use for SCCB communication.
148+
NOTE: new driver is only supported for ESP-IDF >= 5.4.
149+
150+
config SCCB_HARDWARE_I2C_DRIVER_LEGACY
151+
bool "Legacy I2C driver"
152+
config SCCB_HARDWARE_I2C_DRIVER_NEW
153+
bool "New I2C driver"
154+
155+
endchoice
156+
143157
choice SCCB_HARDWARE_I2C_PORT
144158
bool "I2C peripheral to use for SCCB"
145159
default SCCB_HARDWARE_I2C_PORT1

conversions/esp_jpg_decode.c

Lines changed: 0 additions & 140 deletions
This file was deleted.

conversions/include/esp_jpg_decode.h

Lines changed: 0 additions & 43 deletions
This file was deleted.

conversions/include/img_converters.h

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD
1+
// Copyright 2015-2025 Espressif Systems (Shanghai) PTE LTD
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -22,7 +22,7 @@ extern "C" {
2222
#include <stdint.h>
2323
#include <stdbool.h>
2424
#include "esp_camera.h"
25-
#include "esp_jpg_decode.h"
25+
#include "jpeg_decoder.h"
2626

2727
typedef size_t (* jpg_out_cb)(void * arg, size_t index, const void* data, size_t len);
2828

@@ -121,7 +121,13 @@ bool frame2bmp(camera_fb_t * fb, uint8_t ** out, size_t * out_len);
121121
*/
122122
bool fmt2rgb888(const uint8_t *src_buf, size_t src_len, pixformat_t format, uint8_t * rgb_buf);
123123

124-
bool jpg2rgb565(const uint8_t *src, size_t src_len, uint8_t * out, jpg_scale_t scale);
124+
// Macros for backwards compatibility
125+
#define JPG_SCALE_NONE JPEG_IMAGE_SCALE_0
126+
#define JPG_SCALE_2X JPEG_IMAGE_SCALE_1_2
127+
#define JPG_SCALE_4X JPEG_IMAGE_SCALE_1_4
128+
#define JPG_SCALE_8X JPEG_IMAGE_SCALE_1_8
129+
#define JPG_SCALE_MAX JPEG_IMAGE_SCALE_1_8
130+
bool jpg2rgb565(const uint8_t *src, size_t src_len, uint8_t * out, esp_jpeg_image_scale_t scale);
125131

126132
#ifdef __cplusplus
127133
}

0 commit comments

Comments
 (0)