mirror of
https://github.com/apache/nuttx.git
synced 2026-05-31 14:27:37 +08:00
rpmsg_port_spi: add log to know spi complete callback not called
1. add error log when transferring keeps rasing because of no spi exchange complete callback; 2. this log can also be used to check if there is an interrupt has been caught when peer side keeps trying to send data; Signed-off-by: liaoao <liaoao@xiaomi.com>
This commit is contained in:
@@ -195,10 +195,17 @@ static void rpmsg_port_spi_register_cb(FAR struct rpmsg_port_s *port,
|
|||||||
static void rpmsg_port_spi_exchange(FAR struct rpmsg_port_spi_s *rpspi)
|
static void rpmsg_port_spi_exchange(FAR struct rpmsg_port_spi_s *rpspi)
|
||||||
{
|
{
|
||||||
FAR struct rpmsg_port_header_s *txhdr;
|
FAR struct rpmsg_port_header_s *txhdr;
|
||||||
|
int pending;
|
||||||
|
|
||||||
IOEXP_WRITEPIN(rpspi->ioe, rpspi->mreq, 0);
|
IOEXP_WRITEPIN(rpspi->ioe, rpspi->mreq, 0);
|
||||||
if (atomic_fetch_add(&rpspi->transferring, 1))
|
pending = atomic_fetch_add(&rpspi->transferring, 1);
|
||||||
|
if (pending > 0)
|
||||||
{
|
{
|
||||||
|
if (pending > 1)
|
||||||
|
{
|
||||||
|
rpmsgerr("pending too many requests: %d\n", pending);
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user