Fixed alignment bug for msp430

This commit is contained in:
wirstrom 2018-01-26 11:48:27 +01:00 committed by Niklas Wirström
parent c89d40590b
commit 2122ffdeeb
2 changed files with 6 additions and 2 deletions

View File

@ -66,7 +66,9 @@ void input_callback(const void *data, uint16_t len,
const linkaddr_t *src, const linkaddr_t *dest)
{
if(len == sizeof(unsigned)) {
LOG_INFO("Received %u from ", *(unsigned *)data);
unsigned count;
memcpy(&count, data, sizeof(count));
LOG_INFO("Received %u from ", count);
LOG_INFO_LLADDR(src);
LOG_INFO_("\n");
}

View File

@ -68,7 +68,9 @@ void input_callback(const void *data, uint16_t len,
const linkaddr_t *src, const linkaddr_t *dest)
{
if(len == sizeof(unsigned)) {
LOG_INFO("Received %u from ", *(unsigned *)data);
unsigned count;
memcpy(&count, data, sizeof(count));
LOG_INFO("Received %u from ", count);
LOG_INFO_LLADDR(src);
LOG_INFO_("\n");
}