Skip to content

Commit 84baebd

Browse files
Fix camera again...
1 parent d83f6ba commit 84baebd

File tree

3 files changed

+15
-10
lines changed

3 files changed

+15
-10
lines changed

draft_code/saved_functions.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -616,16 +616,20 @@ def log_callback(level, log_str):
616616
# Register log callback
617617
lv.log_register_print_cb(log_callback)
618618

619+
619620
# Function to get FPS
620621
def get_fps():
621622
return fps_buffer[0]
622623

623-
fps = get_fps()
624-
if fps > 0: # Only print when FPS is updated
625-
print("Current FPS:", fps)
624+
625+
#fps = get_fps()
626+
#if fps > 0: # Only print when FPS is updated
627+
# print("Current FPS:", fps)
628+
626629

627630
# Main loop
628631
for _ in range(10):
632+
import time
629633
fps = get_fps()
630634
if fps > 0: # Only print when FPS is updated
631635
print("Current FPS:", fps)

internal_filesystem/apps/com.example.camtest/assets/camtest.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ def close_button_click(e):
9494
xclk_freq=20000000,
9595
powerdown_pin=-1,
9696
reset_pin=-1,
97-
#pixel_format=PixelFormat.RGB565,
98-
pixel_format=PixelFormat.GRAYSCALE,
97+
pixel_format=PixelFormat.RGB565,
98+
#pixel_format=PixelFormat.GRAYSCALE,
9999
frame_size=FrameSize.R240X240,
100100
grab_mode=GrabMode.LATEST
101101
)
@@ -120,11 +120,11 @@ def close_button_click(e):
120120
"magic": lv.IMAGE_HEADER_MAGIC,
121121
"w": width,
122122
"h": height,
123-
"stride": width ,
124-
#"cf": lv.COLOR_FORMAT.RGB565
125-
"cf": lv.COLOR_FORMAT.L8
123+
"stride": width *2,
124+
"cf": lv.COLOR_FORMAT.RGB565
125+
#"cf": lv.COLOR_FORMAT.L8
126126
},
127-
'data_size': width * height,
127+
'data_size': width * height*2,
128128
'data': None # Will be updated per frame
129129
})
130130

internal_filesystem/lib/mpos/apps.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ def execute_script_new_thread(scriptname, is_file, is_launcher, is_graphical):
6767
# 168KB maximum at startup but 136KB after loading display, drivers, LVGL gui etc so let's go for 128KB for now, still a lot...
6868
# 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.
6969
# 16KB allows for 10 threads in the apps, but seems too tight for urequests on unix (desktop) targets
70-
_thread.stack_size(24576)
70+
#_thread.stack_size(24576) # causes camera issue...
71+
_thread.stack_size(16384)
7172
_thread.start_new_thread(execute_script, (scriptname, is_file, is_launcher, is_graphical))
7273
except Exception as e:
7374
print("main.py: execute_script_new_thread(): error starting new thread thread: ", e)

0 commit comments

Comments
 (0)