Skip to content

Commit 3140b4b

Browse files
author
Laurent MEUNIER
committed
UTEST Spi Asynch
Update test to be able to test on NUCLEO boards using generic default pins definitions
1 parent c5323c1 commit 3140b4b

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

libraries/tests/utest/spi_asynch/spi_master_asynch.cpp

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,18 @@
6464
#define TEST_SCLK_PIN P10_12
6565
#define TEST_CS_PIN P10_13
6666

67+
#elif defined(TARGET_FF_ARDUINO)
68+
#define TEST_MOSI_PIN D11
69+
#define TEST_MISO_PIN D12
70+
#define TEST_SCLK_PIN D13
71+
#define TEST_CS_PIN D10
72+
73+
#elif defined(TARGET_DISCO_F429ZI)
74+
#define TEST_MOSI_PIN PC_12
75+
#define TEST_MISO_PIN PC_11
76+
#define TEST_SCLK_PIN PC_10
77+
#define TEST_CS_PIN PA_15
78+
6779
#else
6880
#error Target not supported
6981
#endif
@@ -152,7 +164,7 @@ TEST(SPI_Master_Asynchronous, short_tx_0_rx)
152164
{
153165
int rc;
154166
// Write a buffer of Short Transfer length.
155-
rc = obj->transfer( tx_buf,SHORT_XFR,NULL,0, callback, -1);
167+
rc = obj->transfer( (const uint8_t *) tx_buf, SHORT_XFR, (uint8_t *) NULL, 0, callback, 255);
156168
CHECK_EQUAL(0, rc);
157169

158170
while (!complete);
@@ -171,7 +183,7 @@ TEST(SPI_Master_Asynchronous, short_tx_0_rx_nn)
171183
{
172184
int rc;
173185
// Write a buffer of Short Transfer length.
174-
rc = obj->transfer( tx_buf,SHORT_XFR,rx_buf,0,callback, -1);
186+
rc = obj->transfer( (const uint8_t *)tx_buf,SHORT_XFR,(uint8_t *) rx_buf, 0,callback, -1);
175187
CHECK_EQUAL(0, rc);
176188

177189
while (!complete);
@@ -189,7 +201,7 @@ TEST(SPI_Master_Asynchronous, 0_tx_short_rx)
189201
{
190202
int rc;
191203
// Read a buffer of Short Transfer length.
192-
rc = obj->transfer( NULL,0,rx_buf,SHORT_XFR,callback, -1);
204+
rc = obj->transfer( (const uint8_t *)NULL,0,(uint8_t *) rx_buf,SHORT_XFR,callback, -1);
193205
CHECK_EQUAL(0, rc);
194206

195207
while (!complete);

0 commit comments

Comments
 (0)