Replaced GCC specific __packed__ with generic MBED_PACKED

pull/2728/head
andreas.larsson 2016-09-16 15:23:41 +02:00
parent eacccddaa2
commit 7661fe5719
1 changed files with 4 additions and 3 deletions

View File

@ -1,15 +1,16 @@
#include <string.h>
#include "stm32f4xx_hal.h"
#include "toolchain.h"
#define C029_OTP_START_ADDRESS (0x1FFF7800U)
#define C029_OTP_END_ADDRESS (C029_OTP_START_ADDRESS + (16*32))
#define C029_MAC_ETHERNET_ID (3)
typedef struct C029_OTP_Header {
typedef MBED_PACKED(struct) C029_OTP_Header {
uint8_t id;
uint8_t len;
uint8_t data[];
} __attribute__((__packed__)) C029_OTP_Header;
} C029_OTP_Header;
static int _macRetrieved = 0;
static char _macAddr[6] = { 0x02, 0x02, 0xF7, 0xF0, 0x00, 0x00 };
@ -139,4 +140,4 @@ void mbed_mac_address(char *mac)
}
}
memcpy(mac, _macAddr, 6);
}
}