Skip to content

Commit

Permalink
change(espefuse_dump): Rename united and separated formats to joint a…
Browse files Browse the repository at this point in the history
…nd split
  • Loading branch information
radimkarnis committed Aug 5, 2024
1 parent 8ee6ea1 commit 14e5d93
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
8 changes: 4 additions & 4 deletions docs/en/espefuse/dump-cmd.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ Optional arguments:

- ``--format`` - Selects the dump format:
- ``default`` - Usual console eFuse dump;
- ``united`` - All eFuse blocks are stored in one file;
- ``separated`` - Each eFuse block is placed in a separate file. The tool will create multiple files based on the given the ``--file_name`` argument. Example: "--file_name /path/blk.bin", blk0.bin, blk1.bin ... blkN.bin. Use the ``burn_block_data`` cmd to write it back to another chip.
- ``joint`` - All eFuse blocks are stored in one file;
- ``split`` - Each eFuse block is placed in its own file. The tool will create multiple files based on the given the ``--file_name`` argument. Example: "--file_name /path/blk.bin", blk0.bin, blk1.bin ... blkN.bin. Use the ``burn_block_data`` cmd to write it back to another chip.
- ``--file_name`` - The path to the file in which to save the dump, if not specified, output to the console.

Raw Values Of Efuse Registers
Expand Down Expand Up @@ -93,7 +93,7 @@ This command saves dump for each block into a separate file. You need to provide

.. code-block:: none
> espefuse.py dump --format separated --file_name backup/chip1/blk.bin
> espefuse.py dump --format split --file_name backup/chip1/blk.bin
=== Run "dump" command ===
backup/chip1/blk0.bin
Expand All @@ -120,7 +120,7 @@ To save all eFuse blocks in one file, use the following command:

.. code-block:: none
> espefuse.py dump --format united --file_name backup/chip1/efuses.bin
> espefuse.py dump --format joint --file_name backup/chip1/efuses.bin
=== Run "dump" command ===
backup/chip1/efuses.bin
14 changes: 7 additions & 7 deletions espefuse/efuse/base_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,11 @@ def check_efuse_name(efuse_name, efuse_list):
"--format",
help="Select the dump format: "
"default - usual console eFuse dump; "
"united - all eFuse blocks are stored in one file; "
"separated - each eFuse block is placed in a separate file. Tool will create multiple files based on "
"joint - all eFuse blocks are stored in one file; "
"split - each eFuse block is placed into its own file. The tool will create multiple files based on "
"the given --file_name (/path/blk.bin): blk0.bin, blk1.bin ... blkN.bin. Use the burn_block_data cmd "
"to write it back to another chip.",
choices=["default", "separated", "united"],
choices=["default", "split", "joint"],
default="default",
)
dump_cmd.add_argument(
Expand Down Expand Up @@ -409,10 +409,10 @@ def output_block_to_file(block, f, to_console):
return
else:
# for back compatibility to support "espefuse.py dump --file_name dump.bin"
args.format = "separated"
args.format = "split"

if args.format == "separated":
# each efuse block is placed in a separate file
if args.format == "split":
# each efuse block is placed into its own file
for block in efuses.blocks:
if not to_console:
file_dump_name = args.file_name
Expand All @@ -423,7 +423,7 @@ def output_block_to_file(block, f, to_console):
output_block_to_file(block, dump_file, to_console)
if not to_console:
dump_file.close()
elif args.format == "united":
elif args.format == "joint":
# all efuse blocks are stored in one file
if not to_console:
print(f"Dump efuse blocks -> {args.file_name}")
Expand Down
10 changes: 5 additions & 5 deletions test/test_espefuse.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,17 +183,17 @@ def test_dump(self):
self.espefuse_py("dump -h")
self.espefuse_py("dump")

def test_dump_format_united(self):
def test_dump_format_joint(self):
tmp_file = tempfile.NamedTemporaryFile(delete=False)
self.espefuse_py(f"dump --format united --file_name {tmp_file.name}")
self.espefuse_py(f"dump --format joint --file_name {tmp_file.name}")

def test_dump_separated_default(self):
def test_dump_split_default(self):
tmp_file = tempfile.NamedTemporaryFile(delete=False)
self.espefuse_py(f"dump --file_name {tmp_file.name}")

def test_dump_separated(self):
def test_dump_split(self):
tmp_file = tempfile.NamedTemporaryFile(delete=False)
self.espefuse_py(f"dump --format separated --file_name {tmp_file.name}")
self.espefuse_py(f"dump --format split --file_name {tmp_file.name}")

def test_summary(self):
self.espefuse_py("summary -h")
Expand Down

0 comments on commit 14e5d93

Please sign in to comment.