Skip to content

Commit ba50b60

Browse files
RCSNRbb666
authored andcommitted
[components][drivers][spi]: fix: set message.parent.next to NULL for rt_qspi_send_then_recv API and rt_qspi_send API
- Ensure correct QSPI message chaining by setting next pointer to NULL, preventing unintended data transmission issues. Signed-off-by: Runcheng Lu <[email protected]>
1 parent faa8702 commit ba50b60

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

components/drivers/spi/dev_qspi_core.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,9 @@ rt_err_t rt_qspi_send_then_recv(struct rt_qspi_device *device, const void *send_
199199
message.parent.cs_release = 1;
200200

201201
message.qspi_data_lines = 1;
202+
/* set next */
203+
/* Ensure correct QSPI message chaining by setting next pointer to NULL, preventing unintended data transmission issues.*/
204+
message.parent.next = RT_NULL;
202205

203206
result = rt_qspi_transfer_message(device, &message);
204207
if (result == 0)
@@ -282,6 +285,9 @@ rt_err_t rt_qspi_send(struct rt_qspi_device *device, const void *send_buf, rt_si
282285
message.parent.length = length - count;
283286
message.parent.cs_take = 1;
284287
message.parent.cs_release = 1;
288+
/* set next */
289+
/* Ensure correct QSPI message chaining by setting next pointer to NULL, preventing unintended data transmission issues.*/
290+
message.parent.next = RT_NULL;
285291

286292
result = rt_qspi_transfer_message(device, &message);
287293
if (result == 0)

0 commit comments

Comments
 (0)