[Kinetis K] K64F and K20D50M - SPI Slave read bug fix

- Spi Slave - read() needs to clear Drain Request flag
pull/428/head
0xc0170 2014-08-07 08:53:55 +01:00
parent 5b145e4f6c
commit afdeba9811
2 changed files with 2 additions and 0 deletions

View File

@ -165,6 +165,7 @@ int spi_slave_receive(spi_t *obj) {
}
int spi_slave_read(spi_t *obj) {
obj->spi->SR |= SPI_SR_RFDF_MASK;
return obj->spi->POPR;
}

View File

@ -133,6 +133,7 @@ int spi_slave_receive(spi_t *obj) {
}
int spi_slave_read(spi_t *obj) {
dspi_hal_clear_status_flag(obj->instance, kDspiRxFifoDrainRequest);
return dspi_hal_read_data(obj->instance);
}