mirror of
https://github.com/tinygo-org/drivers.git
synced 2026-08-08 17:03:39 +00:00
apa102: use 4-byte buffer to improve speed
Instead of sending the APA102 data byte by byte, it's more efficient to send multiple bytes at once (especially when the SPI peripheral uses DMA). This requires the apa102.Device object to be a pointer receiver to avoid excessive heap allocations. This commit also just happens to work around a hardware bug on the nrf52832: https://infocenter.nordicsemi.com/index.jsp?topic=%2Ferrata_nRF52832_Rev2%2FERR%2FnRF52832%2FRev2%2Flatest%2Fanomaly_832_58.html&anchor=anomaly_832_58
This commit is contained in:
committed by
Ron Evans
parent
5ecefde991
commit
5a02fe068b
@@ -13,7 +13,7 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
apa apa102.Device
|
||||
apa *apa102.Device
|
||||
|
||||
pwm = machine.TCC0
|
||||
leds = make([]color.RGBA, 1)
|
||||
|
||||
Reference in New Issue
Block a user