mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-18 19:44:00 +00:00
atsamd5x: fix BAUD value
This commit is contained in:
@@ -1417,6 +1417,9 @@ func (spi SPI) Configure(config SPIConfig) error {
|
|||||||
|
|
||||||
// Set synch speed for SPI
|
// Set synch speed for SPI
|
||||||
baudRate := SERCOM_FREQ_REF / (2 * config.Frequency)
|
baudRate := SERCOM_FREQ_REF / (2 * config.Frequency)
|
||||||
|
if baudRate > 0 {
|
||||||
|
baudRate--
|
||||||
|
}
|
||||||
spi.Bus.BAUD.Set(uint8(baudRate))
|
spi.Bus.BAUD.Set(uint8(baudRate))
|
||||||
|
|
||||||
// Enable SPI port.
|
// Enable SPI port.
|
||||||
|
|||||||
Reference in New Issue
Block a user