diff --git a/sh1106/sh1106.go b/sh1106/sh1106.go index 74b31c994..493354f68 100644 --- a/sh1106/sh1106.go +++ b/sh1106/sh1106.go @@ -10,6 +10,7 @@ import ( "time" "tinygo.org/x/drivers" + "tinygo.org/x/drivers/internal/legacy" ) // Device wraps an SPI connection. @@ -283,9 +284,10 @@ func (d *Device) Tx(data []byte, isCommand bool) { // tx sends data to the display (I2CBus implementation) func (b *I2CBus) tx(data []byte, isCommand bool) { if isCommand { + legacy.WriteRegister(b.wire, uint8(b.Address), 0x00, data) b.wire.WriteRegister(uint8(b.Address), 0x00, data) } else { - b.wire.WriteRegister(uint8(b.Address), 0x40, data) + legacy.WriteRegister(b.wire, uint8(b.Address), 0x40, data) } } diff --git a/smoketest.sh b/smoketest.sh index 4527f83df..777401ef3 100755 --- a/smoketest.sh +++ b/smoketest.sh @@ -136,3 +136,4 @@ tinygo build -size short -o ./build/test.hex -target=pico ./examples/ndir/main_n tinygo build -size short -o ./build/test.hex -target=microbit ./examples/ndir/main_ndir.go tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/ndir/main_ndir.go tinygo build -size short -o ./build/test.uf2 -target=pico ./examples/mpu9150/main.go +tinygo build -size short -o ./build/test.hex -target=macropad-rp2040 ./examples/sh1106/macropad_spi