Updated for latest coffee-manager

This commit is contained in:
Niclas Finne 2012-01-30 22:19:18 +01:00
parent 66868253f0
commit 784ca301f8

View File

@ -26,7 +26,6 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: CoojaM25P80.java,v 1.2 2009/08/11 17:09:16 fros4943 Exp $
*/
package se.sics.cooja.mspmote.interfaces;
@ -34,15 +33,12 @@ package se.sics.cooja.mspmote.interfaces;
import java.io.IOException;
import java.util.Arrays;
import org.apache.log4j.Logger;
import se.sics.coffee.CoffeeConfiguration;
import se.sics.coffee.CoffeeImage;
import se.sics.mspsim.chip.M25P80;
import se.sics.mspsim.core.*;
import se.sics.mspsim.core.MSP430Core;
public class CoojaM25P80 extends M25P80 implements CoffeeImage {
private static Logger logger = Logger.getLogger(CoojaM25P80.class);
public static int SIZE = 1024*1024;
private byte[] data = new byte[SIZE];
@ -81,7 +77,7 @@ public class CoojaM25P80 extends M25P80 implements CoffeeImage {
* @see se.sics.coffee.CoffeeImage#erase(int, int)
*/
public void erase(int size, int offset) throws IOException {
Arrays.fill(data, CoffeeConfiguration.startOffset + offset, size, (byte)0);
Arrays.fill(data, COFFEE_CONF.startOffset + offset, size, (byte)0);
}
/**
@ -97,7 +93,7 @@ public class CoojaM25P80 extends M25P80 implements CoffeeImage {
* @see se.sics.coffee.CoffeeImage#read(byte[], int, int)
*/
public void read(byte[] bytes, int size, int offset) throws IOException {
System.arraycopy(data, CoffeeConfiguration.startOffset + offset, bytes, 0, size);
System.arraycopy(data, COFFEE_CONF.startOffset + offset, bytes, 0, size);
}
/**
@ -105,7 +101,7 @@ public class CoojaM25P80 extends M25P80 implements CoffeeImage {
* @see se.sics.coffee.CoffeeImage#write(byte[], int, int)
*/
public void write(byte[] bytes, int size, int offset) throws IOException {
System.arraycopy(bytes, 0, data, CoffeeConfiguration.startOffset + offset, size);
System.arraycopy(bytes, 0, data, COFFEE_CONF.startOffset + offset, size);
}
}