Implemented RB0-Interrupt, added Interrupt check at step
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -758,6 +758,20 @@ public class Ram {
|
||||
//Bank0 PortB
|
||||
public synchronized void set_RB0_INT(boolean value) {
|
||||
int portB = get_PORTB();
|
||||
boolean bOldRB0 = get_RB0_INT();
|
||||
//If INTEDG is set, check if rising edge appeared
|
||||
if (get_INTEDG()) {
|
||||
//If rising edge appeared, set INT-Interrupt-Flag
|
||||
if ((!bOldRB0) && value) {
|
||||
set_INTF(true);
|
||||
}
|
||||
//If INTEDG is clear, check if falling edge appeared
|
||||
} else {
|
||||
//If falling edge appeared, set INT-Interrupt-Flag
|
||||
if (bOldRB0 && (!value)) {
|
||||
set_INTF(true);
|
||||
}
|
||||
}
|
||||
if (value) {
|
||||
portB |= 0b00000001;
|
||||
} else {
|
||||
|
||||
@@ -61,6 +61,7 @@ public class MyModel extends Thread {
|
||||
}
|
||||
//Check if interrupt was acknowledged
|
||||
if (oPIC.interruptAcknowledged()) {
|
||||
qDataToView.add(oPIC);
|
||||
//Execute ISR
|
||||
oPIC.InterruptServiceRoutine();
|
||||
} else {
|
||||
@@ -113,11 +114,16 @@ public class MyModel extends Thread {
|
||||
//Check if breakpoints are initialized
|
||||
if (abBreakpoints != null) {
|
||||
//Check if breakpoint is set
|
||||
int iProgC = oPIC.getRam().get_Programcounter();
|
||||
iProgC &= abBreakpoints.length;
|
||||
if (!abBreakpoints[iProgC]) {
|
||||
step();
|
||||
qDataToView.add(oPIC);
|
||||
if (!abBreakpoints[oPIC.getRam().get_Programcounter()]) {
|
||||
//Check if interrupt acknowledged
|
||||
if (oPIC.interruptAcknowledged()) {
|
||||
qDataToView.add(oPIC);
|
||||
//Execute ISR
|
||||
oPIC.InterruptServiceRoutine();
|
||||
} else {
|
||||
step();
|
||||
qDataToView.add(oPIC);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
System.out.println("Please load file!");
|
||||
|
||||
Reference in New Issue
Block a user