Skip to content

Suggesting an error message solution #47

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

Merged
merged 3 commits into from
Jan 15, 2023
Merged

Suggesting an error message solution #47

merged 3 commits into from
Jan 15, 2023

Conversation

tcfranks
Copy link
Contributor

resolves #29
submitted for review / comment.

My 2 cents. it appears the only way the prescale_reg value can go south (it's read when invoked, I think) would be for I2C to fail. According the the specsheet for PCA9685 chip, the register should be in the range of 0x03 <= value <= 0xFF. I've only suggested for the low end, but to be airtight do we want to go the full way? (spec sheet p 25 of 52)

@tcfranks
Copy link
Contributor Author

also, the frequency setter already checks against trying to prescale a value < 3, but does not check the prescale result of > 255.

@tannewt tannewt requested a review from tekktrik December 15, 2022 17:22
Copy link
Member

@tekktrik tekktrik left a comment

Choose a reason for hiding this comment

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

One minor change, but looks good!

@tcfranks
Copy link
Contributor Author

tcfranks commented Jan 6, 2023

@tekktrik in florida for 10 days with only a phone. Will tend to this when I get home!

@tcfranks
Copy link
Contributor Author

submitted for review of suggested mod

Copy link
Member

@tekktrik tekktrik left a comment

Choose a reason for hiding this comment

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

Thanks for the helpful update!

@tekktrik tekktrik merged commit 1057858 into adafruit:main Jan 15, 2023
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Jan 16, 2023
Updating https://github.com/adafruit/Adafruit_CircuitPython_FONA to 2.1.15 from 2.1.14:
  > Merge pull request adafruit/Adafruit_CircuitPython_FONA#25 from ric-sapasap/bugfix/issue-24
  > Add .venv to .gitignore

Updating https://github.com/adafruit/Adafruit_CircuitPython_PCA9685 to 3.4.7 from 3.4.6:
  > Merge pull request adafruit/Adafruit_CircuitPython_PCA9685#47 from tcfranks/main
  > Merge pull request adafruit/Adafruit_CircuitPython_PCA9685#46 from tekktrik/dev/update-pylint
  > Add .venv to .gitignore

Updating https://github.com/adafruit/Adafruit_CircuitPython_SGP40 to 1.3.11 from 1.3.10:
  > Merge pull request adafruit/Adafruit_CircuitPython_SGP40#17 from tcfranks/main
  > Add .venv to .gitignore

Updating https://github.com/adafruit/Adafruit_CircuitPython_PortalBase to 1.14.6 from 1.14.5:
  > Merge pull request adafruit/Adafruit_CircuitPython_PortalBase#88 from Neradoc/documentation-add-text-index
  > Add .venv to .gitignore

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.

Friendly error message to catch and avoid ZeroDivisionError
2 participants