mirror of https://github.com/contiki-ng/mspsim
Updated to use new API for port listeners (addPortListener/removePortListener instead of setPortListener)
This commit is contained in:
parent
9ba99d7925
commit
a7deb906e7
|
|
@ -145,7 +145,7 @@ public class ESBNode extends GenericNode implements PortListener {
|
|||
IOUnit unit = cpu.getIOUnit("Port 2");
|
||||
if (unit instanceof IOPort) {
|
||||
port2 = (IOPort) unit;
|
||||
port2.setPortListener(this);
|
||||
port2.addPortListener(this);
|
||||
}
|
||||
|
||||
unit = cpu.getIOUnit("Port 1");
|
||||
|
|
@ -156,7 +156,7 @@ public class ESBNode extends GenericNode implements PortListener {
|
|||
unit = cpu.getIOUnit("Port 5");
|
||||
if (unit instanceof IOPort) {
|
||||
port5 = (IOPort) unit;
|
||||
port5.setPortListener(this);
|
||||
port5.addPortListener(this);
|
||||
}
|
||||
|
||||
IOUnit usart0 = cpu.getIOUnit("USART 0");
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ import se.sics.mspsim.config.MSP430f1611Config;
|
|||
import se.sics.mspsim.core.IOPort;
|
||||
import se.sics.mspsim.core.IOUnit;
|
||||
import se.sics.mspsim.core.MSP430;
|
||||
import se.sics.mspsim.core.MSP430Config;
|
||||
import se.sics.mspsim.core.PortListener;
|
||||
import se.sics.mspsim.core.USART;
|
||||
import se.sics.mspsim.core.USARTListener;
|
||||
|
|
@ -76,26 +75,26 @@ public abstract class CC2420Node extends GenericNode implements PortListener, US
|
|||
IOUnit unit = cpu.getIOUnit("P1");
|
||||
if (unit instanceof IOPort) {
|
||||
port1 = (IOPort) unit;
|
||||
port1.setPortListener(this);
|
||||
port1.addPortListener(this);
|
||||
}
|
||||
|
||||
unit = cpu.getIOUnit("P2");
|
||||
if (unit instanceof IOPort) {
|
||||
port2 = (IOPort) unit;
|
||||
ds2411.setDataPort(port2, DS2411_DATA_PIN);
|
||||
port2.setPortListener(this);
|
||||
port2.addPortListener(this);
|
||||
}
|
||||
|
||||
unit = cpu.getIOUnit("P4");
|
||||
if (unit instanceof IOPort) {
|
||||
port4 = (IOPort) unit;
|
||||
port4.setPortListener(this);
|
||||
port4.addPortListener(this);
|
||||
}
|
||||
|
||||
unit = cpu.getIOUnit("P5");
|
||||
if (unit instanceof IOPort) {
|
||||
port5 = (IOPort) unit;
|
||||
port5.setPortListener(this);
|
||||
port5.addPortListener(this);
|
||||
}
|
||||
|
||||
IOUnit usart0 = cpu.getIOUnit("USART0");
|
||||
|
|
|
|||
|
|
@ -69,36 +69,36 @@ public class Exp5438Node extends GenericNode implements PortListener, USARTListe
|
|||
IOUnit unit = cpu.getIOUnit("P1");
|
||||
if (unit instanceof IOPort) {
|
||||
port1 = (IOPort) unit;
|
||||
port1.setPortListener(this);
|
||||
port1.addPortListener(this);
|
||||
}
|
||||
unit = cpu.getIOUnit("P3");
|
||||
if (unit instanceof IOPort) {
|
||||
port3 = (IOPort) unit;
|
||||
port3.setPortListener(this);
|
||||
port3.addPortListener(this);
|
||||
}
|
||||
|
||||
unit = cpu.getIOUnit("P4");
|
||||
if (unit instanceof IOPort) {
|
||||
port4 = (IOPort) unit;
|
||||
port4.setPortListener(this);
|
||||
port4.addPortListener(this);
|
||||
}
|
||||
|
||||
unit = cpu.getIOUnit("P5");
|
||||
if (unit instanceof IOPort) {
|
||||
port5 = (IOPort) unit;
|
||||
port5.setPortListener(this);
|
||||
port5.addPortListener(this);
|
||||
}
|
||||
|
||||
unit = cpu.getIOUnit("P7");
|
||||
if (unit instanceof IOPort) {
|
||||
port7 = (IOPort) unit;
|
||||
port7.setPortListener(this);
|
||||
port7.addPortListener(this);
|
||||
}
|
||||
|
||||
unit = cpu.getIOUnit("P8");
|
||||
if (unit instanceof IOPort) {
|
||||
port8 = (IOPort) unit;
|
||||
port8.setPortListener(this);
|
||||
port8.addPortListener(this);
|
||||
}
|
||||
|
||||
IOUnit usart0 = cpu.getIOUnit("USCI B0");
|
||||
|
|
|
|||
|
|
@ -1,19 +1,14 @@
|
|||
package se.sics.mspsim.platform.tyndall;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import se.sics.mspsim.chip.CC2420;
|
||||
import se.sics.mspsim.chip.FileM25P80;
|
||||
import se.sics.mspsim.chip.M25P80;
|
||||
import se.sics.mspsim.config.MSP430f5437Config;
|
||||
import se.sics.mspsim.core.EmulationException;
|
||||
import se.sics.mspsim.core.GenericUSCI;
|
||||
import se.sics.mspsim.core.IOPort;
|
||||
import se.sics.mspsim.core.IOUnit;
|
||||
import se.sics.mspsim.core.PortListener;
|
||||
import se.sics.mspsim.core.USARTListener;
|
||||
import se.sics.mspsim.core.USARTSource;
|
||||
import se.sics.mspsim.core.USCI;
|
||||
import se.sics.mspsim.platform.GenericNode;
|
||||
import se.sics.mspsim.ui.SerialMon;
|
||||
import se.sics.mspsim.util.ArgumentManager;
|
||||
|
|
@ -100,36 +95,36 @@ public class TyndallNode extends GenericNode implements PortListener, USARTListe
|
|||
IOUnit unit = cpu.getIOUnit("P1");
|
||||
if (unit instanceof IOPort) {
|
||||
port1 = (IOPort) unit;
|
||||
port1.setPortListener(this);
|
||||
port1.addPortListener(this);
|
||||
}
|
||||
unit = cpu.getIOUnit("P3");
|
||||
if (unit instanceof IOPort) {
|
||||
port3 = (IOPort) unit;
|
||||
port3.setPortListener(this);
|
||||
port3.addPortListener(this);
|
||||
}
|
||||
|
||||
unit = cpu.getIOUnit("P4");
|
||||
if (unit instanceof IOPort) {
|
||||
port4 = (IOPort) unit;
|
||||
port4.setPortListener(this);
|
||||
port4.addPortListener(this);
|
||||
}
|
||||
|
||||
unit = cpu.getIOUnit("P5");
|
||||
if (unit instanceof IOPort) {
|
||||
port5 = (IOPort) unit;
|
||||
port5.setPortListener(this);
|
||||
port5.addPortListener(this);
|
||||
}
|
||||
|
||||
unit = cpu.getIOUnit("P7");
|
||||
if (unit instanceof IOPort) {
|
||||
port7 = (IOPort) unit;
|
||||
port7.setPortListener(this);
|
||||
port7.addPortListener(this);
|
||||
}
|
||||
|
||||
unit = cpu.getIOUnit("P8");
|
||||
if (unit instanceof IOPort) {
|
||||
port8 = (IOPort) unit;
|
||||
port8.setPortListener(this);
|
||||
port8.addPortListener(this);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ import se.sics.mspsim.config.MSP430f2617Config;
|
|||
import se.sics.mspsim.core.IOPort;
|
||||
import se.sics.mspsim.core.IOUnit;
|
||||
import se.sics.mspsim.core.PortListener;
|
||||
import se.sics.mspsim.core.USART;
|
||||
import se.sics.mspsim.core.USARTListener;
|
||||
import se.sics.mspsim.core.USARTSource;
|
||||
import se.sics.mspsim.core.USCI;
|
||||
|
|
@ -62,7 +61,7 @@ public class Z1Node extends GenericNode implements PortListener, USARTListener {
|
|||
}
|
||||
|
||||
public void dataReceived(USARTSource source, int data) {
|
||||
USCI s = (USCI) source;
|
||||
// USCI s = (USCI) source;
|
||||
radio.dataReceived(source, data);
|
||||
flash.dataReceived(source, data);
|
||||
/* if nothing selected, just write back a random byte to these devs */
|
||||
|
|
@ -96,22 +95,22 @@ public class Z1Node extends GenericNode implements PortListener, USARTListener {
|
|||
IOUnit unit = cpu.getIOUnit("P1");
|
||||
if (unit instanceof IOPort) {
|
||||
port1 = (IOPort) unit;
|
||||
port1.setPortListener(this);
|
||||
port1.addPortListener(this);
|
||||
}
|
||||
unit = cpu.getIOUnit("P3");
|
||||
if (unit instanceof IOPort) {
|
||||
port3 = (IOPort) unit;
|
||||
port3.setPortListener(this);
|
||||
port3.addPortListener(this);
|
||||
}
|
||||
unit = cpu.getIOUnit("P4");
|
||||
if (unit instanceof IOPort) {
|
||||
port4 = (IOPort) unit;
|
||||
port4.setPortListener(this);
|
||||
port4.addPortListener(this);
|
||||
}
|
||||
unit = cpu.getIOUnit("P5");
|
||||
if (unit instanceof IOPort) {
|
||||
port5 = (IOPort) unit;
|
||||
port5.setPortListener(this);
|
||||
port5.addPortListener(this);
|
||||
}
|
||||
|
||||
IOUnit usart0 = cpu.getIOUnit("USCI B0");
|
||||
|
|
|
|||
Loading…
Reference in New Issue