-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
validate various displayio args; new pin validation routines; don't use mp_const_none if NULL will do #2666
validate various displayio args; new pin validation routines; don't use mp_const_none if NULL will do #2666
Conversation
….com/dhalbert/circuitpython into assert_pin-and-mp_const_none-cleanup
I didn't look at the code (add me as a reviewer or @ me when ready) but I think |
The old |
|
…_const_none-cleanup
This reverts commit b492ea6.
|
Now I am getting a "ERROR: THESE PACKAGES DO NOT MATCH THE HASHES FROM THE REQUIREMENTS FILE." errors on a few random builds, perhaps because of VM problems?? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One minor improvement. Good otherwise. Is the CI simply busted now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
FYI this breaks Trinket M0 and likely any other boards that use a DotStar as the status LED. The SPI constructor call needs to be updated to pass NULL instead of mp_const_none here: https://github.com/adafruit/circuitpython/blob/master/supervisor/shared/rgb_led_status.c#L128 |
I looked through all the |
There was some missing pin argument validation in
displayio
, and when starting to fix that, I decided to simplify how pin argument validation and free pin checking was done.assert_pin
completely, and subsume most uses ofassert_free_pin()
by adding the new routinesvalidate_is_free_pin()
andvalidate_is_free_pin_or_none()
, which check whether anmp_obj_t
is a pin and return anmcu_pin_obj_t *
if it is. This reduces several lines of code to one, improving readability and reducing boilerplate.*_obj_t
arguments passed tocommon_hal_...
(mostly pins) are passed asNULL
instead ofmp_const_none
. Also, use ofmp_const_none
in common-hal is minimized.The changes save about 260 bytes in the Trinket M0 build.