diff options
author | edolomb <none@example.com> | 2018-01-29 16:42:03 +0000 |
---|---|---|
committer | edolomb <none@example.com> | 2018-01-29 16:42:03 +0000 |
commit | a6c370b858d1f57061dcf7bc36f05e75b72734ef (patch) | |
tree | bd89aaaf58f703fe2a15adb528b24ea238408b17 /os/hal/ports/SAMA | |
parent | 37fa6f2f1ebea0c601944567c9e862650b62ba1a (diff) | |
download | ChibiOS-a6c370b858d1f57061dcf7bc36f05e75b72734ef.tar.gz ChibiOS-a6c370b858d1f57061dcf7bc36f05e75b72734ef.tar.bz2 ChibiOS-a6c370b858d1f57061dcf7bc36f05e75b72734ef.zip |
Fixed bug on length of frame
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@11407 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/ports/SAMA')
-rw-r--r-- | os/hal/ports/SAMA/LLD/MACv1/hal_mac_lld.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/os/hal/ports/SAMA/LLD/MACv1/hal_mac_lld.c b/os/hal/ports/SAMA/LLD/MACv1/hal_mac_lld.c index 56b9939ad..0be3c7d91 100644 --- a/os/hal/ports/SAMA/LLD/MACv1/hal_mac_lld.c +++ b/os/hal/ports/SAMA/LLD/MACv1/hal_mac_lld.c @@ -539,7 +539,7 @@ void mac_lld_release_transmit_descriptor(MACTransmitDescriptor *tdp) { osalSysLock();
/* Unlocks the descriptor and returns it to the DMA engine.*/
- tdp->physdesc->tdes1 = SAMA_TDES1_LAST_BUFF | (SAMA_TDES1_LENGTH_BUFF & BUFFER_SIZE);
+ tdp->physdesc->tdes1 &= ~(SAMA_TDES1_LOCKED | SAMA_TDES1_USED);
/* Wait for the write to tdes1 to go through before resuming the DMA.*/
__DSB();
@@ -728,6 +728,9 @@ size_t mac_lld_write_transmit_descriptor(MACTransmitDescriptor *tdp, if (size > tdp->size - tdp->offset)
size = tdp->size - tdp->offset;
+ /* Configure lentgh of buffer */
+ tdp->physdesc->tdes1 |= (SAMA_TDES1_LENGTH_BUFF & size);
+
if (size > 0) {
memcpy((uint8_t *)(tdp->physdesc->tdes0) + tdp->offset, buf, size);
tdp->offset += size;
|