Bug fix in SPI APIs o avoid sending dummy character for first transfer by slave

pull/1243/head
vimalrajr 2015-07-09 14:30:24 +05:30 committed by Karthik Purushothaman
parent 37c52f0d9c
commit c0da42a0a3
1 changed files with 2 additions and 0 deletions

View File

@ -384,6 +384,8 @@ void spi_format(spi_t *obj, int bits, int mode, int slave)
_SPI(obj).CTRLA.bit.MODE = 0x2; _SPI(obj).CTRLA.bit.MODE = 0x2;
pSPI_S(obj)->mode = SPI_MODE_SLAVE; pSPI_S(obj)->mode = SPI_MODE_SLAVE;
pull_mode = PullNone; pull_mode = PullNone;
/* Enable PLOADEN to avoid sending dummy character by slave */
_SPI(obj).CTRLB.bit.PLOADEN = 1;
} else { } else {
/* Set the SERCOM in SPI mode */ /* Set the SERCOM in SPI mode */
_SPI(obj).CTRLA.bit.MODE = 0x3; _SPI(obj).CTRLA.bit.MODE = 0x3;