mirror of
https://github.com/tinygo-org/drivers.git
synced 2026-08-24 16:39:02 +00:00
ws2812: support thingplus-rp2040 board
Added 125 MHz rp2040 timing Added unsafe.Pointer for pointer conversion
This commit is contained in:
@@ -252,7 +252,7 @@ func writeGoWrapper(f *os.File, arch string, megahertz int) error {
|
||||
fmt.Fprintf(buf, " portClear, maskClear := d.Pin.PortMaskClear()\n")
|
||||
fmt.Fprintf(buf, "\n")
|
||||
fmt.Fprintf(buf, " mask := interrupt.Disable()\n")
|
||||
fmt.Fprintf(buf, " C.ws2812_writeByte%d(C.char(c), portSet, portClear, maskSet, maskClear)\n", megahertz)
|
||||
fmt.Fprintf(buf, " C.ws2812_writeByte%d(C.char(c), (*uint32)(unsafe.Pointer(portSet)), (*uint32)(unsafe.Pointer(portClear)), maskSet, maskClear)\n", megahertz)
|
||||
buf.WriteString(`
|
||||
interrupt.Restore(mask)
|
||||
}
|
||||
@@ -293,6 +293,7 @@ package ws2812
|
||||
// gen-ws2812.go and run "go generate".
|
||||
|
||||
import "runtime/interrupt"
|
||||
import "unsafe"
|
||||
|
||||
/*
|
||||
#include <stdint.h>
|
||||
|
||||
Reference in New Issue
Block a user