Merge pull request #282 from wirstrom/patch-1

Fixed alignment bug for msp430
This commit is contained in:
Joakim Eriksson 2018-01-26 13:51:10 +01:00 committed by GitHub
commit 95e5b10ab6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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");
}