Merge pull request #896 from simonduq/32bit-align-packetbuf
Align packetbuf on an even 32-bit boundary
This commit is contained in:
commit
2604260653
@ -56,10 +56,10 @@ static uint16_t buflen, bufptr;
|
||||
static uint8_t hdrptr;
|
||||
|
||||
/* The declarations below ensure that the packet buffer is aligned on
|
||||
an even 16-bit boundary. On some platforms (most notably the
|
||||
msp430), having apotentially misaligned packet buffer may lead to
|
||||
problems when accessing 16-bit values. */
|
||||
static uint16_t packetbuf_aligned[(PACKETBUF_SIZE + PACKETBUF_HDR_SIZE) / 2 + 1];
|
||||
an even 32-bit boundary. On some platforms (most notably the
|
||||
msp430 or OpenRISC), having a potentially misaligned packet buffer may lead to
|
||||
problems when accessing words. */
|
||||
static uint32_t packetbuf_aligned[(PACKETBUF_SIZE + PACKETBUF_HDR_SIZE + 3) / 4];
|
||||
static uint8_t *packetbuf = (uint8_t *)packetbuf_aligned;
|
||||
|
||||
static uint8_t *packetbufptr;
|
||||
|
Loading…
Reference in New Issue
Block a user