tilib: fix DEVICE_ERASE_MAIN.

The address given to the library must be one inside main memory.
This commit is contained in:
Daniel Beer 2012-06-19 10:08:48 +12:00
parent c243ed04dc
commit e6cb2dc51d
1 changed files with 3 additions and 0 deletions

View File

@ -278,6 +278,9 @@ static int tilib_erase(device_t dev_base, device_erase_type_t type,
{
struct tilib_device *dev = (struct tilib_device *)dev_base;
if (type == DEVICE_ERASE_MAIN)
address = 0xfffe;
if (dev->MSP430_Erase(ti_erase_type(type), address, 0) < 0) {
report_error(dev, "MSP430_Erase");
return -1;