mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-04-24 03:29:57 -07:00
Option to preload extmainapps or not
This commit is contained in:
@@ -2,6 +2,7 @@ App(
|
||||
appid="gpio",
|
||||
name="GPIO",
|
||||
apptype=FlipperAppType.EXTMAINAPP,
|
||||
preload=True,
|
||||
entry_point="gpio_app",
|
||||
cdefines=["APP_GPIO"],
|
||||
requires=["gui"],
|
||||
|
||||
@@ -2,6 +2,7 @@ App(
|
||||
appid="ibutton",
|
||||
name="iButton",
|
||||
apptype=FlipperAppType.EXTMAINAPP,
|
||||
preload=True,
|
||||
targets=["f7"],
|
||||
entry_point="ibutton_app",
|
||||
cdefines=["APP_IBUTTON"],
|
||||
|
||||
@@ -151,7 +151,7 @@ static Loader* loader_alloc() {
|
||||
if(furi_hal_is_normal_boot()) {
|
||||
Storage* storage = furi_record_open(RECORD_STORAGE);
|
||||
for(size_t i = 0; i < FLIPPER_APPS_COUNT; i++) {
|
||||
if(FLIPPER_APPS[i].app != NULL) continue;
|
||||
if(FLIPPER_APPS[i].app != NULL || FLIPPER_APPS[i].stack_size != 1) continue;
|
||||
if(storage_common_exists(storage, FLIPPER_APPS[i].appid)) {
|
||||
void* preload = loader_preload(storage, FLIPPER_APPS[i].appid);
|
||||
FLIPPER_APPS[i].preload = preload;
|
||||
|
||||
@@ -42,6 +42,7 @@ class FlipperApplication:
|
||||
|
||||
appid: str
|
||||
apptype: FlipperAppType
|
||||
preload: Optional[bool] = False
|
||||
name: Optional[str] = ""
|
||||
entry_point: Optional[str] = None
|
||||
flags: List[str] = field(default_factory=lambda: ["Default"])
|
||||
@@ -373,7 +374,7 @@ class ApplicationsCGenerator:
|
||||
{{.app = NULL,
|
||||
.name = "{app.name}",
|
||||
.appid = "/ext/apps/.Main/{app.appid}.fap",
|
||||
.stack_size = 0,
|
||||
.stack_size = {1 if app.preload else 0},
|
||||
.icon = {f"&{app.icon}" if app.icon else "NULL"},
|
||||
.flags = {'|'.join(f"FlipperApplicationFlag{flag}" for flag in app.flags)}}}"""
|
||||
return f"""
|
||||
|
||||
Reference in New Issue
Block a user