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

Better diagnose the incorrect lines like "side 1" or "[5]" #65

Merged
merged 1 commit into from
Jul 11, 2024

Conversation

jepler
Copy link
Member

@jepler jepler commented Jul 10, 2024

Before this, the exception would be 'IndexError: list index out of range'. Now it is 'Unknown instruction: side' or similar.

Based on a report on discord from @AcThPaU that I have interpreted as actually being due to poor reporting of this error condition:

the pioasm sideset instruction check pops the instruction empty, causes the next nop check to out of index

side-set and delay need an instruction, even if it's nop. E.g., nop side 1 instead of side 1. Such as this example from pico-examples:

    out pins, 1   side 0   ; Stall here when no data (still asserts clock low)
    nop           side 1

Please feel free to expand on what you meant @AcThPaU if this doesn't address your concern.

Before this, the exception would be 'IndexError: list index out of range'.
Now it is 'Unknown instruction: side' or similar.

(These need an instruction, even if it's a `nop`: `nop side 1 [5]`)
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!

@jepler jepler merged commit 357f933 into main Jul 11, 2024
2 checks passed
@jepler jepler deleted the better-error-sideset-delay branch July 11, 2024 22:19
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Jul 16, 2024
Updating https://github.com/adafruit/Adafruit_CircuitPython_ENS160 to 1.0.7 from 1.0.6:
  > Merge pull request adafruit/Adafruit_CircuitPython_ENS160#5 from bablokb/no-reset

Updating https://github.com/adafruit/Adafruit_CircuitPython_ICM20X to 2.0.21 from 2.0.20:
  > Merge pull request adafruit/Adafruit_CircuitPython_ICM20X#24 from 42xnor/remove-accelrometer-sleep-calls

Updating https://github.com/adafruit/Adafruit_CircuitPython_PIOASM to 1.0.3 from 1.0.2:
  > Merge pull request adafruit/Adafruit_CircuitPython_PIOASM#65 from adafruit/better-error-sideset-delay

Updating https://github.com/adafruit/Adafruit_CircuitPython_Bundle/circuitpython_library_list.md to NA from NA:
  > Added the following libraries: Adafruit_CircuitPython_HDC302x

Updating https://github.com/adafruit/Adafruit_CircuitPython_Bundle/circuitpython_library_list.md to NA from NA:
  > Updated download stats for the libraries
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.

2 participants