7070//| :param framebuffer_count: The number of framebuffers (1 for single-buffered and 2 for double-buffered)
7171//| :param grab_mode: When to grab a new frame
7272//| """
73+ //|
7374static mp_obj_t espcamera_camera_make_new (const mp_obj_type_t * type , size_t n_args , size_t n_kw , const mp_obj_t * all_args ) {
7475 enum { ARG_data_pins , ARG_pixel_clock_pin , ARG_vsync_pin , ARG_href_pin , ARG_i2c , ARG_external_clock_pin , ARG_external_clock_frequency , ARG_powerdown_pin , ARG_reset_pin , ARG_pixel_format , ARG_frame_size , ARG_jpeg_quality , ARG_framebuffer_count , ARG_grab_mode , NUM_ARGS };
7576 static const mp_arg_t allowed_args [] = {
@@ -143,6 +144,7 @@ static mp_obj_t espcamera_camera_make_new(const mp_obj_type_t *type, size_t n_ar
143144//| def deinit(self) -> None:
144145//| """Deinitialises the camera and releases all memory resources for reuse."""
145146//| ...
147+ //|
146148static mp_obj_t espcamera_camera_deinit (mp_obj_t self_in ) {
147149 espcamera_camera_obj_t * self = MP_OBJ_TO_PTR (self_in );
148150 common_hal_espcamera_camera_deinit (self );
@@ -159,12 +161,14 @@ static void check_for_deinit(espcamera_camera_obj_t *self) {
159161//| def __enter__(self) -> Camera:
160162//| """No-op used by Context Managers."""
161163//| ...
164+ //|
162165// Provided by context manager helper.
163166
164167//| def __exit__(self) -> None:
165168//| """Automatically deinitializes the hardware when exiting a context. See
166169//| :ref:`lifetime-and-contextmanagers` for more info."""
167170//| ...
171+ //|
168172static mp_obj_t espcamera_camera_obj___exit__ (size_t n_args , const mp_obj_t * args ) {
169173 (void )n_args ;
170174 return espcamera_camera_deinit (args [0 ]);
@@ -173,6 +177,7 @@ static MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(espcamera_camera___exit___obj, 4, 4,
173177
174178//| frame_available: bool
175179//| """True if a frame is available, False otherwise"""
180+ //|
176181
177182static mp_obj_t espcamera_camera_frame_available_get (const mp_obj_t self_in ) {
178183 espcamera_camera_obj_t * self = MP_OBJ_TO_PTR (self_in );
@@ -193,6 +198,7 @@ MP_PROPERTY_GETTER(espcamera_camera_frame_available_obj,
193198//| If `pixel_format` is `PixelFormat.JPEG`, the returned value is a read-only `memoryview`.
194199//| Otherwise, the returned value is a read-only `displayio.Bitmap`.
195200//| """
201+ //|
196202static mp_obj_t espcamera_camera_take (size_t n_args , const mp_obj_t * args ) {
197203 espcamera_camera_obj_t * self = MP_OBJ_TO_PTR (args [0 ]);
198204 mp_float_t timeout = n_args < 2 ? MICROPY_FLOAT_CONST (0.25 ) : mp_obj_get_float (args [1 ]);
@@ -229,6 +235,7 @@ static MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(espcamera_camera_take_obj, 1, 2, espc
229235//| the other properties to set, they are set together in a single function call.
230236//|
231237//| If an argument is unspecified or None, then the setting is unchanged."""
238+ //|
232239
233240static mp_obj_t espcamera_camera_reconfigure (mp_uint_t n_args , const mp_obj_t * pos_args , mp_map_t * kw_args ) {
234241 espcamera_camera_obj_t * self = MP_OBJ_TO_PTR (pos_args [0 ]);
@@ -912,6 +919,7 @@ MP_PROPERTY_GETTER(espcamera_camera_grab_mode_obj,
912919//| framebuffer_count: int
913920//| """True if double buffering is used"""
914921//|
922+ //|
915923static mp_obj_t espcamera_camera_get_framebuffer_count (const mp_obj_t self_in ) {
916924 espcamera_camera_obj_t * self = MP_OBJ_TO_PTR (self_in );
917925 check_for_deinit (self );
0 commit comments