From 839f0cc4d0b5983567d0ae99d2990ea3a27f25d9 Mon Sep 17 00:00:00 2001 From: Brent Kowal Date: Fri, 28 Feb 2025 14:03:39 -0500 Subject: [PATCH] SPI RevA1 DMA Handler Fix Fixes multiple potential issues with the SPI DMA handler which could cause SPI transactions to falsely get callbacks and terminated, or some transactions to never get callbacks or terminate under various conditions. --- Libraries/PeriphDrivers/Source/SPI/spi_reva1.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Libraries/PeriphDrivers/Source/SPI/spi_reva1.c b/Libraries/PeriphDrivers/Source/SPI/spi_reva1.c index fbe87887dd8..2d596fd77c1 100644 --- a/Libraries/PeriphDrivers/Source/SPI/spi_reva1.c +++ b/Libraries/PeriphDrivers/Source/SPI/spi_reva1.c @@ -1,8 +1,8 @@ /****************************************************************************** * - * Copyright (C) 2022-2023 Maxim Integrated Products, Inc. (now owned by + * Copyright (C) 2022-2023 Maxim Integrated Products, Inc. (now owned by * Analog Devices, Inc.), - * Copyright (C) 2023-2024 Analog Devices, Inc. + * Copyright (C) 2023-2025 Analog Devices, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -1309,6 +1309,9 @@ void MXC_SPI_RevA1_DMACallback(int ch, int error) if (MXC_SPI_GetDataSize((mxc_spi_regs_t *)temp_req->spi) > 8) { MXC_SPI_RevA1_SwapByte(temp_req->rxData, temp_req->rxLen); } + } else { + //No channel match, continue searching. + continue; } if (!states[i].txrx_req || (states[i].txrx_req && states[i].req_done == 2)) {