From 95b893002cc6e980a06c7b50c9b28f5a75fe1b7f Mon Sep 17 00:00:00 2001 From: Thomas Farstrike Date: Wed, 14 May 2025 12:46:33 +0200 Subject: [PATCH] Still hangs --- c_mpos/src/webcam.c | 2 +- .../apps/com.example.camtest/assets/camtest.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/c_mpos/src/webcam.c b/c_mpos/src/webcam.c index 6d666998..1a91d67f 100644 --- a/c_mpos/src/webcam.c +++ b/c_mpos/src/webcam.c @@ -13,7 +13,7 @@ #define WIDTH 640 #define HEIGHT 480 -#define NUM_BUFFERS 4 +#define NUM_BUFFERS 1 #define OUTPUT_WIDTH 240 #define OUTPUT_HEIGHT 240 diff --git a/internal_filesystem/apps/com.example.camtest/assets/camtest.py b/internal_filesystem/apps/com.example.camtest/assets/camtest.py index c6686d93..746f43d8 100644 --- a/internal_filesystem/apps/com.example.camtest/assets/camtest.py +++ b/internal_filesystem/apps/com.example.camtest/assets/camtest.py @@ -236,12 +236,12 @@ if cam or use_webcam: #webcam.recapture_frame(cam) bytes_obj = bytes(memview) print(f"got bytes: {len(bytes_obj)}") - image_dsc.data = bytes_obj - #image_dsc.data = static_bytes_obj + #image_dsc.data = bytes_obj + image_dsc.data = static_bytes_obj time.sleep_ms(200) # Allow for the MicroPython REPL to still work. Reducing it doesn't seem to affect the on-display FPS. # somehow, everything's fine until I tell LVGL to redraw the image: - image.invalidate() - #image.set_src(image_dsc) + #image.invalidate() + image.set_src(image_dsc) print("App backgrounded, deinitializing camera...") if use_webcam: webcam.deinit(cam) # Deinitializes webcam