Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: WS281X.h
- Revision:
- 32:64c391617f6c
- Parent:
- 30:59b70f91b471
- Child:
- 46:2374900f8845
--- a/WS281X.h Tue Sep 13 12:04:51 2016 +0000 +++ b/WS281X.h Thu Oct 13 23:51:20 2016 +0000 @@ -130,14 +130,14 @@ RGBColor operator[](int index) const { - if ((uint16_t)index < _numPixels) + if (_pixels && (uint16_t)index < _numPixels) return _pixels[index]; return _dummyPixel; } RGBColor& operator[](int index) { - if ((uint16_t)index < _numPixels) + if (_pixels && (uint16_t)index < _numPixels) return _pixels[index]; return _dummyPixel; } @@ -152,7 +152,7 @@ RGBOrder _rgbOrder; int _1st, _2nd, _3rd; - bool _buf_owner; + bool _owned_buffer; uint16_t _maxPixels; uint16_t _numPixels; RGBColor *_pixels;