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

proc_int[sef] functions always access registers for core0 #904

Open
jannic opened this issue Feb 20, 2025 · 0 comments
Open

proc_int[sef] functions always access registers for core0 #904

jannic opened this issue Feb 20, 2025 · 0 comments

Comments

@jannic
Copy link
Member

jannic commented Feb 20, 2025

RP2040 has two sets of gpio interrupt registers, one for each core. The functions in

fn proc_ints(&self, proc: CoreId) -> (&pac::io_bank0::PROC0_INTS, usize);
fn proc_inte(&self, proc: CoreId) -> (&pac::io_bank0::PROC0_INTE, usize);
fn proc_intf(&self, proc: CoreId) -> (&pac::io_bank0::PROC0_INTF, usize);
always access the registers for core0. Depending on the use case, this is wrong.

Possible solutions:

  • provide separate functions for each core
  • return correct register depending on proc: CoreId parameter
  • automatically select the register for the current core

Options 2 and 3 require more changes because the registers to be returned currently have different types. Maybe they could be unified in the PAC?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant