Fixed bug on length of frame

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@11407 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
edolomb 2018-01-29 16:42:03 +00:00
parent 37fa6f2f1e
commit a6c370b858
1 changed files with 4 additions and 1 deletions

View File

@ -539,7 +539,7 @@ void mac_lld_release_transmit_descriptor(MACTransmitDescriptor *tdp) {
osalSysLock(); osalSysLock();
/* Unlocks the descriptor and returns it to the DMA engine.*/ /* 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.*/ /* Wait for the write to tdes1 to go through before resuming the DMA.*/
__DSB(); __DSB();
@ -728,6 +728,9 @@ size_t mac_lld_write_transmit_descriptor(MACTransmitDescriptor *tdp,
if (size > tdp->size - tdp->offset) if (size > tdp->size - tdp->offset)
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) { if (size > 0) {
memcpy((uint8_t *)(tdp->physdesc->tdes0) + tdp->offset, buf, size); memcpy((uint8_t *)(tdp->physdesc->tdes0) + tdp->offset, buf, size);
tdp->offset += size; tdp->offset += size;