|
| 1 | +script="$1" |
| 2 | +if [-f"$script" ];then |
| 3 | +script=$(readlink -f"$script") |
| 4 | +fi |
| 5 | + |
| 6 | +echo"Usage:" |
| 7 | +echo"$0 # with no arguments just starts it up normally" |
| 8 | +echo"$0 scriptfile.py # doesn't initialize anything, just runs scriptfile.py directly" |
| 9 | +echo"$0 appname # starts the app by appname, for example: com.example.helloworld" |
| 10 | + |
| 11 | +#export SDL_WINDOW_FULLSCREEN=true |
| 12 | + |
| 13 | +#export HEAPSIZE=8M # 9MB is not enough for slides, 10MB is okay for 5, 16 for 10, 64 for 100s |
| 14 | +#export HEAPSIZE=9M # 9MB is not enough for slides, 10MB is okay for 5, 16 for 10, 64 for 100s |
| 15 | +#export HEAPSIZE=10M # 9MB is not enough for slides, 10MB is okay for 5, 16 for 10, 64 for 100s |
| 16 | +#export HEAPSIZE=11M # 9MB is not enough for slides, 10MB is okay for 5, 16 for 10, 64 for 100s |
| 17 | +#export HEAPSIZE=12M # 9MB is not enough for slides, 10MB is okay for 5, 16 for 10, 64 for 100s |
| 18 | +#export HEAPSIZE=13M # 9MB is not enough for slides, 10MB is okay for 5, 16 for 10, 64 for 100s |
| 19 | +#export HEAPSIZE=14M # 9MB is not enough for slides, 10MB is okay for 5, 16 for 10, 64 for 100s |
| 20 | +#export HEAPSIZE=15M # 9MB is not enough for slides, 10MB is okay for 5, 15 ok for all |
| 21 | + |
| 22 | +# 15 works infinite with 8 images |
| 23 | +# 12 seems to work fine with all images now, doing only gc.collect() |
| 24 | +# 10-11 works infinite with 7 images but as soon as I add the next one (big PNG slide 2) it hangs memory alloc |
| 25 | + |
| 26 | +# Makes semse because the error is: |
| 27 | +# MemoryError: memory allocation failed, allocating 2518043 bytes |
| 28 | +# So every new slide needs 2.5MB extra RAM! |
| 29 | + |
| 30 | +# Fixed by adding lv.image.cache_drop(None) # This helps a lot! |
| 31 | + |
| 32 | +# Now it works with 10M with infinite slides! |
| 33 | + |
| 34 | +# Now not anymore... let's try increasing it. |
| 35 | +#export HEAPSIZE=20M # this is fine for 1024x576 |
| 36 | +#export HEAPSIZE=15M # fine too |
| 37 | + |
| 38 | +export HEAPSIZE=32M# for 1280x720 images in the image viewer |
| 39 | +export HEAPSIZE=128M# for 1280x720 images in the image viewer |
| 40 | + |
| 41 | +pushd internal_filesystem/ |
| 42 | +if [-f"$script" ];then |
| 43 | +/home/user/projects/MicroPythonOS/lvgl_micropython/build/lvgl_micropy_unix -v -i"$script" |
| 44 | +elif [!-z"$script" ];then# it's an app name |
| 45 | +scriptdir="apps/$script" |
| 46 | +if [!-d"$scriptdir" ];then |
| 47 | +scriptdir="builtin/apps/$script" |
| 48 | +fi |
| 49 | +if [!-d"$scriptdir" ];then |
| 50 | +echo"ERROR: no app found by the name '$script'" |
| 51 | +exit 1 |
| 52 | +fi |
| 53 | +echo"Running app from$scriptdir" |
| 54 | +/home/user/projects/MicroPythonOS/lvgl_micropython/build/lvgl_micropy_unix -X heapsize=$HEAPSIZE -v -i -c"$(cat boot_unix.py main.py) ; import mpos.apps; mpos.apps.start_app('$scriptdir')" |
| 55 | +else |
| 56 | +/home/user/projects/MicroPythonOS/lvgl_micropython/build/lvgl_micropy_unix -X heapsize=$HEAPSIZE -v -i -c"$(cat boot_unix.py main.py)" |
| 57 | +fi |
| 58 | + |
| 59 | + |
| 60 | +popd |