samples/spi: Make async test optional

Handle the case when the async transceive call returns ENOTSUP.

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
This commit is contained in:
Neil Armstrong 2017-06-22 17:09:09 +02:00 committed by Anas Nashif
commit 9eb865e03a

View file

@ -287,6 +287,11 @@ static int spi_async_call(struct spi_config *spi_conf)
ret = spi_transceive_async(spi_conf, tx_bufs, ARRAY_SIZE(tx_bufs), ret = spi_transceive_async(spi_conf, tx_bufs, ARRAY_SIZE(tx_bufs),
rx_bufs, ARRAY_SIZE(rx_bufs), &async_sig); rx_bufs, ARRAY_SIZE(rx_bufs), &async_sig);
if (ret == -ENOTSUP) {
SYS_LOG_DBG("Not supported");
return 0;
}
if (ret) { if (ret) {
SYS_LOG_ERR("Code %d", ret); SYS_LOG_ERR("Code %d", ret);
return -1; return -1;