mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
cf3b704bc5
* changed display driver interface from uint8_t* to char* * fixed hardware timer interrupt * ported cc1100 driver * added simple test application for radio [msb430] * fixex config and flashrom [cc110x_ng] * removed dependency from sysconfig
20 lines
505 B
C
20 lines
505 B
C
#include <stdint.h>
|
|
#include <string.h>
|
|
#include <board-conf.h>
|
|
#include <config.h>
|
|
#include <flashrom.h>
|
|
|
|
void config_load(void) {
|
|
if (*((uint16_t*) INFOMEM) == CONFIG_KEY) {
|
|
memcpy(&sysconfig, (char*) (INFOMEM + sizeof(CONFIG_KEY)), sizeof(sysconfig));
|
|
}
|
|
else {
|
|
config_save();
|
|
}
|
|
}
|
|
|
|
uint8_t config_save(void) {
|
|
configmem_t mem = { CONFIG_KEY, sysconfig };
|
|
return (flashrom_erase((uint8_t*) INFOMEM) && flashrom_write((uint8_t*) INFOMEM, (char*) &mem, sizeof(mem)));
|
|
}
|