1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

* introduced flashrom driver for msb430

* restructured some files concerning flashrom access
* added some ifdefs to shell commands
This commit is contained in:
Oliver Hahm 2010-12-03 22:22:58 +01:00
parent 5f84689c0b
commit d00b12ef75
4 changed files with 12 additions and 2 deletions

View File

@ -34,4 +34,5 @@ FLASHFLAGS ?= -d $(FLASH_PORT) -j uif ;
RESET ?= $(FLASHER) $(FLASHFLAGS) reset ;
HDRS += [ FPath $(TOP) board msb-430-common include ] ;
HDRS += [ FPath $(TOP) board msb-430-common drivers include ] ;

View File

@ -1,6 +1,9 @@
#include <stdint.h>
#include <board-conf.h>
#include <config.h>
#include <flashrom.h>
uint8_t config_save(void) {
return 1;
configmem_t mem = { CONFIG_KEY, sysconfig };
return (flashrom_erase((uint8_t*) INFOMEM) && flashrom_write((uint8_t*) INFOMEM, (char*) &mem, sizeof(mem)));
}

View File

@ -0,0 +1,6 @@
#ifndef BOARD_CONF_H
#define BOARD_CONF_H
#define INFOMEM (0x1000)
#endif /* BOARD-CONF_H */

View File

@ -4,5 +4,5 @@
uint8_t config_save(void) {
configmem_t mem = { CONFIG_KEY, sysconfig };
return (flashrom_erase((uint32_t) configmem) && flashrom_write((uint32_t) configmem, (char*) &mem, sizeof(mem)));
return (flashrom_erase((uint8_t*) &configmem) && flashrom_write((uint8_t*) &configmem, (char*) &mem, sizeof(mem)));
}