Interrupts/Call

This commit is contained in:
2024-06-02 20:58:20 +02:00
parent 2294f81766
commit 8bc6d5cfd0
6 changed files with 28 additions and 37 deletions

View File

@ -16,7 +16,7 @@ public class Timer {
PreScaler.decrement();
}
} else {
increment();
increment(false);
}
}
}
@ -33,7 +33,7 @@ public class Timer {
if (PreScaler.isPrescalerOnTimer())
PreScaler.decrement();
else
increment();
increment(true);
}
} else {
// High to low
@ -41,7 +41,7 @@ public class Timer {
if (PreScaler.isPrescalerOnTimer())
PreScaler.decrement();
else
increment();
increment(true);
}
}
oldpin = newpin;
@ -49,11 +49,11 @@ public class Timer {
}
}
public static void increment() {
public static void increment(boolean manual) {
int timer = DataRegister.getDirectRegister(TIMERREG);
timer++;
if (timer > 0xFF){
Interrupts.triggerTMR0 ();
Interrupts.triggerTMR0(manual);
DataRegister.setDirectRegister(TIMERREG, 0);
} else {
DataRegister.setDirectRegister(1, timer);