Skip to content

Commit 8170f59

Browse files
sago35deadprogram
authored andcommitted
atsamd5x: fix BAUD value
1 parent 622de53 commit 8170f59

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/machine/machine_atsamd51.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1417,6 +1417,9 @@ func (spi SPI) Configure(config SPIConfig) error {
14171417

14181418
// Set synch speed for SPI
14191419
baudRate := SERCOM_FREQ_REF / (2 * config.Frequency)
1420+
if baudRate > 0 {
1421+
baudRate--
1422+
}
14201423
spi.Bus.BAUD.Set(uint8(baudRate))
14211424

14221425
// Enable SPI port.

0 commit comments

Comments
 (0)