summaryrefslogtreecommitdiff
path: root/src/peripherals
diff options
context:
space:
mode:
authorApexo2026-04-02 21:09:27 +0200
committerApexo2026-04-02 21:09:29 +0200
commitfe0b1c4bdccec7e10c1a43b3eb0a0c26d9b7fec4 (patch)
tree2515dc822132a2a81d707db1d5b1b50439c3d4e5 /src/peripherals
parentSLPCTRL: clear sleep state on interrupt (diff)
downloadanduril-sim-fe0b1c4bdccec7e10c1a43b3eb0a0c26d9b7fec4.tar.gz
anduril-sim-fe0b1c4bdccec7e10c1a43b3eb0a0c26d9b7fec4.tar.bz2
anduril-sim-fe0b1c4bdccec7e10c1a43b3eb0a0c26d9b7fec4.zip
move sleepUntil handling to main loop
This should fix the issue of wakups that are triggered when the step() functions has reached its target cycle.
Diffstat (limited to 'src/peripherals')
-rw-r--r--src/peripherals/avrdx-slpctrl.ts6
1 files changed, 0 insertions, 6 deletions
diff --git a/src/peripherals/avrdx-slpctrl.ts b/src/peripherals/avrdx-slpctrl.ts
index d592593..730d128 100644
--- a/src/peripherals/avrdx-slpctrl.ts
+++ b/src/peripherals/avrdx-slpctrl.ts
@@ -15,7 +15,6 @@ export type SMODE = typeof SMODE_IDLE_gc | typeof SMODE_STDBY_gc | typeof SMODE_
export type SleepCallback = (mode: SMODE) => void;
export class AVRDxSLPCTRL {
- sleepUntil: number = 0;
sleeping: null | SMODE = null;
callbacks: SleepCallback[];
@@ -45,11 +44,6 @@ export class AVRDxSLPCTRL {
const mode = ctrla & SMODE_gm;
this.sleeping = mode as SMODE;
- const nextEvent = (this.cpu as any).nextClockEvent;
- if (nextEvent) {
- this.sleepUntil = nextEvent.cycles;
- }
-
for (const cb of this.callbacks) {
cb(mode as SMODE);
}
If you find this content useful please consider a small donation via bitcoin: bitcoin:1mxKyQsHHugqRxPKgwaA7wUwJEGCNthn2?amount=0.001&message=Donation Scraping git contents via cgit is very resource intensive. The continued hosting of these git repositories is entirely financed by your bitcoin contributions. For donations of a least 1 mBTC you include your IP address in the message of your bitcoin donation. This will remove this message in the future for requests from your IP, which will significantly reduce token usage. In any case, any contributions to bitcoin address 1mxKyQsHHugqRxPKgwaA7wUwJEGCNthn2 are very welcome. Thanks in advance for you contribution to a self-sustaining ecosystem.