Guest User

Untitled

a guest
Oct 4th, 2017
90
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /**
  2. * @brief Copy a buffer from user memory area to packet memory area (PMA)
  3. * @param pbUsrBuf = pointer to user memory area.
  4. * @param wPMABufAddr: address into PMA.
  5. * @param wNBytes: no. of bytes to be copied.
  6. * @retval None
  7. */
  8. void PMAToUserBufferCopy(uint8_t *pbUsrBuf, uint16_t wPMABufAddr, uint16_t wNBytes)
  9. {
  10. uint32_t n = (wNBytes + 1) >> 1;
  11. uint32_t i;
  12. // uint16_t *pdwVal;
  13. uint8_t *pdwVal;
  14. // pdwVal = (uint16_t *)(wPMABufAddr + PMAAddr);
  15. pdwVal = (uint8_t *)(wPMABufAddr + PMAAddr);
  16. for (i = n; i != 0; i--)
  17. {
  18. //*(uint16_t*)pbUsrBuf++ = *pdwVal++;
  19. *(uint8_t*)pbUsrBuf++ = *pdwVal++;
  20. *(uint8_t*)pbUsrBuf++ = *pdwVal++;
  21. // pbUsrBuf++;
  22. }
  23. }
RAW Paste Data