Browse Source

atsamd2x: fix BAUD value

pull/1389/head
sago35 4 years ago
committed by Ron Evans
parent
commit
9245337ecf
  1. 5
      src/machine/machine_atsamd21.go

5
src/machine/machine_atsamd21.go

@ -1188,7 +1188,10 @@ func (spi SPI) Configure(config SPIConfig) error {
}
// Set synch speed for SPI
baudRate := (CPUFrequency() / (2 * config.Frequency)) - 1
baudRate := CPUFrequency() / (2 * config.Frequency)
if baudRate > 0 {
baudRate--
}
spi.Bus.BAUD.Set(uint8(baudRate))
// Enable SPI port.

Loading…
Cancel
Save