Skip to content

Convert to Python3. Use PEP8 naming conventions and formatting.#2

Closed
ntoll wants to merge 1 commit into
microsoft:masterfrom
ntoll:master
Closed

Convert to Python3. Use PEP8 naming conventions and formatting.#2
ntoll wants to merge 1 commit into
microsoft:masterfrom
ntoll:master

Conversation

@ntoll
Copy link
Copy Markdown
Contributor

@ntoll ntoll commented May 11, 2017

I've been playing with CircuitPython and the Circuit Playground Express. Wanting to flash the device with a new build I ran across this script.

As a courtesy I've converted it from Python 2 (soon to be unsupported) to Python 3 (they tell me it's the future). I've also renamed a few things and changed formatting to conform roughly with the PEP8 Python style guide (https://www.python.org/dev/peps/pep-0008/).

There are no tests! However, I can only confirm the script converts a CircuitPython .bin file to .uf2 and that the device flashed with the resulting firmware.uf2 file works:

$ ./uf2conv.py ~/src/circuitpython/atmel-samd/build-circuitplayground_express/firmware.bin -o firmware.uf2

I've made a cursory check with my eyeball Mk.1 but YMMV with the other functionality. Please check.

Thanks for the tool, the usefulness of uf2 and I hope this is helpful. :-)

Comment thread utils/uf2conv.py

def boardID(path):

def board_id(path):
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the calls to the function didn't get renamed. (line 120 & line 179)

@mmoskal
Copy link
Copy Markdown
Contributor

mmoskal commented May 15, 2018

I think you might have patched an old version, without .hex file support.

@mmoskal
Copy link
Copy Markdown
Contributor

mmoskal commented May 17, 2023

python3 conversion was done later

@mmoskal mmoskal closed this May 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants