mirror of
https://github.com/micropython/micropython.git
synced 2026-01-05 11:40:18 +01:00
tools/autobuild,esp32: Template the generation of esp32 port deploy.md.
Allows two source files (ports/esp32/boards/deploy.md and deploy_nativeusb.md for boards with only native USB) for all esp32 installation steps, with templated chip name and flash offset inserted via string formatting. The new files add more text to explain the esptool.py port auto-detection, remove the unnecessary -z feature (already enabled by default), and add a bit of troubleshooting and port detection info. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
This commit is contained in:
committed by
Damien George
parent
b6649b922e
commit
d89e71e6c0
@@ -91,7 +91,18 @@ def main(repo_path, output_path):
|
||||
f.write("\n\n## Installation instructions\n")
|
||||
for deploy in blob["deploy"]:
|
||||
with open(os.path.join(board_dir, deploy), "r") as fin:
|
||||
f.write(fin.read())
|
||||
body = fin.read()
|
||||
# any key in the board.json file can be substituted via Python str.format()
|
||||
try:
|
||||
body = body.format(**blob)
|
||||
except Exception as e:
|
||||
raise RuntimeError(
|
||||
"Failed to format deploy file {} according to {}: {}".format(
|
||||
fin.name, board_json, e
|
||||
)
|
||||
)
|
||||
f.write(body)
|
||||
f.write("\n")
|
||||
|
||||
# Write the full index for the website to load.
|
||||
with open(os.path.join(output_path, "index.json"), "w") as f:
|
||||
|
||||
Reference in New Issue
Block a user