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

v1.2.3 LowPower_WithWorkAndGPIOInterrupt example modification #480

Open
rserranosmith opened this issue Mar 13, 2023 · 0 comments
Open

v1.2.3 LowPower_WithWorkAndGPIOInterrupt example modification #480

rserranosmith opened this issue Mar 13, 2023 · 0 comments

Comments

@rserranosmith
Copy link

Currently, to disable all pins except for the current pin were using for the interrupt the command is:

  for (int x = 0 ; x < 50 ; x++)
  {
    if(x != INPUT_BUTTON)
      am_hal_gpio_pinconfig(x , g_AM_HAL_GPIO_DISABLE);
  }

however, am_hal_gpio_pinconfig refers to the PAD number, NOT the PIN number (which INPUT_BUTTON is defined using the PIN number). Due to this, a random pin is being kept enabled, rather than the expected pin we've defined. To address this, we simply must change the function to:

  for (int x = 0 ; x < 50 ; x++)
  {
    if(x != ap3_gpio_pin2pad(INPUT_BUTTON))
      am_hal_gpio_pinconfig(x , g_AM_HAL_GPIO_DISABLE);
  }

Here is the link to the code example

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