Skip to content

Commit 8fdd701

Browse files
committed
[nrf fromlist] tests: drivers: mspi: make MSPI API test more generic
Add ifdefs to make MSPI API test more generic. Upstream PR #: 81870 Signed-off-by: Jakub Zymelka <[email protected]>
1 parent 01976a7 commit 8fdd701

File tree

1 file changed

+9
-1
lines changed
  • tests/drivers/mspi/api/src

1 file changed

+9
-1
lines changed

tests/drivers/mspi/api/src/main.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,17 @@ static struct mspi_dev_cfg device_cfg[] = {
5151
DT_FOREACH_CHILD_STATUS_OKAY_SEP(MSPI_BUS_NODE, MSPI_DEVICE_CONFIG_DT, (,))
5252
};
5353

54+
#if CONFIG_MSPI_XIP
5455
static struct mspi_xip_cfg xip_cfg[] = {
5556
DT_FOREACH_CHILD_STATUS_OKAY_SEP(MSPI_BUS_NODE, MSPI_XIP_CONFIG_DT, (,))
5657
};
58+
#endif
5759

60+
#if CONFIG_MSPI_SCRAMBLE
5861
static struct mspi_scramble_cfg scramble_cfg[] = {
5962
DT_FOREACH_CHILD_STATUS_OKAY_SEP(MSPI_BUS_NODE, MSPI_SCRAMBLE_CONFIG_DT, (,))
6063
};
64+
#endif
6165

6266
ZTEST(mspi_api, test_mspi_api)
6367
{
@@ -104,7 +108,11 @@ ZTEST(mspi_api, test_mspi_api)
104108

105109
ret = mspi_register_callback(mspi_bus, &dev_id[dev_idx],
106110
MSPI_BUS_XFER_COMPLETE, NULL, NULL);
107-
zassert_equal(ret, 0, "mspi_register_callback failed.");
111+
if (ret == -ENOTSUP) {
112+
printf("mspi_register_callback not supported.\n");
113+
} else {
114+
zassert_equal(ret, 0, "mspi_register_callback failed.");
115+
}
108116

109117
ret = mspi_get_channel_status(mspi_bus, 0);
110118
zassert_equal(ret, 0, "mspi_get_channel_status failed.");

0 commit comments

Comments
 (0)