mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-04 19:17:47 +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
|
||||
baudRate := SERCOM_FREQ_REF / (2 * config.Frequency)
|
||||
if baudRate > 0 {
|
||||
baudRate--
|
||||
}
|
||||
spi.Bus.BAUD.Set(uint8(baudRate))
|
||||
|
||||
// Enable SPI port.
|
||||
|
||||
Reference in New Issue
Block a user