Make device_erase a no-op for FRAM chips.

This commit is contained in:
Daniel Beer 2012-08-09 15:30:05 +12:00
parent 886fbd59c9
commit ae9c212f37
2 changed files with 12 additions and 2 deletions

View File

@ -134,3 +134,13 @@ int device_is_fram(device_t dev)
return ((a < 0x04) && (b == 0x81)) ||
(((a & 0xf0) == 0x70) && ((b & 0x8e) == 0x80));
}
int device_erase(device_erase_type_t et, address_t addr)
{
if (device_is_fram(device_default)) {
printc_err("warning: not attempting erase of FRAM device\n");
return 0;
}
return device_default->type->erase(device_default, et, addr);
}

View File

@ -153,8 +153,6 @@ extern device_t device_default;
device_default->type->readmem(device_default, addr, mem, len)
#define device_writemem(addr, mem, len) \
device_default->type->writemem(device_default, addr, mem, len)
#define device_erase(et, addr) \
device_default->type->erase(device_default, et, addr)
#define device_getregs(regs) \
device_default->type->getregs(device_default, regs)
#define device_setregs(regs) \
@ -164,4 +162,6 @@ extern device_t device_default;
#define device_poll() \
device_default->type->poll(device_default)
int device_erase(device_erase_type_t et, address_t addr);
#endif