diff --git a/targets/TARGET_ARM_SSG/TARGET_CM3DS_MPS2/spi_api.c b/targets/TARGET_ARM_SSG/TARGET_CM3DS_MPS2/spi_api.c index 3ce247cc937..2cd42d1a39b 100644 --- a/targets/TARGET_ARM_SSG/TARGET_CM3DS_MPS2/spi_api.c +++ b/targets/TARGET_ARM_SSG/TARGET_CM3DS_MPS2/spi_api.c @@ -223,9 +223,8 @@ int spi_master_block_write(spi_t *obj, const char *tx_buffer, int tx_length, int spi_slave_receive(spi_t *obj) { int32_t status = spi_pl022_get_status(obj->spi); - /* Rx FIFO not empty and device not busy */ - int32_t ret = ((status & SPI_PL022_SSPSR_RNE_MSK) && - !(status & SPI_PL022_SSPSR_BSY_MSK)); + /* Rx FIFO not empty */ + int32_t ret = (status & SPI_PL022_SSPSR_RNE_MSK); return ret; } diff --git a/targets/TARGET_ARM_SSG/TARGET_IOTSS/spi_api.c b/targets/TARGET_ARM_SSG/TARGET_IOTSS/spi_api.c index 88b2e89be27..f52459502bb 100644 --- a/targets/TARGET_ARM_SSG/TARGET_IOTSS/spi_api.c +++ b/targets/TARGET_ARM_SSG/TARGET_IOTSS/spi_api.c @@ -284,7 +284,7 @@ int spi_master_block_write(spi_t *obj, const char *tx_buffer, int tx_length, } int spi_slave_receive(spi_t *obj) { - return (ssp_readable(obj) && !ssp_busy(obj)) ? (1) : (0); + return ssp_readable(obj) ? (1) : (0); } int spi_slave_read(spi_t *obj) { diff --git a/targets/TARGET_ARM_SSG/TARGET_MPS2/spi_api.c b/targets/TARGET_ARM_SSG/TARGET_MPS2/spi_api.c index affd5b25148..7b0eb3dc99f 100644 --- a/targets/TARGET_ARM_SSG/TARGET_MPS2/spi_api.c +++ b/targets/TARGET_ARM_SSG/TARGET_MPS2/spi_api.c @@ -284,7 +284,7 @@ int spi_master_block_write(spi_t *obj, const char *tx_buffer, int tx_length, } int spi_slave_receive(spi_t *obj) { - return (ssp_readable(obj) && !ssp_busy(obj)) ? (1) : (0); + return ssp_readable(obj) ? (1) : (0); } int spi_slave_read(spi_t *obj) { diff --git a/targets/TARGET_NXP/TARGET_LPC11U6X/spi_api.c b/targets/TARGET_NXP/TARGET_LPC11U6X/spi_api.c index 6f78a61cd96..0830e4716c2 100644 --- a/targets/TARGET_NXP/TARGET_LPC11U6X/spi_api.c +++ b/targets/TARGET_NXP/TARGET_LPC11U6X/spi_api.c @@ -206,7 +206,7 @@ int spi_master_block_write(spi_t *obj, const char *tx_buffer, int tx_length, } int spi_slave_receive(spi_t *obj) { - return (ssp_readable(obj) && !ssp_busy(obj)) ? (1) : (0); + return ssp_readable(obj) ? (1) : (0); } int spi_slave_read(spi_t *obj) { diff --git a/targets/TARGET_NXP/TARGET_LPC11UXX/spi_api.c b/targets/TARGET_NXP/TARGET_LPC11UXX/spi_api.c index 19d40f2ff36..3e28a4f5f69 100644 --- a/targets/TARGET_NXP/TARGET_LPC11UXX/spi_api.c +++ b/targets/TARGET_NXP/TARGET_LPC11UXX/spi_api.c @@ -172,7 +172,7 @@ int spi_master_block_write(spi_t *obj, const char *tx_buffer, int tx_length, } int spi_slave_receive(spi_t *obj) { - return (ssp_readable(obj) && !ssp_busy(obj)) ? (1) : (0); + return ssp_readable(obj) ? (1) : (0); } int spi_slave_read(spi_t *obj) { diff --git a/targets/TARGET_NXP/TARGET_LPC13XX/spi_api.c b/targets/TARGET_NXP/TARGET_LPC13XX/spi_api.c index f6243fde4a4..352e2ecdf9e 100644 --- a/targets/TARGET_NXP/TARGET_LPC13XX/spi_api.c +++ b/targets/TARGET_NXP/TARGET_LPC13XX/spi_api.c @@ -200,7 +200,7 @@ int spi_master_block_write(spi_t *obj, const char *tx_buffer, int tx_length, } int spi_slave_receive(spi_t *obj) { - return (ssp_readable(obj) && !ssp_busy(obj)) ? (1) : (0); + return ssp_readable(obj) ? (1) : (0); } int spi_slave_read(spi_t *obj) { diff --git a/targets/TARGET_NXP/TARGET_LPC15XX/spi_api.c b/targets/TARGET_NXP/TARGET_LPC15XX/spi_api.c index 9d7d8f5f001..2bc4dc2d028 100644 --- a/targets/TARGET_NXP/TARGET_LPC15XX/spi_api.c +++ b/targets/TARGET_NXP/TARGET_LPC15XX/spi_api.c @@ -265,7 +265,7 @@ int spi_master_block_write(spi_t *obj, const char *tx_buffer, int spi_slave_receive(spi_t *obj) { - return (spi_readable(obj) && !spi_busy(obj)) ? (1) : (0); + return spi_readable(obj) ? (1) : (0); } int spi_slave_read(spi_t *obj) diff --git a/targets/TARGET_NXP/TARGET_LPC176X/spi_api.c b/targets/TARGET_NXP/TARGET_LPC176X/spi_api.c index cc30a264e8a..8611bab9c5b 100644 --- a/targets/TARGET_NXP/TARGET_LPC176X/spi_api.c +++ b/targets/TARGET_NXP/TARGET_LPC176X/spi_api.c @@ -206,7 +206,7 @@ int spi_master_block_write(spi_t *obj, const char *tx_buffer, int tx_length, } int spi_slave_receive(spi_t *obj) { - return (ssp_readable(obj) && !ssp_busy(obj)) ? (1) : (0); + return ssp_readable(obj) ? (1) : (0); } int spi_slave_read(spi_t *obj) { diff --git a/targets/TARGET_NXP/TARGET_LPC408X/TARGET_LPC4088/spi_api.c b/targets/TARGET_NXP/TARGET_LPC408X/TARGET_LPC4088/spi_api.c index 9fdf2331db7..8fb73ef9194 100644 --- a/targets/TARGET_NXP/TARGET_LPC408X/TARGET_LPC4088/spi_api.c +++ b/targets/TARGET_NXP/TARGET_LPC408X/TARGET_LPC4088/spi_api.c @@ -214,7 +214,7 @@ int spi_master_block_write(spi_t *obj, const char *tx_buffer, int tx_length, } int spi_slave_receive(spi_t *obj) { - return (ssp_readable(obj) && !ssp_busy(obj)) ? (1) : (0); + return ssp_readable(obj) ? (1) : (0); } int spi_slave_read(spi_t *obj) { diff --git a/targets/TARGET_NXP/TARGET_LPC43XX/spi_api.c b/targets/TARGET_NXP/TARGET_LPC43XX/spi_api.c index ac30524aef4..814d875346c 100644 --- a/targets/TARGET_NXP/TARGET_LPC43XX/spi_api.c +++ b/targets/TARGET_NXP/TARGET_LPC43XX/spi_api.c @@ -212,7 +212,7 @@ int spi_master_block_write(spi_t *obj, const char *tx_buffer, int tx_length, } int spi_slave_receive(spi_t *obj) { - return (ssp_readable(obj) && !ssp_busy(obj)) ? (1) : (0); + return ssp_readable(obj) ? (1) : (0); } int spi_slave_read(spi_t *obj) { diff --git a/targets/TARGET_NXP/TARGET_LPC81X/spi_api.c b/targets/TARGET_NXP/TARGET_LPC81X/spi_api.c index 88ba0a725fe..1b84d5d6926 100644 --- a/targets/TARGET_NXP/TARGET_LPC81X/spi_api.c +++ b/targets/TARGET_NXP/TARGET_LPC81X/spi_api.c @@ -194,7 +194,7 @@ int spi_master_block_write(spi_t *obj, const char *tx_buffer, int tx_length, } int spi_slave_receive(spi_t *obj) { - return (ssp_readable(obj) && !ssp_busy(obj)) ? (1) : (0); + return ssp_readable(obj) ? (1) : (0); } int spi_slave_read(spi_t *obj) { diff --git a/targets/TARGET_NXP/TARGET_LPC82X/spi_api.c b/targets/TARGET_NXP/TARGET_LPC82X/spi_api.c index 892a123ed1d..7c183bf7ce7 100644 --- a/targets/TARGET_NXP/TARGET_LPC82X/spi_api.c +++ b/targets/TARGET_NXP/TARGET_LPC82X/spi_api.c @@ -197,7 +197,7 @@ int spi_busy(spi_t *obj) int spi_slave_receive(spi_t *obj) { - return (spi_readable(obj) && !spi_busy(obj)) ? (1) : (0); + return ssp_readable(obj) ? (1) : (0); } int spi_slave_read(spi_t *obj) diff --git a/targets/TARGET_RENESAS/TARGET_RZ_A1XX/spi_api.c b/targets/TARGET_RENESAS/TARGET_RZ_A1XX/spi_api.c index fd3db3716f3..94063aaf557 100644 --- a/targets/TARGET_RENESAS/TARGET_RZ_A1XX/spi_api.c +++ b/targets/TARGET_RENESAS/TARGET_RZ_A1XX/spi_api.c @@ -233,7 +233,7 @@ int spi_master_block_write(spi_t *obj, const char *tx_buffer, int tx_length, } int spi_slave_receive(spi_t *obj) { - return (spi_readable(obj) && !spi_busy(obj)) ? (1) : (0); + return spi_readable(obj) ? (1) : (0); } int spi_slave_read(spi_t *obj) { diff --git a/targets/TARGET_Realtek/TARGET_AMEBA/TARGET_RTL8195A/spi_api.c b/targets/TARGET_Realtek/TARGET_AMEBA/TARGET_RTL8195A/spi_api.c index 225d29d0bd3..faeb9964e95 100644 --- a/targets/TARGET_Realtek/TARGET_AMEBA/TARGET_RTL8195A/spi_api.c +++ b/targets/TARGET_Realtek/TARGET_AMEBA/TARGET_RTL8195A/spi_api.c @@ -266,14 +266,12 @@ int spi_slave_receive (spi_t *obj) PHAL_SSI_ADAPTOR pHalSsiAdaptor; PHAL_SSI_OP pHalSsiOp; int Readable; - int Busy; pHalSsiAdaptor = &obj->spi_adp; pHalSsiOp = &obj->spi_op; Readable = pHalSsiOp->HalSsiReadable(pHalSsiAdaptor); - Busy = (int)pHalSsiOp->HalSsiBusy(pHalSsiAdaptor); - return ((Readable && !Busy) ? 1 : 0); + return (Readable ? 1 : 0); } int spi_slave_read (spi_t *obj) diff --git a/targets/TARGET_STM/stm_spi_api.c b/targets/TARGET_STM/stm_spi_api.c index e93b23ff8d1..f85f01cabeb 100644 --- a/targets/TARGET_STM/stm_spi_api.c +++ b/targets/TARGET_STM/stm_spi_api.c @@ -454,7 +454,7 @@ int spi_master_block_write(spi_t *obj, const char *tx_buffer, int tx_length, int spi_slave_receive(spi_t *obj) { - return ((ssp_readable(obj) && !ssp_busy(obj)) ? 1 : 0); + return (ssp_readable(obj) ? 1 : 0); }; int spi_slave_read(spi_t *obj) diff --git a/targets/TARGET_WIZNET/TARGET_W7500x/spi_api.c b/targets/TARGET_WIZNET/TARGET_W7500x/spi_api.c index 33aa6798a93..3ba5c569f56 100644 --- a/targets/TARGET_WIZNET/TARGET_W7500x/spi_api.c +++ b/targets/TARGET_WIZNET/TARGET_W7500x/spi_api.c @@ -199,7 +199,7 @@ int spi_master_block_write(spi_t *obj, const char *tx_buffer, int tx_length, } int spi_slave_receive(spi_t *obj) { - return (ssp_readable(obj) && !ssp_busy(obj)) ? (1) : (0); + return ssp_readable(obj) ? (1) : (0); } int spi_slave_read(spi_t *obj) {