make 51822 xxAC compile ok
currently we DONOT have a 51822 xxAC(we only have xxAA of which the ram is only 16k which is too small to porting nimble, means currently the nimble ble on 51822 probably may not work). xxAC is coming soon(on EMS), I will make nimble on 51822 xxAC later.
This commit is contained in:
@@ -207,6 +207,7 @@ struct nrf_ccm_data g_nrf_ccm_data;
|
||||
void
|
||||
ble_phy_rxpdu_copy(uint8_t *dptr, struct os_mbuf *rxpdu)
|
||||
{
|
||||
#if 0
|
||||
uint32_t rem_len;
|
||||
uint32_t copy_len;
|
||||
uint32_t block_len;
|
||||
@@ -284,6 +285,71 @@ ble_phy_rxpdu_copy(uint8_t *dptr, struct os_mbuf *rxpdu)
|
||||
/* Copy header */
|
||||
memcpy(BLE_MBUF_HDR_PTR(rxpdu), &g_ble_phy_data.rxhdr,
|
||||
sizeof(struct ble_mbuf_hdr));
|
||||
#else
|
||||
uint16_t rem_bytes;
|
||||
uint16_t mb_bytes;
|
||||
uint16_t copylen;
|
||||
uint32_t *dst;
|
||||
uint32_t *src;
|
||||
struct os_mbuf *m;
|
||||
struct ble_mbuf_hdr *ble_hdr;
|
||||
struct os_mbuf_pkthdr *pkthdr;
|
||||
|
||||
/* Better be aligned */
|
||||
assert(((uint32_t)dptr & 3) == 0);
|
||||
|
||||
pkthdr = OS_MBUF_PKTHDR(rxpdu);
|
||||
rem_bytes = pkthdr->omp_len;
|
||||
|
||||
/* Fill in the mbuf pkthdr first. */
|
||||
dst = (uint32_t *)(rxpdu->om_data);
|
||||
src = (uint32_t *)dptr;
|
||||
|
||||
mb_bytes = (rxpdu->om_omp->omp_databuf_len - rxpdu->om_pkthdr_len - 4);
|
||||
copylen = min(mb_bytes, rem_bytes);
|
||||
copylen &= 0xFFFC;
|
||||
rem_bytes -= copylen;
|
||||
mb_bytes -= copylen;
|
||||
rxpdu->om_len = copylen;
|
||||
while (copylen > 0) {
|
||||
*dst = *src;
|
||||
++dst;
|
||||
++src;
|
||||
copylen -= 4;
|
||||
}
|
||||
|
||||
/* Copy remaining bytes */
|
||||
m = rxpdu;
|
||||
while (rem_bytes > 0) {
|
||||
/* If there are enough bytes in the mbuf, copy them and leave */
|
||||
if (rem_bytes <= mb_bytes) {
|
||||
memcpy(m->om_data + m->om_len, src, rem_bytes);
|
||||
m->om_len += rem_bytes;
|
||||
break;
|
||||
}
|
||||
|
||||
m = SLIST_NEXT(m, om_next);
|
||||
assert(m != NULL);
|
||||
|
||||
mb_bytes = m->om_omp->omp_databuf_len;
|
||||
copylen = min(mb_bytes, rem_bytes);
|
||||
copylen &= 0xFFFC;
|
||||
rem_bytes -= copylen;
|
||||
mb_bytes -= copylen;
|
||||
m->om_len = copylen;
|
||||
dst = (uint32_t *)m->om_data;
|
||||
while (copylen > 0) {
|
||||
*dst = *src;
|
||||
++dst;
|
||||
++src;
|
||||
copylen -= 4;
|
||||
}
|
||||
}
|
||||
|
||||
/* Copy ble header */
|
||||
ble_hdr = BLE_MBUF_HDR_PTR(rxpdu);
|
||||
memcpy(ble_hdr, &g_ble_phy_data.rxhdr, sizeof(struct ble_mbuf_hdr));
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
|
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user