Skip to content

Commit 06bcd7c

Browse files
committed
fix SPI3w baud
1 parent 324c502 commit 06bcd7c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

rp2-pio/piolib/spi3w.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ type SPI3w struct {
2525
}
2626

2727
func NewSPI3w(sm pio.StateMachine, dio, clk machine.Pin, baud uint32) (*SPI3w, error) {
28+
baud *= 2 // We have 2 instructions per bit in the hot loop.
2829
whole, frac, err := pio.ClkDivFromFrequency(baud, machine.CPUFrequency())
2930
if err != nil {
3031
return nil, err // Early return on bad clock.

0 commit comments

Comments
 (0)