You've already forked MicroPythonOS
mirror of
https://github.com/m5stack/MicroPythonOS.git
synced 2026-05-20 11:51:27 -07:00
Desktop boot works
This commit is contained in:
@@ -1,12 +1,6 @@
|
||||
import task_handler
|
||||
import _thread
|
||||
import lvgl as lv
|
||||
|
||||
# Allow LVGL M:/path/to/file or M:relative/path/to/file to work for image set_src etc
|
||||
import mpos.fs_driver
|
||||
fs_drv = lv.fs_drv_t()
|
||||
mpos.fs_driver.fs_register(fs_drv, 'M')
|
||||
|
||||
import mpos.apps
|
||||
import mpos.config
|
||||
import mpos.ui
|
||||
@@ -14,6 +8,18 @@ import mpos.ui.topmenu
|
||||
from mpos.ui.display import init_rootscreen
|
||||
from mpos.content.package_manager import PackageManager
|
||||
|
||||
# Auto-detect and initialize hardware
|
||||
import sys
|
||||
if sys.platform == "linux" or sys.platform == "darwin": # linux and macOS
|
||||
import mpos.board.linux
|
||||
elif sys.platform == "esp32":
|
||||
print("TODO: detect which esp32 this is and then load the appropriate board")
|
||||
|
||||
# Allow LVGL M:/path/to/file or M:relative/path/to/file to work for image set_src etc
|
||||
import mpos.fs_driver
|
||||
fs_drv = lv.fs_drv_t()
|
||||
mpos.fs_driver.fs_register(fs_drv, 'M')
|
||||
|
||||
prefs = mpos.config.SharedPreferences("com.micropythonos.settings")
|
||||
|
||||
mpos.ui.set_theme(prefs)
|
||||
|
||||
@@ -63,7 +63,7 @@ pushd internal_filesystem/
|
||||
echo "Running app from $scriptdir"
|
||||
"$binary" -X heapsize=$HEAPSIZE -v -i -c "$(cat boot_unix.py main.py) ; import mpos.apps; mpos.apps.start_app('$scriptdir')"
|
||||
else
|
||||
"$binary" -X heapsize=$HEAPSIZE -v -i -c "$(cat boot_unix.py main.py)"
|
||||
"$binary" -X heapsize=$HEAPSIZE -v -i -c "import sys ; sys.path.append('lib/') ; import mpos.main"
|
||||
fi
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user