mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2025-09-29 04:52:38 +02:00
Last for today | FAP updates
This commit is contained in:
14
.vscode/example/tasks.json
vendored
14
.vscode/example/tasks.json
vendored
@@ -138,6 +138,18 @@
|
|||||||
"Serial Console"
|
"Serial Console"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"label": "[Debug] Build and upload all FAPs to Flipper over USB",
|
||||||
|
"group": "build",
|
||||||
|
"type": "shell",
|
||||||
|
"command": "./fbt faps_copy"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "[Release] Build and upload all FAPs to Flipper over USB",
|
||||||
|
"group": "build",
|
||||||
|
"type": "shell",
|
||||||
|
"command": "./fbt COMPACT=1 DEBUG=0 faps_copy"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
// Press Ctrl+] to quit
|
// Press Ctrl+] to quit
|
||||||
"label": "Serial Console",
|
"label": "Serial Console",
|
||||||
@@ -162,4 +174,4 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
@@ -14,7 +14,7 @@ DEBUG = 0
|
|||||||
|
|
||||||
# Suffix to add to files when building distribution
|
# Suffix to add to files when building distribution
|
||||||
# If OS environment has DIST_SUFFIX set, it will be used instead
|
# If OS environment has DIST_SUFFIX set, it will be used instead
|
||||||
DIST_SUFFIX = "CC_CL-0015_12192022"
|
DIST_SUFFIX = "CC_CL-0016_12192022"
|
||||||
|
|
||||||
# Coprocessor firmware
|
# Coprocessor firmware
|
||||||
COPRO_OB_DATA = "scripts/ob.data"
|
COPRO_OB_DATA = "scripts/ob.data"
|
||||||
|
@@ -11,6 +11,8 @@ Building:
|
|||||||
Build all FAP apps
|
Build all FAP apps
|
||||||
fap_{APPID}, launch_app APPSRC={APPID}:
|
fap_{APPID}, launch_app APPSRC={APPID}:
|
||||||
Build FAP app with appid={APPID}; upload & start it over USB
|
Build FAP app with appid={APPID}; upload & start it over USB
|
||||||
|
faps_copy:
|
||||||
|
Build and upload all FAP apps over USB
|
||||||
|
|
||||||
Flashing & debugging:
|
Flashing & debugging:
|
||||||
flash, flash_blackmagic, jflash:
|
flash, flash_blackmagic, jflash:
|
||||||
|
@@ -15,6 +15,13 @@ import serial.tools.list_ports as list_ports
|
|||||||
class Main(App):
|
class Main(App):
|
||||||
def init(self):
|
def init(self):
|
||||||
self.parser.add_argument("-p", "--port", help="CDC Port", default="auto")
|
self.parser.add_argument("-p", "--port", help="CDC Port", default="auto")
|
||||||
|
self.parser.add_argument(
|
||||||
|
"-l",
|
||||||
|
"--launch",
|
||||||
|
dest="launch_app",
|
||||||
|
action="store_true",
|
||||||
|
help="Launch app",
|
||||||
|
)
|
||||||
|
|
||||||
self.parser.add_argument("fap_src_path", help="App file to upload")
|
self.parser.add_argument("fap_src_path", help="App file to upload")
|
||||||
self.parser.add_argument(
|
self.parser.add_argument(
|
||||||
@@ -84,11 +91,16 @@ class Main(App):
|
|||||||
self.logger.error(f"Error: upload failed: {storage.last_error}")
|
self.logger.error(f"Error: upload failed: {storage.last_error}")
|
||||||
return -3
|
return -3
|
||||||
|
|
||||||
storage.send_and_wait_eol(f'loader open "Applications" {fap_dst_path}\r')
|
if self.args.launch_app:
|
||||||
result = storage.read.until(storage.CLI_EOL)
|
storage.send_and_wait_eol(
|
||||||
if len(result):
|
f'loader open "Applications" {fap_dst_path}\r'
|
||||||
self.logger.error(f"Unexpected response: {result.decode('ascii')}")
|
)
|
||||||
return -4
|
result = storage.read.until(storage.CLI_EOL)
|
||||||
|
if len(result):
|
||||||
|
self.logger.error(
|
||||||
|
f"Unexpected response: {result.decode('ascii')}"
|
||||||
|
)
|
||||||
|
return -4
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
finally:
|
finally:
|
||||||
@@ -96,4 +108,4 @@ class Main(App):
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
Main()()
|
Main()()
|
@@ -1,3 +1,4 @@
|
|||||||
|
import os
|
||||||
from dataclasses import dataclass, field
|
from dataclasses import dataclass, field
|
||||||
from SCons.Node import NodeList
|
from SCons.Node import NodeList
|
||||||
from SCons.Warnings import warn, WarningOnByDefault
|
from SCons.Warnings import warn, WarningOnByDefault
|
||||||
@@ -109,12 +110,25 @@ if appsrc := appenv.subst("$APPSRC"):
|
|||||||
app_artifacts = appenv.GetExtAppFromPath(appsrc)
|
app_artifacts = appenv.GetExtAppFromPath(appsrc)
|
||||||
appenv.PhonyTarget(
|
appenv.PhonyTarget(
|
||||||
"launch_app",
|
"launch_app",
|
||||||
'${PYTHON3} "${APP_RUN_SCRIPT}" "${SOURCE}" --fap_dst_dir "/ext/apps/${FAP_CATEGORY}"',
|
'${PYTHON3} "${APP_RUN_SCRIPT}" --launch "${SOURCE}" --fap_dst_dir "/ext/apps/${FAP_CATEGORY}"',
|
||||||
source=app_artifacts.compact,
|
source=app_artifacts.compact,
|
||||||
FAP_CATEGORY=app_artifacts.app.fap_category,
|
FAP_CATEGORY=app_artifacts.app.fap_category,
|
||||||
)
|
)
|
||||||
appenv.Alias("launch_app", app_artifacts.validator)
|
appenv.Alias("launch_app", app_artifacts.validator)
|
||||||
|
|
||||||
|
appenv.PhonyTarget(
|
||||||
|
"faps_copy",
|
||||||
|
os.linesep.join(
|
||||||
|
[
|
||||||
|
'${PYTHON3} "${APP_RUN_SCRIPT}"'
|
||||||
|
f' "{app_artifact.compact[0].rstr()}"'
|
||||||
|
f' --fap_dst_dir "/ext/apps/{app_artifact.app.fap_category}"'
|
||||||
|
for app_artifact in appenv["EXT_APPS"].values()
|
||||||
|
]
|
||||||
|
),
|
||||||
|
source=["faps"],
|
||||||
|
)
|
||||||
|
|
||||||
# SDK management
|
# SDK management
|
||||||
|
|
||||||
sdk_origin_path = "${BUILD_DIR}/sdk_origin"
|
sdk_origin_path = "${BUILD_DIR}/sdk_origin"
|
||||||
@@ -148,4 +162,4 @@ if appenv["FORCE"]:
|
|||||||
appenv.AlwaysBuild(sdk_source, sdk_tree, sdk_apicheck, sdk_apisyms)
|
appenv.AlwaysBuild(sdk_source, sdk_tree, sdk_apicheck, sdk_apisyms)
|
||||||
|
|
||||||
|
|
||||||
Return("extapps")
|
Return("extapps")
|
Reference in New Issue
Block a user