mirror of https://github.com/contiki-ng/mspsim
Added access method for the port number
This commit is contained in:
parent
40dca89e4d
commit
c1acb4b9aa
|
|
@ -27,16 +27,12 @@
|
|||
*
|
||||
* This file is part of MSPSim.
|
||||
*
|
||||
* $Id$
|
||||
*
|
||||
* -----------------------------------------------------------------
|
||||
*
|
||||
* IOPort
|
||||
*
|
||||
* Author : Joakim Eriksson
|
||||
* Created : Sun Oct 21 22:00:00 2007
|
||||
* Updated : $Date$
|
||||
* $Revision$
|
||||
*/
|
||||
|
||||
package se.sics.mspsim.core;
|
||||
|
|
@ -52,6 +48,7 @@ public class IOPort extends IOUnit {
|
|||
private static final String[] names = {
|
||||
"IN", "OUT", "DIR", "SEL" };
|
||||
|
||||
private final int port;
|
||||
private final int interrupt;
|
||||
private final MSP430Core cpu;
|
||||
private int interruptFlag;
|
||||
|
|
@ -84,11 +81,16 @@ public class IOPort extends IOUnit {
|
|||
public IOPort(MSP430Core cpu, int port,
|
||||
int interrupt, int[] memory, int offset) {
|
||||
super("P" + port, "Port " + port, memory, offset);
|
||||
this.port = port;
|
||||
this.interrupt = interrupt;
|
||||
this.interruptEnable = 0;
|
||||
this.cpu = cpu;
|
||||
}
|
||||
|
||||
public int getPort() {
|
||||
return port;
|
||||
}
|
||||
|
||||
public int getIn() {
|
||||
return memory[offset + IN];
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue