Skip to content

Commit f918d6b

Browse files
authored
Merge pull request #7492 from MicroDev1/espcamera
Move `esp32_camera` to `espcamera`
2 parents 4056602 + cda5689 commit f918d6b

File tree

51 files changed

+1181
-1181
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+1181
-1181
lines changed

locale/circuitpython.pot

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -663,6 +663,7 @@ msgstr ""
663663

664664
#: ports/espressif/boards/m5stack_core_basic/mpconfigboard.h
665665
#: ports/espressif/boards/m5stack_core_fire/mpconfigboard.h
666+
#: ports/espressif/boards/m5stack_stick_c/mpconfigboard.h
666667
msgid "Button A was pressed at start up.\n"
667668
msgstr ""
668669

@@ -2947,9 +2948,9 @@ msgstr ""
29472948
msgid "error = 0x%08lX"
29482949
msgstr ""
29492950

2950-
#: ports/espressif/common-hal/esp32_camera/Camera.c
2951+
#: ports/espressif/common-hal/espcamera/Camera.c
29512952
msgid ""
2952-
"esp32_camera.Camera requires reserved PSRAM to be configured. See the "
2953+
"espcamera.Camera requires reserved PSRAM to be configured. See the "
29532954
"documentation for instructions."
29542955
msgstr ""
29552956

@@ -3326,7 +3327,7 @@ msgstr ""
33263327
msgid "invalid micropython decorator"
33273328
msgstr ""
33283329

3329-
#: ports/espressif/common-hal/esp32_camera/Camera.c
3330+
#: ports/espressif/common-hal/espcamera/Camera.c
33303331
msgid "invalid setting"
33313332
msgstr ""
33323333

@@ -3583,7 +3584,7 @@ msgstr ""
35833584
msgid "no response from SD card"
35843585
msgstr ""
35853586

3586-
#: ports/espressif/common-hal/esp32_camera/Camera.c py/objobject.c py/runtime.c
3587+
#: ports/espressif/common-hal/espcamera/Camera.c py/objobject.c py/runtime.c
35873588
msgid "no such attribute"
35883589
msgstr ""
35893590

ports/espressif/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ set(ENV{IDF_PATH} ${CMAKE_SOURCE_DIR}/esp-idf)
88
# can build.
99
set(COMPONENTS esptool_py soc driver log main esp-tls mbedtls mdns esp_event esp_adc_cal esp_netif esp_wifi lwip ulp wpa_supplicant freertos bt usb)
1010

11-
if("${CIRCUITPY_ESP32_CAMERA}")
11+
if("${CIRCUITPY_ESPCAMERA}")
1212
message("Including esp32-camera")
1313
set(EXTRA_COMPONENT_DIRS "esp32-camera")
1414
list(APPEND COMPONENTS "esp32-camera")

ports/espressif/Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -250,10 +250,10 @@ endif
250250

