Skip to content

Conversation

@rhooper
Copy link
Contributor

@rhooper rhooper commented Jan 18, 2020

This change should in theory make .buf behave the same as it did before, by making it the before-adjustment buffer by having NeoPixel hold onto the two buffers and adding a .buf property.

@caternuson HTH

@ladyada ladyada self-requested a review January 18, 2020 23:30
pixel_order = ''.join(order)

super().__init__(n, bytearray(self.n * bpp),
self._buf = bytearray(self.n * bpp)
Copy link
Member

Choose a reason for hiding this comment

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

ideally we would not allocate two buffers if they are not needed - the original code only alloc'd a new buffer when brightness was < 1

@rhooper rhooper closed this Jan 19, 2020
@rhooper rhooper reopened this Jan 19, 2020
"""
return self._rawbuf

@buf.setter
Copy link
Member

Choose a reason for hiding this comment

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

Please don't support setting. NeoPixel_SPI and users shouldn't be doing this.

@tannewt
Copy link
Member

tannewt commented Jan 22, 2020

As of adafruit/Adafruit_CircuitPython_NeoPixel_SPI#10 NeoPixel SPI uses PixelBuf directly so this is no longer needed. Thanks anyway!

@tannewt tannewt closed this Jan 22, 2020
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.

3 participants