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:
Ayke van Laethem
2021-05-30 01:21:10 +02:00
committed by Ron Evans
parent 5ecefde991
commit 5a02fe068b
2 changed files with 20 additions and 18 deletions
+1 -1
View File
@@ -13,7 +13,7 @@ import (
)
var (
apa apa102.Device
apa *apa102.Device
pwm = machine.TCC0
leds = make([]color.RGBA, 1)