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

sub_801D0A8 database modification (understanding) #2

Open
theorbtwo opened this issue Feb 6, 2018 · 0 comments
Open

sub_801D0A8 database modification (understanding) #2

theorbtwo opened this issue Feb 6, 2018 · 0 comments

Comments

@theorbtwo
Copy link

I believe sub_801d0a8 is exti_set_source -- it sets the source of external interrupt n.
void exti_set_source(int source, unsigned __int8 exti_num)
Also, a new segment should be created, SYSCFG, starting at 0x40010000 ending 0x400103FF.
The following names should be created (all dwords):

  0x4001 0000: SYSCFG_MEMRMP
  0x4001 0004: SYSCFG_PMC
  0x4001 0008: SYSCFG_EXTICR1
  0x4001 0010: SYSCFG_EXTICR2
  0x4001 0014: SYSCFG_EXTICR3
  0x4001 0018: SYSCFG_EXTICR4

A tiny bit of fiddling (the constant 0x4001008 must be made into an offset manually), and the decompilation changes to:

void __fastcall exti_set_source(int source, unsigned __int8 exti_number)
{
  SYSCFG_EXTICR1[(signed int)exti_number >> 2] &= ~(0xF << 4 * (exti_number & 3));
  SYSCFG_EXTICR1[(signed int)exti_number >> 2] |= (unsigned __int8)source << 4 * (exti_number & 3);
}
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