Skip to content

Commit

Permalink
compile: Use multi mpy format.
Browse files Browse the repository at this point in the history
  • Loading branch information
laurensvalk committed Mar 4, 2024
1 parent fc75ab3 commit 56b34f1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pybricksdev/cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,10 @@ def add_parser(self, subparsers: argparse._SubParsersAction):
parser.tool = self

async def run(self, args: argparse.Namespace):
from ..compile import compile_file, print_mpy
from ..compile import compile_multi_file, print_mpy

with _get_script_path(args.file) as script_path:
mpy = await compile_file(script_path, args.abi)
mpy = await compile_multi_file(script_path, args.abi)
print_mpy(mpy)


Expand Down
2 changes: 1 addition & 1 deletion pybricksdev/compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ def print_mpy(data):
# ports without usable I/O, REPL or otherwise.
WIDTH = 8
print()
print(f"// MPY file. Version: {data[1]}. Size: {len(data)} bytes")
print(f"// MPY file. Size: {len(data)} bytes")
print("const uint8_t script[] = {")

for c in chunk(data, WIDTH):
Expand Down

0 comments on commit 56b34f1

Please sign in to comment.