3737#error Camera only works on boards configured with spiram
3838#endif
3939
40- // #if !defined(CONFIG_CAMERA_CORE0) && !defined(CONFIG_CAMERA_CORE1)
41- // #if MP_TASK_COREID == 0
42- // #define CONFIG_CAMERA_CORE0 1
43- // #elif MP_TASK_COREID == 1
44- // #define CONFIG_CAMERA_CORE1 1
45- // #endif
46- // #endif // CONFIG_CAMERA_COREx
47-
4840// Helper functions
4941static int map (int value , int fromLow , int fromHigh , int toLow , int toHigh ) {
5042 if (fromHigh == fromLow ) {
@@ -71,7 +63,7 @@ static void set_check_xclk_freq(mp_camera_obj_t *self, int32_t xclk_freq_hz) {
7163 }
7264}
7365
74- static void set_check_fb_count (mp_camera_obj_t * self , int fb_count ) {
66+ static void set_check_fb_count (mp_camera_obj_t * self , mp_int_t fb_count ) {
7567 if (fb_count > 2 ) {
7668 self -> camera_config .fb_count = 2 ;
7769 mp_warning (NULL , "Frame buffer size limited to 2" );
@@ -192,7 +184,7 @@ void mp_camera_hal_deinit(mp_camera_obj_t *self) {
192184
193185void mp_camera_hal_reconfigure (mp_camera_obj_t * self , mp_camera_framesize_t frame_size , mp_camera_pixformat_t pixel_format , mp_camera_grabmode_t grab_mode , mp_int_t fb_count ) {
194186 check_init (self );
195- ESP_LOGI (TAG , "Reconfiguring camera" );
187+ ESP_LOGI (TAG , "Reconfiguring camera with frame size: %d, pixel format: %d, grab mode: %d, fb count: %d" , ( int ) frame_size , ( int ) pixel_format , ( int ) grab_mode , ( int ) fb_count );
196188
197189 sensor_t * sensor = esp_camera_sensor_get ();
198190 camera_sensor_info_t * sensor_info = esp_camera_sensor_get_info (& sensor -> id );
@@ -236,6 +228,7 @@ mp_obj_t mp_camera_hal_capture(mp_camera_obj_t *self, int8_t out_format) {
236228 }
237229
238230 if (out_format >= 0 && (mp_camera_pixformat_t )out_format != self -> camera_config .pixel_format ) {
231+ ESP_LOGI (TAG , "Converting image to pixel format: %d" , out_format );
239232 switch ((mp_camera_pixformat_t )out_format ) {
240233 case PIXFORMAT_JPEG :
241234 if (frame2jpg (self -> captured_buffer , self -> camera_config .jpeg_quality , & out_buf , & out_len )) {
@@ -289,7 +282,7 @@ mp_obj_t mp_camera_hal_capture(mp_camera_obj_t *self, int8_t out_format) {
289282 }
290283
291284 if (self -> bmp_out == false) {
292- ESP_LOGI (TAG , "Returning imgae without conversion" );
285+ ESP_LOGI (TAG , "Returning image without conversion" );
293286 return mp_obj_new_memoryview ('b' , self -> captured_buffer -> len , self -> captured_buffer -> buf );
294287 } else {
295288 ESP_LOGI (TAG , "Returning image as bitmap" );
0 commit comments