1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-18 12:52:44 +01:00

[board msba2-common board-config]

* fixed casting to satisfy strict-aliasing rules
This commit is contained in:
Oliver Hahm 2012-01-05 17:42:44 +01:00
parent 2a0a912a61
commit 531601e7bc

View File

@ -5,12 +5,14 @@
void config_load(void) {
extern char configmem[];
if (*((uint16_t*) configmem) == CONFIG_KEY) {
memcpy(&sysconfig, (configmem + sizeof(CONFIG_KEY)), sizeof(sysconfig));
}
else {
config_save();
}
/* cast it here for strict-aliasing */
uint16_t* tmp = (uint16_t*) configmem;
if (*tmp == CONFIG_KEY) {
memcpy(&sysconfig, (configmem + sizeof(CONFIG_KEY)), sizeof(sysconfig));
}
else {
config_save();
}
}
uint8_t config_save(void) {