251251
SRC_C += $(wildcard common-hal/espidf/*.c)
252252

253-
ifneq ($(CIRCUITPY_ESP32_CAMERA),0)
253+
ifneq ($(CIRCUITPY_ESPCAMERA),0)
254254
SRC_CAMERA := \
255-
$(wildcard common-hal/esp32_camera/*.c) \
256-
$(wildcard bindings/esp32_camera/*.c)
255+
$(wildcard common-hal/espcamera/*.c) \
256+
$(wildcard bindings/espcamera/*.c)
257257
SRC_C += $(SRC_CAMERA)
258258
CFLAGS += -isystem esp32-camera/driver/include
259259
CFLAGS += -isystem esp32-camera/conversions/include
@@ -333,7 +333,7 @@ endif
333333
.PHONY: do-sdkconfig
334334
do-sdkconfig: $(BUILD)/esp-idf/config/sdkconfig.h
335335
$(BUILD)/esp-idf/config/sdkconfig.h: boards/$(BOARD)/sdkconfig CMakeLists.txt | $(BUILD)/esp-idf
336-
IDF_PATH=$(IDF_PATH) cmake -S . -B $(BUILD)/esp-idf -DSDKCONFIG=$(BUILD)/esp-idf/sdkconfig -DSDKCONFIG_DEFAULTS="$(SDKCONFIGS)" -DCMAKE_TOOLCHAIN_FILE=$(IDF_PATH)/tools/cmake/toolchain-$(IDF_TARGET).cmake -DIDF_TARGET=$(IDF_TARGET) -GNinja -DCIRCUITPY_ESP32_CAMERA=$(CIRCUITPY_ESP32_CAMERA)
336+
IDF_PATH=$(IDF_PATH) cmake -S . -B $(BUILD)/esp-idf -DSDKCONFIG=$(BUILD)/esp-idf/sdkconfig -DSDKCONFIG_DEFAULTS="$(SDKCONFIGS)" -DCMAKE_TOOLCHAIN_FILE=$(IDF_PATH)/tools/cmake/toolchain-$(IDF_TARGET).cmake -DIDF_TARGET=$(IDF_TARGET) -GNinja -DCIRCUITPY_ESPCAMERA=$(CIRCUITPY_ESPCAMERA)
337337

338338
# build a lib
339339
# Adding -d explain -j 1 -v to the ninja line will output debug info
@@ -385,7 +385,7 @@ BINARY_BLOBS += esp-idf/components/xtensa/$(IDF_TARGET)/libxt_hal.a
385385
ESP_IDF_COMPONENTS_EXPANDED += esp-idf/components/xtensa/$(IDF_TARGET)/libxt_hal.a
386386
endif
387387

388-
ifneq ($(CIRCUITPY_ESP32_CAMERA),0)
388+
ifneq ($(CIRCUITPY_ESPCAMERA),0)
389389
ESP_IDF_COMPONENTS_EXPANDED += $(BUILD)/esp-idf/esp-idf/esp32-camera/libesp32-camera.a
390390
#$(error $(ESP_IDF_COMPONENTS_EXPANDED))
391391
endif

ports/espressif/bindings/esp32_camera/Camera.c

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

ports/espressif/bindings/espcamera/Camera.c

Lines changed: 1001 additions & 0 deletions
Large diffs are not rendered by default.

ports/espressif/bindings/esp32_camera/Camera.h renamed to ports/espressif/bindings/espcamera/Camera.h

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@
3333

3434
#include "shared-bindings/busio/I2C.h"
3535

36-
extern const mp_obj_type_t esp32_camera_camera_type;
37-
typedef struct esp32_camera_camera_obj esp32_camera_camera_obj_t;
36+
extern const mp_obj_type_t espcamera_camera_type;
37+
typedef struct espcamera_camera_obj espcamera_camera_obj_t;
3838

39-
extern void common_hal_esp32_camera_camera_construct(
40-
esp32_camera_camera_obj_t *self,
39+
extern void common_hal_espcamera_camera_construct(
40+
espcamera_camera_obj_t *self,
4141
uint8_t data_pins[8],
4242
const mcu_pin_obj_t *external_clock_pin,
4343
const mcu_pin_obj_t *pixel_clock_pin,
@@ -53,11 +53,11 @@ extern void common_hal_esp32_camera_camera_construct(
5353
mp_int_t framebuffer_count,
5454
camera_grab_mode_t grab_mode);
5555

56-
extern void common_hal_esp32_camera_camera_deinit(esp32_camera_camera_obj_t *self);
57-
extern bool common_hal_esp32_camera_camera_deinited(esp32_camera_camera_obj_t *self);
58-
extern bool common_hal_esp32_camera_camera_available(esp32_camera_camera_obj_t *self);
59-
extern camera_fb_t *common_hal_esp32_camera_camera_take(esp32_camera_camera_obj_t *self, int timeout_ms);
60-
extern void common_hal_esp32_camera_camera_reconfigure(esp32_camera_camera_obj_t *self, framesize_t frame_size, pixformat_t pixel_format, camera_grab_mode_t grab_mode, mp_int_t framebuffer_count);
56+
extern void common_hal_espcamera_camera_deinit(espcamera_camera_obj_t *self);
57+
extern bool common_hal_espcamera_camera_deinited(espcamera_camera_obj_t *self);
58+
extern bool common_hal_espcamera_camera_available(espcamera_camera_obj_t *self);
59+
extern camera_fb_t *common_hal_espcamera_camera_take(espcamera_camera_obj_t *self, int timeout_ms);
60+
extern void common_hal_espcamera_camera_reconfigure(espcamera_camera_obj_t *self, framesize_t frame_size, pixformat_t pixel_format, camera_grab_mode_t grab_mode, mp_int_t framebuffer_count);
6161

6262
#define DECLARE_SENSOR_GETSET(type, name, field_name, setter_function_name) \
6363
DECLARE_SENSOR_GET(type, name, field_name, setter_function_name) \
@@ -70,10 +70,10 @@ extern void common_hal_esp32_camera_camera_reconfigure(esp32_camera_camera_obj_t
7070
DECLARE_SENSOR_GET(type, name, status.status_field_name, setter_function_name)
7171

7272
#define DECLARE_SENSOR_GET(type, name, status_field_name, setter_function_name) \
73-
extern type common_hal_esp32_camera_camera_get_##name(esp32_camera_camera_obj_t * self);
73+
extern type common_hal_espcamera_camera_get_##name(espcamera_camera_obj_t * self);
7474

7575
#define DECLARE_SENSOR_SET(type, name, setter_function_name) \
76-
extern void common_hal_esp32_camera_camera_set_##name(esp32_camera_camera_obj_t * self, type value);
76+
extern void common_hal_espcamera_camera_set_##name(espcamera_camera_obj_t * self, type value);
7777

7878
DECLARE_SENSOR_GET(pixformat_t, pixel_format, pixformat, set_pixformat)
7979
DECLARE_SENSOR_STATUS_GET(framesize_t, frame_size, framesize, set_framesize)
@@ -104,13 +104,13 @@ DECLARE_SENSOR_STATUS_GETSET(bool, raw_gma, raw_gma, set_raw_gma);
104104
DECLARE_SENSOR_STATUS_GETSET(bool, lenc, lenc, set_lenc);
105105

106106
// From settings
107-
extern camera_grab_mode_t common_hal_esp32_camera_camera_get_grab_mode(esp32_camera_camera_obj_t *self);
108-
extern int common_hal_esp32_camera_camera_get_framebuffer_count(esp32_camera_camera_obj_t *self);
107+
extern camera_grab_mode_t common_hal_espcamera_camera_get_grab_mode(espcamera_camera_obj_t *self);
108+
extern int common_hal_espcamera_camera_get_framebuffer_count(espcamera_camera_obj_t *self);
109109

110110
// From camera_sensor_info_t
111-
extern int common_hal_esp32_camera_camera_get_address(esp32_camera_camera_obj_t *self);
112-
extern const char *common_hal_esp32_camera_camera_get_sensor_name(esp32_camera_camera_obj_t *self);
113-
extern const bool common_hal_esp32_camera_camera_get_supports_jpeg(esp32_camera_camera_obj_t *self);
114-
extern framesize_t common_hal_esp32_camera_camera_get_max_frame_size(esp32_camera_camera_obj_t *self);
115-
extern int common_hal_esp32_camera_camera_get_width(esp32_camera_camera_obj_t *self);
116-
extern int common_hal_esp32_camera_camera_get_height(esp32_camera_camera_obj_t *self);
111+
extern int common_hal_espcamera_camera_get_address(espcamera_camera_obj_t *self);
112+
extern const char *common_hal_espcamera_camera_get_sensor_name(espcamera_camera_obj_t *self);
113+
extern const bool common_hal_espcamera_camera_get_supports_jpeg(espcamera_camera_obj_t *self);
114+
extern framesize_t common_hal_espcamera_camera_get_max_frame_size(espcamera_camera_obj_t *self);
115+
extern int common_hal_espcamera_camera_get_width(espcamera_camera_obj_t *self);
116+
extern int common_hal_espcamera_camera_get_height(espcamera_camera_obj_t *self);

ports/espressif/bindings/esp32_camera/__init__.c renamed to ports/espressif/bindings/espcamera/__init__.c

Lines changed: 68 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@
2929
#include "py/mphal.h"
3030

3131
#include "bindings/espidf/__init__.h"
32-
#include "bindings/esp32_camera/__init__.h"
33-
#include "bindings/esp32_camera/Camera.h"
32+
#include "bindings/espcamera/__init__.h"
33+
#include "bindings/espcamera/Camera.h"
3434

3535
#include "esp_camera.h"
3636
#include "sensor.h"
3737

38-
//| """Wrapper for the esp32_camera library
38+
//| """Wrapper for the espcamera library
3939
//|
4040
//| This library enables access to any camera sensor supported by the library,
4141
//| including OV5640 and OV2640.
@@ -56,20 +56,20 @@
5656
//| """Except when 1 frame buffer is used, queue will always contain the last ``fb_count`` frames"""
5757
//|
5858

59-
MAKE_ENUM_VALUE(esp32_camera_grab_mode_type, grab_mode, WHEN_EMPTY, CAMERA_GRAB_WHEN_EMPTY);
60-
MAKE_ENUM_VALUE(esp32_camera_grab_mode_type, grab_mode, LATEST, CAMERA_GRAB_LATEST);
59+
MAKE_ENUM_VALUE(espcamera_grab_mode_type, grab_mode, WHEN_EMPTY, CAMERA_GRAB_WHEN_EMPTY);
60+
MAKE_ENUM_VALUE(espcamera_grab_mode_type, grab_mode, LATEST, CAMERA_GRAB_LATEST);
6161

62-
MAKE_ENUM_MAP(esp32_camera_grab_mode) {
62+
MAKE_ENUM_MAP(espcamera_grab_mode) {
6363
MAKE_ENUM_MAP_ENTRY(grab_mode, WHEN_EMPTY),
6464
MAKE_ENUM_MAP_ENTRY(grab_mode, LATEST),
6565
};
6666

67-
STATIC MP_DEFINE_CONST_DICT(esp32_camera_grab_mode_locals_dict, esp32_camera_grab_mode_locals_table);
68-
MAKE_PRINTER(esp32_camera, esp32_camera_grab_mode);
69-
MAKE_ENUM_TYPE(esp32_camera, GrabMode, esp32_camera_grab_mode);
67+
STATIC MP_DEFINE_CONST_DICT(espcamera_grab_mode_locals_dict, espcamera_grab_mode_locals_table);
68+
MAKE_PRINTER(espcamera, espcamera_grab_mode);
69+
MAKE_ENUM_TYPE(espcamera, GrabMode, espcamera_grab_mode);
7070

7171
camera_grab_mode_t validate_grab_mode(mp_obj_t obj, qstr arg_name) {
72-
return cp_enum_value(&esp32_camera_grab_mode_type, obj, arg_name);
72+
return cp_enum_value(&espcamera_grab_mode_type, obj, arg_name);
7373
}
7474

7575
//| class PixelFormat:
@@ -85,22 +85,22 @@ camera_grab_mode_t validate_grab_mode(mp_obj_t obj, qstr arg_name) {
8585
//| """A compressed format"""
8686
//|
8787

88-
MAKE_ENUM_VALUE(esp32_camera_pixel_format_type, pixel_format, RGB565, PIXFORMAT_RGB565);
89-
MAKE_ENUM_VALUE(esp32_camera_pixel_format_type, pixel_format, GRAYSCALE, PIXFORMAT_GRAYSCALE);
90-
MAKE_ENUM_VALUE(esp32_camera_pixel_format_type, pixel_format, JPEG, PIXFORMAT_JPEG);
88+
MAKE_ENUM_VALUE(espcamera_pixel_format_type, pixel_format, RGB565, PIXFORMAT_RGB565);
89+
MAKE_ENUM_VALUE(espcamera_pixel_format_type, pixel_format, GRAYSCALE, PIXFORMAT_GRAYSCALE);
90+
MAKE_ENUM_VALUE(espcamera_pixel_format_type, pixel_format, JPEG, PIXFORMAT_JPEG);
9191

92-
MAKE_ENUM_MAP(esp32_camera_pixel_format) {
92+
MAKE_ENUM_MAP(espcamera_pixel_format) {
9393
MAKE_ENUM_MAP_ENTRY(pixel_format, RGB565),
9494
MAKE_ENUM_MAP_ENTRY(pixel_format, GRAYSCALE),
9595
MAKE_ENUM_MAP_ENTRY(pixel_format, JPEG),
9696
};
9797

98-
STATIC MP_DEFINE_CONST_DICT(esp32_camera_pixel_format_locals_dict, esp32_camera_pixel_format_locals_table);
99-
MAKE_PRINTER(esp32_camera, esp32_camera_pixel_format);
100-
MAKE_ENUM_TYPE(esp32_camera, PixelFormat, esp32_camera_pixel_format);
98+
STATIC MP_DEFINE_CONST_DICT(espcamera_pixel_format_locals_dict, espcamera_pixel_format_locals_table);
99+
MAKE_PRINTER(espcamera, espcamera_pixel_format);
100+
MAKE_ENUM_TYPE(espcamera, PixelFormat, espcamera_pixel_format);
101101

102102
pixformat_t validate_pixel_format(mp_obj_t obj, qstr arg_name) {
103-
return cp_enum_value(&esp32_camera_pixel_format_type, obj, arg_name);
103+
return cp_enum_value(&espcamera_pixel_format_type, obj, arg_name);
104104
}
105105

106106
//| class FrameSize:
@@ -173,29 +173,29 @@ pixformat_t validate_pixel_format(mp_obj_t obj, qstr arg_name) {
173173
//| """2560x1920"""
174174
//|
175175

176-
MAKE_ENUM_VALUE(esp32_camera_frame_size_type, frame_size, R96X96, FRAMESIZE_96X96);
177-
MAKE_ENUM_VALUE(esp32_camera_frame_size_type, frame_size, R240X240, FRAMESIZE_240X240);
178-
MAKE_ENUM_VALUE(esp32_camera_frame_size_type, frame_size, QQVGA, FRAMESIZE_QQVGA);
179-
MAKE_ENUM_VALUE(esp32_camera_frame_size_type, frame_size, QCIF, FRAMESIZE_QCIF);
180-
MAKE_ENUM_VALUE(esp32_camera_frame_size_type, frame_size, HQVGA, FRAMESIZE_HQVGA);
181-
MAKE_ENUM_VALUE(esp32_camera_frame_size_type, frame_size, QVGA, FRAMESIZE_QVGA);
182-
MAKE_ENUM_VALUE(esp32_camera_frame_size_type, frame_size, CIF, FRAMESIZE_CIF);
183-
MAKE_ENUM_VALUE(esp32_camera_frame_size_type, frame_size, HVGA, FRAMESIZE_HVGA);
184-
MAKE_ENUM_VALUE(esp32_camera_frame_size_type, frame_size, VGA, FRAMESIZE_VGA);
185-
MAKE_ENUM_VALUE(esp32_camera_frame_size_type, frame_size, SVGA, FRAMESIZE_SVGA);
186-
MAKE_ENUM_VALUE(esp32_camera_frame_size_type, frame_size, XGA, FRAMESIZE_XGA);
187-
MAKE_ENUM_VALUE(esp32_camera_frame_size_type, frame_size, HD, FRAMESIZE_HD);
188-
MAKE_ENUM_VALUE(esp32_camera_frame_size_type, frame_size, SXGA, FRAMESIZE_SXGA);
189-
MAKE_ENUM_VALUE(esp32_camera_frame_size_type, frame_size, UXGA, FRAMESIZE_UXGA);
190-
MAKE_ENUM_VALUE(esp32_camera_frame_size_type, frame_size, FHD, FRAMESIZE_FHD);
191-
MAKE_ENUM_VALUE(esp32_camera_frame_size_type, frame_size, P_HD, FRAMESIZE_P_HD);
192-
MAKE_ENUM_VALUE(esp32_camera_frame_size_type, frame_size, P_3MP, FRAMESIZE_P_3MP);
193-
MAKE_ENUM_VALUE(esp32_camera_frame_size_type, frame_size, QXGA, FRAMESIZE_QXGA);
194-
MAKE_ENUM_VALUE(esp32_camera_frame_size_type, frame_size, QHD, FRAMESIZE_QHD);
195-
MAKE_ENUM_VALUE(esp32_camera_frame_size_type, frame_size, WQXGA, FRAMESIZE_WQXGA);
196-
MAKE_ENUM_VALUE(esp32_camera_frame_size_type, frame_size, P_FHD, FRAMESIZE_P_FHD);
197-
MAKE_ENUM_VALUE(esp32_camera_frame_size_type, frame_size, QSXGA, FRAMESIZE_QSXGA);
198-
MAKE_ENUM_MAP(esp32_camera_frame_size) {
176+
MAKE_ENUM_VALUE(espcamera_frame_size_type, frame_size, R96X96, FRAMESIZE_96X96);
177+
MAKE_ENUM_VALUE(espcamera_frame_size_type, frame_size, R240X240, FRAMESIZE_240X240);
178+
MAKE_ENUM_VALUE(espcamera_frame_size_type, frame_size, QQVGA, FRAMESIZE_QQVGA);
179+
MAKE_ENUM_VALUE(espcamera_frame_size_type, frame_size, QCIF, FRAMESIZE_QCIF);
180+
MAKE_ENUM_VALUE(espcamera_frame_size_type, frame_size, HQVGA, FRAMESIZE_HQVGA);
181+
MAKE_ENUM_VALUE(espcamera_frame_size_type, frame_size, QVGA, FRAMESIZE_QVGA);
182+
MAKE_ENUM_VALUE(espcamera_frame_size_type, frame_size, CIF, FRAMESIZE_CIF);
183+
MAKE_ENUM_VALUE(espcamera_frame_size_type, frame_size, HVGA, FRAMESIZE_HVGA);
184+
MAKE_ENUM_VALUE(espcamera_frame_size_type, frame_size, VGA, FRAMESIZE_VGA);
185+
MAKE_ENUM_VALUE(espcamera_frame_size_type, frame_size, SVGA, FRAMESIZE_SVGA);
186+
MAKE_ENUM_VALUE(espcamera_frame_size_type, frame_size, XGA, FRAMESIZE_XGA);
187+
MAKE_ENUM_VALUE(espcamera_frame_size_type, frame_size, HD, FRAMESIZE_HD);
188+
MAKE_ENUM_VALUE(espcamera_frame_size_type, frame_size, SXGA, FRAMESIZE_SXGA);
189+
MAKE_ENUM_VALUE(espcamera_frame_size_type, frame_size, UXGA, FRAMESIZE_UXGA);
190+
MAKE_ENUM_VALUE(espcamera_frame_size_type, frame_size, FHD, FRAMESIZE_FHD);
191+
MAKE_ENUM_VALUE(espcamera_frame_size_type, frame_size, P_HD, FRAMESIZE_P_HD);
192+
MAKE_ENUM_VALUE(espcamera_frame_size_type, frame_size, P_3MP, FRAMESIZE_P_3MP);
193+
MAKE_ENUM_VALUE(espcamera_frame_size_type, frame_size, QXGA, FRAMESIZE_QXGA);
194+
MAKE_ENUM_VALUE(espcamera_frame_size_type, frame_size, QHD, FRAMESIZE_QHD);
195+
MAKE_ENUM_VALUE(espcamera_frame_size_type, frame_size, WQXGA, FRAMESIZE_WQXGA);
196+
MAKE_ENUM_VALUE(espcamera_frame_size_type, frame_size, P_FHD, FRAMESIZE_P_FHD);
197+
MAKE_ENUM_VALUE(espcamera_frame_size_type, frame_size, QSXGA, FRAMESIZE_QSXGA);
198+
MAKE_ENUM_MAP(espcamera_frame_size) {
199199
MAKE_ENUM_MAP_ENTRY(frame_size, R96X96),
200200
MAKE_ENUM_MAP_ENTRY(frame_size, R240X240),
201201
MAKE_ENUM_MAP_ENTRY(frame_size, QQVGA),
@@ -220,12 +220,12 @@ MAKE_ENUM_MAP(esp32_camera_frame_size) {
220220
MAKE_ENUM_MAP_ENTRY(frame_size, QSXGA),
221221
};
222222

223-
STATIC MP_DEFINE_CONST_DICT(esp32_camera_frame_size_locals_dict, esp32_camera_frame_size_locals_table);
224-
MAKE_PRINTER(esp32_camera, esp32_camera_frame_size);
225-
MAKE_ENUM_TYPE(esp32_camera, FrameSize, esp32_camera_frame_size);
223+
STATIC MP_DEFINE_CONST_DICT(espcamera_frame_size_locals_dict, espcamera_frame_size_locals_table);
224+
MAKE_PRINTER(espcamera, espcamera_frame_size);
225+
MAKE_ENUM_TYPE(espcamera, FrameSize, espcamera_frame_size);
226226

227227
framesize_t validate_frame_size(mp_obj_t obj, qstr arg_name) {
228-
return cp_enum_value(&esp32_camera_frame_size_type, obj, arg_name);
228+
return cp_enum_value(&espcamera_frame_size_type, obj, arg_name);
229229
}
230230

231231
//| class GainCeiling:
@@ -242,15 +242,15 @@ framesize_t validate_frame_size(mp_obj_t obj, qstr arg_name) {
242242
//| GAIN_128X: GainCeiling
243243
//|
244244

245-
MAKE_ENUM_VALUE(esp32_camera_gain_ceiling_type, gain_ceiling, GAIN_2X, GAINCEILING_2X);
246-
MAKE_ENUM_VALUE(esp32_camera_gain_ceiling_type, gain_ceiling, GAIN_4X, GAINCEILING_4X);
247-
MAKE_ENUM_VALUE(esp32_camera_gain_ceiling_type, gain_ceiling, GAIN_8X, GAINCEILING_8X);
248-
MAKE_ENUM_VALUE(esp32_camera_gain_ceiling_type, gain_ceiling, GAIN_16X, GAINCEILING_16X);
249-
MAKE_ENUM_VALUE(esp32_camera_gain_ceiling_type, gain_ceiling, GAIN_32X, GAINCEILING_32X);
250-
MAKE_ENUM_VALUE(esp32_camera_gain_ceiling_type, gain_ceiling, GAIN_64X, GAINCEILING_64X);
251-
MAKE_ENUM_VALUE(esp32_camera_gain_ceiling_type, gain_ceiling, GAIN_128X, GAINCEILING_128X);
245+
MAKE_ENUM_VALUE(espcamera_gain_ceiling_type, gain_ceiling, GAIN_2X, GAINCEILING_2X);
246+
MAKE_ENUM_VALUE(espcamera_gain_ceiling_type, gain_ceiling, GAIN_4X, GAINCEILING_4X);
247+
MAKE_ENUM_VALUE(espcamera_gain_ceiling_type, gain_ceiling, GAIN_8X, GAINCEILING_8X);
248+
MAKE_ENUM_VALUE(espcamera_gain_ceiling_type, gain_ceiling, GAIN_16X, GAINCEILING_16X);
249+
MAKE_ENUM_VALUE(espcamera_gain_ceiling_type, gain_ceiling, GAIN_32X, GAINCEILING_32X);
250+
MAKE_ENUM_VALUE(espcamera_gain_ceiling_type, gain_ceiling, GAIN_64X, GAINCEILING_64X);
251+
MAKE_ENUM_VALUE(espcamera_gain_ceiling_type, gain_ceiling, GAIN_128X, GAINCEILING_128X);
252252

253-
MAKE_ENUM_MAP(esp32_camera_gain_ceiling) {
253+
MAKE_ENUM_MAP(espcamera_gain_ceiling) {
254254
MAKE_ENUM_MAP_ENTRY(gain_ceiling, GAIN_2X),
255255
MAKE_ENUM_MAP_ENTRY(gain_ceiling, GAIN_4X),
256256
MAKE_ENUM_MAP_ENTRY(gain_ceiling, GAIN_8X),
@@ -260,28 +260,28 @@ MAKE_ENUM_MAP(esp32_camera_gain_ceiling) {
260260
MAKE_ENUM_MAP_ENTRY(gain_ceiling, GAIN_128X)
261261
};
262262

263-
STATIC MP_DEFINE_CONST_DICT(esp32_camera_gain_ceiling_locals_dict, esp32_camera_gain_ceiling_locals_table);
264-
MAKE_PRINTER(esp32_camera, esp32_camera_gain_ceiling);
265-
MAKE_ENUM_TYPE(esp32_camera, GainCeiling, esp32_camera_gain_ceiling);
263+
STATIC MP_DEFINE_CONST_DICT(espcamera_gain_ceiling_locals_dict, espcamera_gain_ceiling_locals_table);
264+
MAKE_PRINTER(espcamera, espcamera_gain_ceiling);
265+
MAKE_ENUM_TYPE(espcamera, GainCeiling, espcamera_gain_ceiling);
266266

267267
gainceiling_t validate_gain_ceiling(mp_obj_t obj, qstr arg_name) {
268-
return cp_enum_value(&esp32_camera_gain_ceiling_type, obj, arg_name);
268+
return cp_enum_value(&espcamera_gain_ceiling_type, obj, arg_name);
269269
}
270270

271-
STATIC const mp_rom_map_elem_t esp32_camera_module_globals_table[] = {
272-
{ MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_esp32_camera) },
273-
{ MP_ROM_QSTR(MP_QSTR_Camera), MP_ROM_PTR(&esp32_camera_camera_type), },
274-
{ MP_ROM_QSTR(MP_QSTR_FrameSize), &esp32_camera_frame_size_type },
275-
{ MP_ROM_QSTR(MP_QSTR_GainCeiling), &esp32_camera_gain_ceiling_type },
276-
{ MP_ROM_QSTR(MP_QSTR_GrabMode), &esp32_camera_grab_mode_type },
277-
{ MP_ROM_QSTR(MP_QSTR_PixelFormat), &esp32_camera_pixel_format_type },
271+
STATIC const mp_rom_map_elem_t espcamera_module_globals_table[] = {
272+
{ MP_ROM_QSTR(MP_QSTR___name__), MP_ROM_QSTR(MP_QSTR_espcamera) },
273+
{ MP_ROM_QSTR(MP_QSTR_Camera), MP_ROM_PTR(&espcamera_camera_type), },
274+
{ MP_ROM_QSTR(MP_QSTR_FrameSize), &espcamera_frame_size_type },
275+
{ MP_ROM_QSTR(MP_QSTR_GainCeiling), &espcamera_gain_ceiling_type },
276+
{ MP_ROM_QSTR(MP_QSTR_GrabMode), &espcamera_grab_mode_type },
277+
{ MP_ROM_QSTR(MP_QSTR_PixelFormat), &espcamera_pixel_format_type },
278278
};
279279

280-
STATIC MP_DEFINE_CONST_DICT(esp32_camera_module_globals, esp32_camera_module_globals_table);
280+
STATIC MP_DEFINE_CONST_DICT(espcamera_module_globals, espcamera_module_globals_table);
281281

282-
const mp_obj_module_t esp32_camera_module = {
282+
const mp_obj_module_t espcamera_module = {
283283
.base = { &mp_type_module },
284-
.globals = (mp_obj_dict_t *)&esp32_camera_module_globals,
284+
.globals = (mp_obj_dict_t *)&espcamera_module_globals,
285285
};
286286

287-
MP_REGISTER_MODULE(MP_QSTR_esp32_camera, esp32_camera_module, CIRCUITPY_ESP32_CAMERA);
287+
MP_REGISTER_MODULE(MP_QSTR_espcamera, espcamera_module, CIRCUITPY_ESPCAMERA);

0 commit comments

Comments
 (0)