diff --git a/kapps/kapp.mpy b/kapps/kapp.mpy new file mode 100644 index 00000000..435993e2 Binary files /dev/null and b/kapps/kapp.mpy differ diff --git a/kapps/kapp.mpy.sig b/kapps/kapp.mpy.sig new file mode 100644 index 00000000..967044e8 Binary files /dev/null and b/kapps/kapp.mpy.sig differ diff --git a/kapps/kapp.py b/kapps/kapp.py new file mode 100644 index 00000000..cfbd7a23 --- /dev/null +++ b/kapps/kapp.py @@ -0,0 +1,32 @@ +# The MIT License (MIT) + +# Copyright (c) 2021-2024 Krux contributors + +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +import os + +# avoids importing from flash VSF +os.chdir("/") + +print("Print executed inside kapp.py") + + +def run(): + """Runs this kapp""" + print("run() func executed on kapp.py") diff --git a/pyproject.toml b/pyproject.toml index 304a94c9..42d5c9f0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -71,7 +71,7 @@ flash = ["pyserial"] # format tasks format-src = "black src" format-tests = "black tests" -format-scripts = "black firmware/font firmware/scripts i18n/*.py" +format-scripts = "black firmware/font firmware/scripts i18n/*.py kapps/*.py" format = ["format-src", "format-tests", "format-scripts"] # aliases black.ref = "format" @@ -79,7 +79,7 @@ format-test.ref = "format-tests" # pylint tasks lint-src = "pylint src" -lint-scripts = "pylint firmware/font/*.py firmware/scripts/*.py i18n/*.py" +lint-scripts = "pylint firmware/font/*.py firmware/scripts/*.py i18n/*.py kapps/*.py" lint = ["lint-src", "lint-scripts"] # aliases pylint.ref = "lint" @@ -130,6 +130,10 @@ flash-cmd = "python firmware/Kboot/build/ktool.py -b 1500000 build/kboot.kfpkg" flash.ref = "flash-cmd -B goE" flash-dock.ref = "flash-cmd -B dan" +# kapps tasks +mpy = "./firmware/MaixPy/components/micropython/core/mpy-cross/mpy-cross" +mpy-cross.ref = "mpy" + # task for bdftokff? # python bdftokff.py True diff --git a/simulator/kapp.py b/simulator/kapp.py index 223ae693..cfbd7a23 100644 --- a/simulator/kapp.py +++ b/simulator/kapp.py @@ -1,3 +1,32 @@ -print("Print inside kapp.py") +# The MIT License (MIT) + +# Copyright (c) 2021-2024 Krux contributors + +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: + +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. + +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +import os + +# avoids importing from flash VSF +os.chdir("/") + +print("Print executed inside kapp.py") + + def run(): - print("run func kapp.py") + """Runs this kapp""" + print("run() func executed on kapp.py")