Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Program class, type information #29

Merged
merged 4 commits into from
Jan 12, 2022
Merged

Conversation

jepler
Copy link
Member

@jepler jepler commented Dec 26, 2021

An instance of the Program class has the assembled property as well as the pio_kwargs property. This allows passing information from the assembler to the StateMachine constructor, in a way that can be extended in future versions (e.g., for .wrap / .wrap_target)

This re-indents a lot of code so it may be better viewed with whitespace changes hidden.

Tests are added for the limits of the side-set and delay values. An off-by-one bug with the sideset_value limit was fixed.

Closes: #28

An instance of the `Program` class has the `.assembled` property
as well as the `pio_kwargs` property. This allows passing information
from the assembler to the StateMachine constructor, in a way that can
be extended in future versions (e.g., for .wrap / .wrap_target)

This re-indents a lot of code so it may be better viewed with whitespace
changes hidden.

Tests are added for the limits of the side-set and delay values. An
off-by-one bug with the sideset_value limit was fixed.
@jepler jepler requested a review from tannewt December 26, 2021 16:48
@jepler
Copy link
Member Author

jepler commented Dec 26, 2021

@tannewt should the assembled property be in the pio_kwargs instead?

@tannewt
Copy link
Member

tannewt commented Dec 28, 2021

I don't think so. It's called program and is a positional argument in StateMachine.

Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

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

Please add an example that uses the Program class. That way we can show folks how to use it.

Otherwise, this looks like a good change! It'll be nice to get kwargs out of it.

@jepler jepler requested a review from tannewt January 12, 2022 14:43
@jepler
Copy link
Member Author

jepler commented Jan 12, 2022

Merged with the latest & converted the txuart example to use Program and **pio_kwargs (not actually tested on HW)

Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

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

Thank you!

@tannewt tannewt merged commit 00e6216 into adafruit:main Jan 12, 2022
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Jan 19, 2022
Updating https://github.com/adafruit/Adafruit_CircuitPython_DRV2605 to 1.2.1 from 1.2.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_DRV2605#30 from tekktrik/doc/fix-code-block

Updating https://github.com/adafruit/Adafruit_CircuitPython_ESP32SPI to 3.6.0 from 3.5.14:
  > Merge pull request adafruit/Adafruit_CircuitPython_ESP32SPI#150 from tekktrik/feature/configurable-eol
  > Merge pull request adafruit/Adafruit_CircuitPython_ESP32SPI#151 from tekktrik/feature/add-recvinto
  > Merge pull request adafruit/Adafruit_CircuitPython_ESP32SPI#152 from tekktrik/hotfix/fix-docs
  > Merge pull request adafruit/Adafruit_CircuitPython_ESP32SPI#149 from tekktrik/doc/add-missing-to-api

Updating https://github.com/adafruit/Adafruit_CircuitPython_FRAM to 1.3.13 from 1.3.12:
  > Merge pull request adafruit/Adafruit_CircuitPython_FRAM#33 from tekktrik/doc/update-documentation

Updating https://github.com/adafruit/Adafruit_CircuitPython_HT16K33 to 4.2.0 from 4.1.9:
  > Merge pull request adafruit/Adafruit_CircuitPython_HT16K33#88 from jposada202020/including_animation_class

Updating https://github.com/adafruit/Adafruit_CircuitPython_PyPortal to 6.2.0 from 6.1.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_PyPortal#120 from FoamyGuy/force_content_type

Updating https://github.com/adafruit/Adafruit_CircuitPython_CursorControl to 2.5.2 from 2.5.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_CursorControl#32 from FoamyGuy/alt_click

Updating https://github.com/adafruit/Adafruit_CircuitPython_FunHouse to 2.1.10 from 2.1.8:
  > Merge pull request adafruit/Adafruit_CircuitPython_FunHouse#33 from makermelissa/main
  > Merge pull request adafruit/Adafruit_CircuitPython_FunHouse#31 from makermelissa/main

Updating https://github.com/adafruit/Adafruit_CircuitPython_MiniMQTT to 5.2.0 from 5.1.6:
  > Merge pull request adafruit/Adafruit_CircuitPython_MiniMQTT#97 from goliothlabs/feat/add-binary-support

Updating https://github.com/adafruit/Adafruit_CircuitPython_PIOASM to 0.6.0 from 0.5.4:
  > Merge pull request adafruit/Adafruit_CircuitPython_PIOASM#29 from jepler/program-object
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.

Store other program metadata in a Program class
2 participants