Skip to content

Commit a00137c

Browse files
if apps started in new thread then give appstore and camera a bit more stack
1 parent c6aa98a commit a00137c

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

  • internal_filesystem/lib/mpos

internal_filesystem/lib/mpos/apps.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,14 +71,17 @@ def execute_script_new_thread(scriptname, is_file, is_launcher, is_graphical):
7171
# 16KB allows for 10 threads in the apps, but seems too tight for urequests on unix (desktop) targets
7272
# 32KB seems better for the camera, but it forced me to lower other app threads from 16 to 12KB
7373
#_thread.stack_size(24576) # causes camera issue...
74-
74+
# NOTE: This doesn't do anything if apps are started in the same thread!
7575
if "camtest" in scriptname:
76-
print("Starting camera with extra stack size!")
76+
print("Starting camtest with extra stack size!")
7777
stack=32*1024
78+
elif "appstore"in scriptname:
79+
print("Starting appstore with extra stack size!")
80+
stack=24*1024
7881
else:
79-
stack=16*1024
82+
stack=16*1024 # 16KB doesn't seem to be enough for the AppStore app on desktop
83+
print(f"app.py: setting stack size for script to {stack}")
8084
_thread.stack_size(stack)
81-
print(f"app.py set stack size for script to {stack}")
8285
_thread.start_new_thread(execute_script, (scriptname, is_file, is_launcher, is_graphical))
8386
except Exception as e:
8487
print("main.py: execute_script_new_thread(): error starting new thread thread: ", e)

0 commit comments

Comments
 (0)