From 4a98f550ecb717f5197d7a2e44a971faa689ec87 Mon Sep 17 00:00:00 2001 From: wangjianyu3 Date: Mon, 16 Mar 2026 20:18:18 +0800 Subject: [PATCH 1/2] examples/camera: fix build error and still capture logic Add missing #include in camera_bkgd.c to fix implicit declaration of boardctl() and undeclared BOARDIOC_NX_START. Also fix capture_num check in camera_main.c to only apply still capture size enumeration when capture_type is STILL_CAPTURE. Signed-off-by: wangjianyu3 --- examples/camera/camera_bkgd.c | 1 + examples/camera/camera_main.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/camera/camera_bkgd.c b/examples/camera/camera_bkgd.c index c53b11ab8b3..4703b1ea5be 100644 --- a/examples/camera/camera_bkgd.c +++ b/examples/camera/camera_bkgd.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include diff --git a/examples/camera/camera_main.c b/examples/camera/camera_main.c index 43f1fff9d52..32ad1a460a5 100644 --- a/examples/camera/camera_main.c +++ b/examples/camera/camera_main.c @@ -537,7 +537,7 @@ int main(int argc, FAR char *argv[]) * And all allocated memorys are VIDIOC_QBUFed. */ - if (capture_num != 0) + if (capture_num != 0 && capture_type == V4L2_BUF_TYPE_STILL_CAPTURE) { /* Determine image size from connected image sensor name, * because video driver does not support VIDIOC_ENUM_FRAMESIZES From eb940a62e7e03c620c5bac025ee7193ad2f92ef7 Mon Sep 17 00:00:00 2001 From: wangjianyu3 Date: Mon, 16 Mar 2026 20:31:54 +0800 Subject: [PATCH 2/2] examples/camera: fix spelling errors Fix typos found by codespell: - camera_bkgd.c: defaul -> default - camera_main.c: memorys -> memories (2 occurrences) - camera_main.c: freame -> frame - camera_main.c: valiable -> variable Signed-off-by: wangjianyu3 --- examples/camera/camera_bkgd.c | 2 +- examples/camera/camera_main.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/camera/camera_bkgd.c b/examples/camera/camera_bkgd.c index 4703b1ea5be..aa146447149 100644 --- a/examples/camera/camera_bkgd.c +++ b/examples/camera/camera_bkgd.c @@ -249,7 +249,7 @@ int nximage_initialize(void) } /* Start a separate thread to listen for server events. - * For simplicity, use defaul thread attribute. + * For simplicity, use default thread attribute. */ ret = pthread_create(&thread, NULL, nximage_listener, NULL); diff --git a/examples/camera/camera_main.c b/examples/camera/camera_main.c index 32ad1a460a5..a342008b50f 100644 --- a/examples/camera/camera_main.c +++ b/examples/camera/camera_main.c @@ -534,7 +534,7 @@ int main(int argc, FAR char *argv[]) * Set FULLHD size in ISX012 case, QUADVGA size in ISX019 case or other * image sensors, * Number of frame buffers is defined as STILL_BUFNUM(1). - * And all allocated memorys are VIDIOC_QBUFed. + * And all allocated memories are VIDIOC_QBUFed. */ if (capture_num != 0 && capture_type == V4L2_BUF_TYPE_STILL_CAPTURE) @@ -580,9 +580,9 @@ int main(int argc, FAR char *argv[]) * order from the captured frame buffer and a new camera image is * recaptured. * - * Allocate freame buffers for QVGA RGB565 size (320x240x2=150KB). + * Allocate frame buffers for QVGA RGB565 size (320x240x2=150KB). * Number of frame buffers is defined as VIDEO_BUFNUM(3). - * And all allocated memorys are VIDIOC_QBUFed. + * And all allocated memories are VIDIOC_QBUFed. */ ret = camera_prepare(v_fd, V4L2_BUF_TYPE_VIDEO_CAPTURE, @@ -603,7 +603,7 @@ int main(int argc, FAR char *argv[]) * * APP_STATE_UNDER_CAPTURE: * This state will start taking picture and store the image into files. - * Number of taking pictures is set capture_num valiable. + * Number of taking pictures is set capture_num variable. * It can be changed by command line argument. * After finishing taking pictures, the state will be changed to * APP_STATE_AFTER_CAPTURE.