Comments (3)
Thanks @microbit-carlos @martinwork.
I think you're right that it might be an off by one condition there. The memory write is guarded by the outer loop though: https://github.com/lancaster-university/codal-nrf52/blob/master/source/WS2812B.cpp#L91, which guarantees the write operations are always within the range of the associated ManagedBuffer.
As the code is safe, and we haven't had any report of any bugs around the code, I'd propose no change.
from codal-microbit-v2.
@finneyj to take a look.
from codal-microbit-v2.
Sorry, I should have thought in the first place to add some trace to confirm what happens. Reading the next byte after the data changes just the first post data padding value to a high or low. Maybe this doesn't actually matter to the WS2812B, given the amount of padding!
Here's an attempt to write (0,0,0) to a single pixel, with a 255 added after the 3 data bytes. The buffer values are masked with &= ~0x8000.
With >
length 3 samplesToSend 24
data 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 255
buffer 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
data
buffer 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
With >=
length 3 samplesToSend 24
data 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
buffer 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
data
buffer 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
from codal-microbit-v2.
Related Issues (20)
- Hot fix CODAL tag to fix issue driving display pins HOT 1
- Difference from V1 - Default pull mode of V2 P3,4,6,7,10 after display.disable() is None
- Revert changes in codal-microbit-nrf5sdk that modify SDK files directly HOT 3
- Add `setSampleRange()` to `StreamSplitter` to match `Mixer2::setSampleRange()` HOT 9
- The sample rate for microphone input via `StreamSplitter` must be an integer multiple of existing sample rate HOT 2
- Suggest adding `StreamSplitter::pullInto()` to reduce memory allocation when recording samples HOT 8
- `wasPressed()` for the `TouchButton` class HOT 4
- Waking up turns on the microphone even if it is never used HOT 2
- Should fibers wait for access to serial?
- Set audio pin creates a 44.2kHz 50% PWM after audio playback HOT 2
- MicroBitButton.h missing in MicroBit.h when DEVICE_BLE=0 HOT 6
- Snapshot v0.2.63 points to a codal-microbit-nrf5sdk commit that is not in the repo HOT 1
- In a tight loop, mostly deep sleeping, takes 600 milliseconds to go back to sleep HOT 1
- Data log "full" marker is not being written to interface storage HOT 2
- MakeCode `randint()` not random when Bluetooth enabled
- Default `uBit.io.logo` touch type should be capacitive. HOT 3
- A way to configure a pin on open drain mode HOT 1
- Overloaded virtual warnings
- Quickly switching between resistive and capacitive pin touch and checking state doesn't work
- `NRF52Pin::wasTouched()` default mode is capacitative instead of the pin state HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from codal-microbit-v2.