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:
parent
2a0a912a61
commit
531601e7bc
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user