Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * @brief Copy a buffer from user memory area to packet memory area (PMA)
- * @param pbUsrBuf = pointer to user memory area.
- * @param wPMABufAddr: address into PMA.
- * @param wNBytes: no. of bytes to be copied.
- * @retval None
- */
- void PMAToUserBufferCopy(uint8_t *pbUsrBuf, uint16_t wPMABufAddr, uint16_t wNBytes)
- {
- uint32_t n = (wNBytes + 1) >> 1;
- uint32_t i;
- // uint16_t *pdwVal;
- uint8_t *pdwVal;
- // pdwVal = (uint16_t *)(wPMABufAddr + PMAAddr);
- pdwVal = (uint8_t *)(wPMABufAddr + PMAAddr);
- for (i = n; i != 0; i--)
- {
- //*(uint16_t*)pbUsrBuf++ = *pdwVal++;
- *(uint8_t*)pbUsrBuf++ = *pdwVal++;
- *(uint8_t*)pbUsrBuf++ = *pdwVal++;
- // pbUsrBuf++;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement