aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/ports/SAMA/LLD/DMAv1/sama_xdmac.c
diff options
context:
space:
mode:
authorisiora <none@example.com>2018-03-21 14:30:14 +0000
committerisiora <none@example.com>2018-03-21 14:30:14 +0000
commitbbc08d06d1c167232c2c66dc386c1fd353e6a728 (patch)
treec869af9c2c2c8bba855fde17eafabcabfc66f425 /os/hal/ports/SAMA/LLD/DMAv1/sama_xdmac.c
parent1db7f68d4ad84c7e8c9b5e1240e9bb2c684ce670 (diff)
downloadChibiOS-bbc08d06d1c167232c2c66dc386c1fd353e6a728.tar.gz
ChibiOS-bbc08d06d1c167232c2c66dc386c1fd353e6a728.tar.bz2
ChibiOS-bbc08d06d1c167232c2c66dc386c1fd353e6a728.zip
Minor changes.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@11830 110e8d01-0319-4d1e-a829-52ad28d1bb01
Diffstat (limited to 'os/hal/ports/SAMA/LLD/DMAv1/sama_xdmac.c')
-rw-r--r--os/hal/ports/SAMA/LLD/DMAv1/sama_xdmac.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/os/hal/ports/SAMA/LLD/DMAv1/sama_xdmac.c b/os/hal/ports/SAMA/LLD/DMAv1/sama_xdmac.c
index af90acbb1..4867b91e9 100644
--- a/os/hal/ports/SAMA/LLD/DMAv1/sama_xdmac.c
+++ b/os/hal/ports/SAMA/LLD/DMAv1/sama_xdmac.c
@@ -177,6 +177,7 @@ void dmaInit(void) {
* @param[in] size value to be written in the XDMAC_CUBC register
*
* @special
+ *
*/
void dmaChannelSetTransactionSize(sama_dma_channel_t *dmachp, size_t n) {
@@ -191,16 +192,16 @@ uint32_t divisor;
/* If n exceeds XDMAC_MAX_BT_SIZE, split the transfer in microblocks */
for (i = 2; i < XDMAC_MAX_BT_SIZE; i++) {
divisor = XDMAC_MAX_BT_SIZE / i;
- if (n % divisor)
+ if (n % diviqsor)
continue;
- if ((n / divisor) <= XDMAC_MAX_BLOCK_LEN) {
+ if ((n / divisor) <= (XDMAC_MAX_BLOCK_LEN + 1)) {
(dmachp)->xdmac->XDMAC_CHID[(dmachp)->chid].XDMAC_CUBC = XDMAC_CUBC_UBLEN(i);
(dmachp)->xdmac->XDMAC_CHID[(dmachp)->chid].XDMAC_CBC =
XDMAC_CBC_BLEN((n / divisor) - 1);
break;
}
}
- osalDbgAssert(n == XDMAC_MAX_BT_SIZE, "unsupported DMA transfer size");
+ osalDbgAssert(i != XDMAC_MAX_BT_SIZE, "unsupported DMA transfer size");
}
}