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

CircuitPython throws a syntax error on line 428 of rf24.py #40

Closed
jerryneedell opened this issue Jun 14, 2022 · 7 comments · Fixed by #41
Closed

CircuitPython throws a syntax error on line 428 of rf24.py #40

jerryneedell opened this issue Jun 14, 2022 · 7 comments · Fixed by #41

Comments

@jerryneedell
Copy link

jerryneedell commented Jun 14, 2022

I tried executing the nrf24l01_simple_test.py on a feather m4 express running both CircuitpYhton 7.3.0 and 8.0 alpha.1
and I get a syntax error on line 428 of rf24.py

https://github.com/nRF24/CircuitPython_nRF24L01/blob/master/circuitpython_nrf24l01/rf24.py#L428

simply adding a comma to line 427 fixes the problem
changing

print(
            f"Auto retry delay__________"
            f"{((self._retry_setup & 0xF0) >> 4) * 250 + 250} microseconds",
        )

to

print(
            f"Auto retry delay__________",
            f"{((self._retry_setup & 0xF0) >> 4) * 250 + 250} microseconds",
        )

resolves the issue on the feather m4 express.

The library runs OK as is on a Raspberry Pi.

@jerryneedell
Copy link
Author

Using a + instead of a comma may be preferred -- the comma adds a space between the strings, the + concatenates.

@2bndy5
Copy link
Member

2bndy5 commented Jun 14, 2022

A + is preferable. I've been developing the next release on the no-more-upy branch, and I think this is already solved there (had some problems in cirPy v7.x about using f-strs).

@2bndy5
Copy link
Member

2bndy5 commented Jun 14, 2022

Looks like I already reverted back to using

print(
"Auto retry delay__________{} microseconds".format(
((self._retry_setup & 0xF0) >> 4) * 250 + 250
)

on my bleeding edge branch.

@2bndy5 2bndy5 mentioned this issue Jun 14, 2022
@jerryneedell
Copy link
Author

Thanks for the quick response.

@2bndy5
Copy link
Member

2bndy5 commented Jun 15, 2022

Your feedback is always welcome. I'm just slow to release (for HW testing reasons).

@jerryneedell
Copy link
Author

FYI -- I updated to the new release and ran the simple_ test between a Pi (3B+) and a Feather M4 Express running CP 8.0 alpha.1 -- worked fine! Thanks

@2bndy5
Copy link
Member

2bndy5 commented Jun 16, 2022

I just finished testing all the examples on my Feather RP2040 (w/ CirPy v7.3.0) and my RPi4. Thus, the release.

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 a pull request may close this issue.

2 participants