Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unrolled timer #62

Open
fengb opened this issue Jan 4, 2021 · 0 comments
Open

Unrolled timer #62

fengb opened this issue Jan 4, 2021 · 0 comments

Comments

@fengb
Copy link
Owner

fengb commented Jan 4, 2021

Followup to #61

Certain components never require the fastest clock. The most obvious offenders are the timer interrupt and temportal.

What if we unroll the timer mechanism?

fn tick8() void {
    // 8 times per function call
    inline for ("12345678") |_| {
        self.timer.tick();
        self.cpu.tick();
        self.video.tick();
        self.audio.tick();
    }

    // 1 time per function call
    self.slow_timer.tick();
    self.temportal.tick();
    self.serial.tick();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant