diff --git a/draft_code/saved_functions.py b/draft_code/saved_functions.py index 7090f4d5..a329035f 100644 --- a/draft_code/saved_functions.py +++ b/draft_code/saved_functions.py @@ -616,16 +616,20 @@ def log_callback(level, log_str): # Register log callback lv.log_register_print_cb(log_callback) + # Function to get FPS def get_fps(): return fps_buffer[0] -fps = get_fps() -if fps > 0: # Only print when FPS is updated - print("Current FPS:", fps) + +#fps = get_fps() +#if fps > 0: # Only print when FPS is updated +# print("Current FPS:", fps) + # Main loop for _ in range(10): + import time fps = get_fps() if fps > 0: # Only print when FPS is updated print("Current FPS:", fps) diff --git a/internal_filesystem/apps/com.example.camtest/assets/camtest.py b/internal_filesystem/apps/com.example.camtest/assets/camtest.py index 3d59d9de..3bd8cb91 100644 --- a/internal_filesystem/apps/com.example.camtest/assets/camtest.py +++ b/internal_filesystem/apps/com.example.camtest/assets/camtest.py @@ -94,8 +94,8 @@ cam = Camera( xclk_freq=20000000, powerdown_pin=-1, reset_pin=-1, - #pixel_format=PixelFormat.RGB565, - pixel_format=PixelFormat.GRAYSCALE, + pixel_format=PixelFormat.RGB565, + #pixel_format=PixelFormat.GRAYSCALE, frame_size=FrameSize.R240X240, grab_mode=GrabMode.LATEST ) @@ -120,11 +120,11 @@ image_dsc = lv.image_dsc_t({ "magic": lv.IMAGE_HEADER_MAGIC, "w": width, "h": height, - "stride": width , - #"cf": lv.COLOR_FORMAT.RGB565 - "cf": lv.COLOR_FORMAT.L8 + "stride": width *2, + "cf": lv.COLOR_FORMAT.RGB565 + #"cf": lv.COLOR_FORMAT.L8 }, - 'data_size': width * height, + 'data_size': width * height*2, 'data': None # Will be updated per frame }) diff --git a/internal_filesystem/lib/mpos/apps.py b/internal_filesystem/lib/mpos/apps.py index b2cf3de9..4de9d46e 100644 --- a/internal_filesystem/lib/mpos/apps.py +++ b/internal_filesystem/lib/mpos/apps.py @@ -67,7 +67,8 @@ def execute_script_new_thread(scriptname, is_file, is_launcher, is_graphical): # 168KB maximum at startup but 136KB after loading display, drivers, LVGL gui etc so let's go for 128KB for now, still a lot... # But then no additional threads can be created. A stacksize of 32KB allows for 4 threads, so 3 in the app itself, which might be tight. # 16KB allows for 10 threads in the apps, but seems too tight for urequests on unix (desktop) targets - _thread.stack_size(24576) + #_thread.stack_size(24576) # causes camera issue... + _thread.stack_size(16384) _thread.start_new_thread(execute_script, (scriptname, is_file, is_launcher, is_graphical)) except Exception as e: print("main.py: execute_script_new_thread(): error starting new thread thread: ", e)