Laufzeit und Watchdog und Timer

This commit is contained in:
2024-06-02 15:16:01 +02:00
parent 45f9878047
commit c49a073cfd
7 changed files with 209 additions and 15 deletions

View File

@ -26,6 +26,13 @@ public class IOPorts {
private static Circle[] allLEDsA;
private static Circle[] allLEDsB;
private static int RB4 = 0x10;
private static int RB5 = 0x20;
private static int RB6 = 0x40;
private static int RB7 = 0x80;
public static void setBit (int address, int bit){
if (address < 7) {
dataLatch[address - PORTA] |= (1 << bit);
@ -113,10 +120,10 @@ public class IOPorts {
else
allLEDsA[index].setFill(new RadialGradient(0, 0, 0.5, 0.5, 0.7, true, null, new Stop(0, Color.RED), new Stop(1, Color.DARKGRAY)));
else
if (val || DataRegister.getDirectBit(PORTB, index - 8) == 0)
allLEDsB[index - 8].setFill(new RadialGradient(0, 0, 0.5, 0.5, 0.7, true, null, new Stop(0, Color.BLACK), new Stop(1, Color.DARKGRAY)));
else
allLEDsB[index - 8].setFill(new RadialGradient(0, 0, 0.5, 0.5, 0.7, true, null, new Stop(0, Color.RED), new Stop(1, Color.DARKGRAY)));
if (val || DataRegister.getDirectBit(PORTB, index - 8) == 0)
allLEDsB[index - 8].setFill(new RadialGradient(0, 0, 0.5, 0.5, 0.7, true, null, new Stop(0, Color.BLACK), new Stop(1, Color.DARKGRAY)));
else
allLEDsB[index - 8].setFill(new RadialGradient(0, 0, 0.5, 0.5, 0.7, true, null, new Stop(0, Color.RED), new Stop(1, Color.DARKGRAY)));
}
}
@ -152,6 +159,7 @@ public class IOPorts {
DataRegister.setDirectBit(port, bit, value);
refreshPorts();
refreshTable(parent);
}
public static void setLEDs (boolean[] leds) {
@ -192,10 +200,10 @@ public class IOPorts {
else
fileAddress = TRISB;
else
if (group.contains("A"))
fileAddress = PORTA;
else
fileAddress = PORTB;
if (group.contains("A"))
fileAddress = PORTA;
else
fileAddress = PORTB;
char index =group.charAt(group.length()-1);
int bit = Integer.parseInt(String.valueOf(index));
int value = (toggles.get(0).isSelected()) ? 1 : 0;