Skip to content

Commit

Permalink
fix(pm): Properly configure a wakeup as input.
Browse files Browse the repository at this point in the history
* Other drivers properly disconnect/de-config pins now, so we need
  to be sure the wakeup trigger connects the wake pin as input.
  • Loading branch information
petejohanson committed Aug 2, 2024
1 parent 47a6715 commit 78ed721
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/src/gpio_key_wakeup_trigger.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,12 @@ static int zmk_gpio_key_wakeup_trigger_init(const struct device *dev) {
static int gpio_key_wakeup_trigger_pm_resume(const struct device *dev) {
const struct gpio_key_wakeup_trigger_config *config = dev->config;

int ret = gpio_pin_interrupt_configure_dt(&config->trigger, GPIO_INT_LEVEL_ACTIVE);
int ret = gpio_pin_configure_dt(&config->trigger, GPIO_INPUT);
if (ret < 0) {
LOG_ERR("Failed to configure wakeup trigger key GPIO pin as input (%d)", ret);
return ret;
}
ret = gpio_pin_interrupt_configure_dt(&config->trigger, GPIO_INT_LEVEL_ACTIVE);
if (ret < 0) {
LOG_ERR("Failed to configure wakeup trigger key GPIO pin interrupt (%d)", ret);
return ret;
Expand Down

0 comments on commit 78ed721

Please sign in to comment.