Skip to content

v1.2.3 LowPower_WithWorkAndGPIOInterrupt example modification #480

@rserranosmith

Description

@rserranosmith

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions