ws2812: add support for simulation

Call a special __tinygo_ws2812_write_byte function to send a single
byte.
This commit is contained in:
Ayke van Laethem
2019-12-14 16:59:18 +01:00
committed by Ron Evans
parent 514b436889
commit 7b56e61d52
2 changed files with 17 additions and 1 deletions
+16
View File
@@ -0,0 +1,16 @@
// +build !baremetal
package ws2812
// This file implements the WS2812 protocol for simulation.
import "machine"
// Send a single byte using the WS2812 protocol.
func (d Device) WriteByte(c byte) error {
writeByte(d.Pin, c)
return nil
}
//go:export __tinygo_ws2812_write_byte
func writeByte(pin machine.Pin, c byte)
+1 -1
View File
@@ -1,4 +1,4 @@
// +build circuitplay_express itsybitsy_m0 arduino_nano33 feather_m0 trinket_m0
// +build atsamd21
package ws2812